ServiceNow / TapeAgents

TapeAgents is a framework that facilitates all stages of the LLM Agent development lifecycle
https://www.servicenow.com/research/TapeAgentsFramework.pdf
Apache License 2.0
124 stars 11 forks source link

open_ai example not working #66

Closed emrecanacikgoz closed 3 weeks ago

emrecanacikgoz commented 1 month ago

Hi, thank you for the contribution.

I am able to run the Canada example in readme. However, I cannot run both examples/openai_function_calling.py and examples/openai_function_calling_demo.py which gives the following error:

litellm.exceptions.BadRequestError: OpenAIException - Error code: 400 - {'error': {'message': "Missing required parameter: 'messages[0].role'.", 'type': 'invalid_request_error', 'param': 'messages[0].role', 'code': 'missing_required_parameter'}} 

In this case, it seems the API call didn't provide the role field for the first message (messages[0]), which is mandatory. Could you help me to fix it?

rizar commented 4 weeks ago

Hi @emrecanacikgoz , sorry, this is exampled is very outdated. We will be update it shortly, we will also remove a handful of other similarly outdated examples.

rizar commented 4 weeks ago

Meanwhile, check out our intro notebook, it has function calling examples.

ollmer commented 3 weeks ago

Hi, thank you for the feedback! The fix is ready and will be merged into the main soon.

ollmer commented 3 weeks ago

@emrecanacikgoz the example should work now, give it a try.