Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -132,7 +132,8 @@ async def digiyatra_query_table(query: FollowupQueryModel, db: Annotated[Any, De
|
|
| 132 |
user_id=query.user_id,
|
| 133 |
limit=limit
|
| 134 |
)
|
| 135 |
-
|
|
|
|
| 136 |
|
| 137 |
@app.post("/digiyatra-followup")
|
| 138 |
async def followup_agent(query: FollowupQueryModel, background_tasks: BackgroundTasks):
|
|
@@ -149,7 +150,7 @@ async def followup_agent(query: FollowupQueryModel, background_tasks: Background
|
|
| 149 |
]
|
| 150 |
|
| 151 |
digiyatra_response = await digiyatra_query_table(query, db=get_db_connection(), limit=5)
|
| 152 |
-
user_query_with_context = f"{query.query} \n\n
|
| 153 |
conversations[query.conversation_id].append({"role": "user", "content": user_query_with_context})
|
| 154 |
last_activity[query.conversation_id] = time.time()
|
| 155 |
|
|
|
|
| 132 |
user_id=query.user_id,
|
| 133 |
limit=limit
|
| 134 |
)
|
| 135 |
+
texts = [item['text'] for item in response.results['data']]
|
| 136 |
+
return str(texts)
|
| 137 |
|
| 138 |
@app.post("/digiyatra-followup")
|
| 139 |
async def followup_agent(query: FollowupQueryModel, background_tasks: BackgroundTasks):
|
|
|
|
| 150 |
]
|
| 151 |
|
| 152 |
digiyatra_response = await digiyatra_query_table(query, db=get_db_connection(), limit=5)
|
| 153 |
+
user_query_with_context = f"{query.query} \n\n ADDITIONAL CONTEXT: {digiyatra_response}"
|
| 154 |
conversations[query.conversation_id].append({"role": "user", "content": user_query_with_context})
|
| 155 |
last_activity[query.conversation_id] = time.time()
|
| 156 |
|