Spaces:
Sleeping
Sleeping
robinroy03
commited on
Commit
·
12802eb
1
Parent(s):
f5001ff
line number update in references
Browse files
utils.py
CHANGED
@@ -10,7 +10,12 @@ def prompt_generator(question: str, db_knn: dict) -> tuple[str, str, str]:
|
|
10 |
data = db_knn['matches'][i]['metadata']['data']
|
11 |
context += (data + "\n")
|
12 |
data = ast.literal_eval(data)
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
14 |
if data.get("function_name"):
|
15 |
references += f"\tFunction Name: {data.get('function_name')}"
|
16 |
elif data.get("class_name"):
|
|
|
10 |
data = db_knn['matches'][i]['metadata']['data']
|
11 |
context += (data + "\n")
|
12 |
data = ast.literal_eval(data)
|
13 |
+
|
14 |
+
if data['type'] == "function" or data['type'] == "class":
|
15 |
+
line_number = f"#L{data['lineno'][0]}-L{data['lineno'][1]}"
|
16 |
+
|
17 |
+
references += ("<https://github.com/fury-gl/fury/blob/" + data['path'] + line_number + ">").replace("fury-0.10.0", "v0.10.0")
|
18 |
+
|
19 |
if data.get("function_name"):
|
20 |
references += f"\tFunction Name: {data.get('function_name')}"
|
21 |
elif data.get("class_name"):
|