Spaces:
Running
Running
Delete url markup
Browse files
rag.py
CHANGED
@@ -130,13 +130,6 @@ class RAG:
|
|
130 |
response = chat_completion.choices[0].message.content
|
131 |
|
132 |
return response
|
133 |
-
|
134 |
-
def get_wiki_url(self, title):
|
135 |
-
base_url = "https://ca.wikipedia.org/wiki/"
|
136 |
-
|
137 |
-
formatted_title = title.replace(" ", "_")
|
138 |
-
|
139 |
-
return base_url + formatted_title
|
140 |
|
141 |
def beautiful_context(self, docs):
|
142 |
|
@@ -147,8 +140,8 @@ class RAG:
|
|
147 |
for doc in docs:
|
148 |
text_context += doc[0].page_content
|
149 |
full_context += doc[0].page_content + "\n"
|
150 |
-
full_context += doc[0].metadata["url"] + "\n\n"
|
151 |
-
source_context.append(
|
152 |
|
153 |
return text_context, full_context, source_context
|
154 |
|
|
|
130 |
response = chat_completion.choices[0].message.content
|
131 |
|
132 |
return response
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
|
134 |
def beautiful_context(self, docs):
|
135 |
|
|
|
140 |
for doc in docs:
|
141 |
text_context += doc[0].page_content
|
142 |
full_context += doc[0].page_content + "\n"
|
143 |
+
#full_context += doc[0].metadata["url"] + "\n\n"
|
144 |
+
source_context.append(doc[0].metadata["title"])
|
145 |
|
146 |
return text_context, full_context, source_context
|
147 |
|