pvanand commited on
Commit
3806b5f
·
verified ·
1 Parent(s): 0990769

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -2
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
- return response.results['data'][0]['text']
 
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 FAQ Context for ANSWERING: {digiyatra_response}"
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