pipecat-ai / pipecat

Open Source framework for voice and multimodal conversational AI
BSD 2-Clause "Simplified" License
2.8k stars 198 forks source link

Multiple function calls openai #292

Open cristobal-larach opened 1 month ago

cristobal-larach commented 1 month ago

in the file services.openai.py, why is line 147 function_name += tool_call.function.name and not function_name = tool_call.function.name?

In particular, i am getting the following error: Uncaught exception in LLMUserContextAggregator#0: The LLM tried to call a function named 'collect_namecollect_agecollect_payment_method', but there isn't a callback registered for that function.

it happens whenever i execute a function, for example, giving my full name, then the flow goes on to collecting my age, and i try to correct my full name saying "oh, i am sorry, my name is not {previous}. it is {new_name}". I have noticed that in the patient-intake example, every function call modifies the context and just allows one function tool. Can i keep a context with many function tools (so as to call them more than once during the flow of events).??

cristobal-larach commented 1 month ago

Also, is there any way to add tools that are different to functions (for example, file_search to enable and enhance Retrieval Augmented Generation)? Thanks!

cartesis07 commented 1 week ago

same issue I had to change the class

aconchillo commented 1 week ago

I believe this PR https://github.com/pipecat-ai/pipecat/pull/346 will fix this issue.