pvanand commited on
Commit
543eb4f
1 Parent(s): 0509a02

include references

Browse files
Files changed (1) hide show
  1. main.py +3 -3
main.py CHANGED
@@ -294,7 +294,7 @@ def analyze_data(query, data_type="news"):
294
  ]
295
 
296
  logger.info(f"{data_type.capitalize()} analysis completed")
297
- return messages
298
 
299
  class QueryModel(BaseModel):
300
  query: str = Field(..., description="Search query")
@@ -312,7 +312,7 @@ class QueryModel(BaseModel):
312
 
313
  def search_assistant_api(query, data_type, model="openai/gpt-4o-mini"):
314
  logger.info(f"Received {data_type} assistant query: {query}")
315
- messages = analyze_data(query, data_type)
316
 
317
  if not messages:
318
  logger.error(f"Failed to fetch {data_type} data")
@@ -326,7 +326,7 @@ def search_assistant_api(query, data_type, model="openai/gpt-4o-mini"):
326
  yield content
327
  logger.info(f"Completed {data_type} assistant response for query: {query}")
328
  logger.info(f"LLM Response: {full_response}")
329
-
330
  return process_response
331
 
332
  def create_streaming_response(generator):
 
294
  ]
295
 
296
  logger.info(f"{data_type.capitalize()} analysis completed")
297
+ return messages,search_data
298
 
299
  class QueryModel(BaseModel):
300
  query: str = Field(..., description="Search query")
 
312
 
313
  def search_assistant_api(query, data_type, model="openai/gpt-4o-mini"):
314
  logger.info(f"Received {data_type} assistant query: {query}")
315
+ messages, search_data = analyze_data(query, data_type)
316
 
317
  if not messages:
318
  logger.error(f"Failed to fetch {data_type} data")
 
326
  yield content
327
  logger.info(f"Completed {data_type} assistant response for query: {query}")
328
  logger.info(f"LLM Response: {full_response}")
329
+ yield "<json>"+ json.dumps(search_data)+"</json>"
330
  return process_response
331
 
332
  def create_streaming_response(generator):