Open kcolemangt opened 11 months ago
Hey Keith! Thank you very much for trying our Gorilla OpenFunctions model.
We have read your inputs & outputs. Here are some corrections and suggestions to have it output better result:
messages
variable defines the natural language prompt that you come up with. For example, if you're using the get_current_weather
function, a prompt like "What's the weather like in SF?" will make the most sense for the model to assemble the function call. Here's an example setup:
messages = [{"role": "user", "content": "What's the weather like in SF?"}]
functions = [
{
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA. State must be included",
},
"unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
},
"required": ["location"],
},
}
]
When functions are made available to the model they are incorrectly and unnecessarily invoked. System messages or modified user messages did little to improve outcomes.
Input with function available
Outputs with function available
gorilla-openfunctions-v1
incorrect function and location
incorrect parameter and no function
incorrect "function"
gorilla-openfunctions-v0
missing parameter and unnecessary function call
Input without function available
Outputs without function available
gorilla-openfunctions-v1
gorilla-openfunctions-v0