Spaces:
Sleeping
Sleeping
Update autism_chatbot.py
Browse files- autism_chatbot.py +1 -37
autism_chatbot.py
CHANGED
@@ -155,40 +155,4 @@ Answer:"""
|
|
155 |
return {
|
156 |
'answer': answer,
|
157 |
'sources': source_info
|
158 |
-
}
|
159 |
-
|
160 |
-
# Example usage
|
161 |
-
if __name__ == "__main__":
|
162 |
-
groq_api_key = "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"
|
163 |
-
|
164 |
-
# Initialize the bot
|
165 |
-
bot = AutismResearchBot(groq_api_key=groq_api_key)
|
166 |
-
|
167 |
-
# Example question
|
168 |
-
# question = "What are the latest findings regarding sensory processing in autism?"
|
169 |
-
# response = bot.answer_question(question)
|
170 |
-
while(1):
|
171 |
-
print("*"*40)
|
172 |
-
print("*"*40)
|
173 |
-
print("*"*40)
|
174 |
-
question = input("Enter your question (or 'quit' to exit): ")
|
175 |
-
if question.lower() == 'quit':
|
176 |
-
break
|
177 |
-
response = bot.answer_question(question)
|
178 |
-
print("\nAnswer:")
|
179 |
-
print(response['answer'])
|
180 |
-
# print("\nSources used:")
|
181 |
-
# for source in response['sources']:
|
182 |
-
# print(f"\nSource metadata: {source['metadata']}")
|
183 |
-
# print(f"Content preview: {source['content']}")
|
184 |
-
# bot.answer_question
|
185 |
-
# Print response
|
186 |
-
# print("\nAnswer:")
|
187 |
-
# print(response['answer'])
|
188 |
-
# print("\nSources used:")
|
189 |
-
# for source in response['sources']:
|
190 |
-
# print(f"\nSource metadata: {source['metadata']}")
|
191 |
-
# print(f"Content preview: {source['content']}")
|
192 |
-
|
193 |
-
|
194 |
-
|
|
|
155 |
return {
|
156 |
'answer': answer,
|
157 |
'sources': source_info
|
158 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|