-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Support Function Calling agent type in Agent framework #3000
Comments
I can be assignee for this new attribute. |
Can you provide more context? Such as the request to call the agent or the formatted tool description. |
I would prefer a new class other than modifying existing code in MLChatAgentRunner. |
To call agent, we still use the same parameters as REACT one. And following is a tool description:
|
My plan is create two different class like ReactChatAgentRunner/ FunctionCallingAgentRunner, both reuse existing code of MLChatAgentRunner and then implement their own code to parse response and format input. |
Thanks for sharing these. Should user specify parameters like this when creating a tool? Or maybe we parse these parameter from tools? |
It makes sense. Just wondering if ReactChatAgentRunner will be the original |
This looks good, one question: Did we implement any benchmark on this? The accuracy between agent framework tool selection and function calling in API? |
Problem statement
In our current agent framework, we support both flow agent and REACT chat agent. Recently, a new chat agent type called function calling has been introduced, offering more powerful capabilities to generate contextually relevant, formatted text output. This output can be used by developers to trigger method calls or API requests, referred to as tools. Function calling is an inherent capability of the LLM itself. Function calling provides a more structured and organized approach, enabling deterministic results from large language models (LLMs) with a reduced error rate. This advanced functionality requires additional fine-tuning in pretrained models, which is now supported by the latest models, such as GPT-3.5/4 and the Claude 3 family.
Proposed Solution
The input and output are well-structured when using function calling with an LLM. Take bedrock's Claude 3 as example (see function calling full API):
Input:
The tools here is a parameter in the API calling instead of part of prompt. Also, the output would be in the following structure:
If we detect the keyword tool_use, we should execute the tool; Otherwise, we should return the result to the user. This input-output structure and execution logic are not compatible with the current REACT agent. Therefore, we propose adding another agent type to configure this functionality.
Implementation details
We could still reuse part of code in Class MLChatAgentRunner, like memory. But the logic to parse the response from LLM and extract next step should be changed. Also, logic to format the prompt should also be different since tools now are parameters.
The text was updated successfully, but these errors were encountered: