Add subqueries for internet-connected search results and update client-side code accordingly

- Add a wrapper method to help make direct queries to the LLM and determine any intermediate responses needed for handling the request
This commit is contained in:
sabaimran
2023-11-20 15:19:15 -08:00
parent b8e6883a81
commit fee99779bf
9 changed files with 253 additions and 86 deletions

View File

@@ -100,6 +100,27 @@ def extract_questions(
return questions
def send_message_to_model(
message,
api_key,
model,
):
"""
Send message to model
"""
messages = [ChatMessage(content=message, role="assistant")]
# Get Response from GPT
return completion_with_backoff(
messages=messages,
model_name=model,
temperature=0,
max_tokens=100,
model_kwargs={"stop": ["A: ", "\n"]},
openai_api_key=api_key,
)
def converse(
references,
online_results,