Does onnxruntime or onnxruntime_genai support tool_calling? #542
Replies: 4 comments 1 reply
-
Could you share more details on the tool_calling functionality? Any open-source document/code where this is done? I will add this to our planning document, and we will discuss internally if this can be supported for the upcoming release. |
Beta Was this translation helpful? Give feedback.
-
I was looking for this as well and found this Phi3Family. It states that function calling is not supported but I was able to get it to work just not reliably. If you change models it breaks. I was using the This might work for you:
Just submit this prompt and you will get a response like this:
I used regex to extract the function and reflection to invoke it. |
Beta Was this translation helpful? Give feedback.
-
Probably it would work better if you provide it with more examples rather than just instructions??? I found that phi-3 is not as good at following instructions as chatgpt, so you have to give it more examples. And also it seems to work better if you tell it to give the answers in JSON format. It likes that! I was using it to tell it to convert some english sentences into a domain specific language for my game. |
Beta Was this translation helpful? Give feedback.
-
I ended up using clustering to get an intent on what the user wanted to do then once I knew that I mapped it to the function after that I did use JSON to extract the entities I wanted if not then I knew to keep asking the user for the details. That worked way better. My next step is to use an agent to get what the user wants and to get the entities I need for my functions. |
Beta Was this translation helpful? Give feedback.
-
I am looking to use phi-3 model (using ONNX runtime) to integrate function_calling / tool_calling? Is there any documentation/API to add tool_calling along the prompt? Also, how can I change the system prompt?
Beta Was this translation helpful? Give feedback.
All reactions