Spaces:
Running
Running
modify store and config
Browse files- config.py +2 -2
- gh_issue_loader.py +7 -2
config.py
CHANGED
|
@@ -1,13 +1,13 @@
|
|
| 1 |
import os
|
| 2 |
|
| 3 |
|
| 4 |
-
SAAS =
|
| 5 |
|
| 6 |
|
| 7 |
def get_db_config():
|
| 8 |
url = os.environ["QDRANT_URL"]
|
| 9 |
api_key = os.environ["QDRANT_API_KEY"]
|
| 10 |
-
collection_name = "gh-
|
| 11 |
return url, api_key, collection_name
|
| 12 |
|
| 13 |
|
|
|
|
| 1 |
import os
|
| 2 |
|
| 3 |
|
| 4 |
+
SAAS = True
|
| 5 |
|
| 6 |
|
| 7 |
def get_db_config():
|
| 8 |
url = os.environ["QDRANT_URL"]
|
| 9 |
api_key = os.environ["QDRANT_API_KEY"]
|
| 10 |
+
collection_name = "gh-issue-search"
|
| 11 |
return url, api_key, collection_name
|
| 12 |
|
| 13 |
|
gh_issue_loader.py
CHANGED
|
@@ -27,17 +27,22 @@ def get_contents(repo_name: str, filename: str) -> Iterator[tuple[Issue, str]]:
|
|
| 27 |
with open(filename, "r") as f:
|
| 28 |
obj = [json.loads(line) for line in f]
|
| 29 |
for data in obj:
|
|
|
|
|
|
|
| 30 |
issue = Issue(
|
| 31 |
repo_name=repo_name,
|
| 32 |
id=data["number"],
|
| 33 |
-
title=
|
| 34 |
created_at=date_to_int(data["created_at"]),
|
| 35 |
user=data["user.login"],
|
| 36 |
url=data["html_url"],
|
| 37 |
labels=data["labels_"],
|
| 38 |
type_="issue",
|
| 39 |
)
|
| 40 |
-
|
|
|
|
|
|
|
|
|
|
| 41 |
comments = data["comments_"]
|
| 42 |
for comment in comments:
|
| 43 |
issue = Issue(
|
|
|
|
| 27 |
with open(filename, "r") as f:
|
| 28 |
obj = [json.loads(line) for line in f]
|
| 29 |
for data in obj:
|
| 30 |
+
title = data["title"]
|
| 31 |
+
body = data["body"]
|
| 32 |
issue = Issue(
|
| 33 |
repo_name=repo_name,
|
| 34 |
id=data["number"],
|
| 35 |
+
title=title,
|
| 36 |
created_at=date_to_int(data["created_at"]),
|
| 37 |
user=data["user.login"],
|
| 38 |
url=data["html_url"],
|
| 39 |
labels=data["labels_"],
|
| 40 |
type_="issue",
|
| 41 |
)
|
| 42 |
+
text = title
|
| 43 |
+
if body:
|
| 44 |
+
text += "\n\n" + body
|
| 45 |
+
yield issue, text
|
| 46 |
comments = data["comments_"]
|
| 47 |
for comment in comments:
|
| 48 |
issue = Issue(
|