add section for 'choice' based responses .

- when response is a choice , this determines how it is handled.
- current implementation uses a placeholder for llm_output_parser , it needs to be updated ( next commit )
pull/611/head
Sambhav Dixit 3 months ago committed by GitHub
parent c60789eb54
commit e06e898486
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -812,6 +812,15 @@ class Agent:
*response_args, **kwargs
)
# Check if response is a dictionary and has 'choices' key
if isinstance(response, dict) and 'choices' in response:
response = response['choices'][0]['message']['content']
elif isinstance(response, str):
# If response is already a string, use it as is
pass
else:
raise ValueError(f"Unexpected response format: {type(response)}")
# Check and execute tools
if self.tools is not None:
print(f"self.tools is not None: {response}")

Loading…
Cancel
Save