Skip to content

Commit

Permalink
Merge branch 'develop_qatalive' of https://github.com/vishalgtingre/a…
Browse files Browse the repository at this point in the history
…zure-search-openai-demo into develop_qatalive
  • Loading branch information
vishalgtingre committed Nov 5, 2023
2 parents a656624 + 42a8d89 commit d226448
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/backend/approaches/chatreadretrieveread.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,13 @@ async def run_until_final_call(
functions=self.functions,
function_call="auto",
)

query_text = self.get_search_query(chat_completion, original_user_query)

response_message = chat_completion["choices"][0]["message"]
print (chat_completion)
print ("response_message")
print (response_message)
query_text = self.get_search_query(chat_completion, original_user_query)
print ("chat_completion")
print(chat_completion)
# STEP 2: Retrieve relevant documents from the search index with the GPT optimized query

query_text = None
if response_message.get("function_call"):
Expand Down Expand Up @@ -554,6 +556,8 @@ def get_search_query(self, chat_completion: dict[str, Any], user_query: str):
arg = json.loads(function_call["arguments"])
search_query = arg.get("search_query", self.NO_RESPONSE)
if search_query != self.NO_RESPONSE:
print("the search_query")
print(search_query)
return search_query
elif query_text := response_message.get("content"):
if query_text.strip() != self.NO_RESPONSE:
Expand Down

0 comments on commit d226448

Please sign in to comment.