Question about parameter's description in tools #392
-
Using the provided example in the playground shows something like this: {
"name": "get_weather",
"description": "Determine weather in my location",
"strict": true,
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state e.g. San Francisco, CA"
},
"unit": {
"type": "string",
"enum": [
"c",
"f"
]
}
},
"additionalProperties": false,
"required": [
"location",
"unit"
]
}
} where each parameter has a description. When I use the OpenAI.Tool.GetOrCreateTool for a similar class it generates: {
"name": "GetCurrentWeatherCTAsync_aab8da0fe2feb53b7aede73494ef5710",
"description": "Cuando el usuario te consulte sobre el clima en algún lugar geográfico, debes pasar el nombre del lugar como parámetro.",
"strict": false,
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string"
}
},
"required": [
"city"
],
"additionalProperties": false
}
} without desctiption of the parameter. My class is: namespace bizzuWeatherCustomTool;
public class WeatherCustomTool
{
/// <summary>
/// Asynchronously gets the current weather for the specified city.
/// </summary>
/// <param name="city">The name of the city to get the weather for.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains a string with the current weather information or an error message.</returns>
public static async Task<string> GetCurrentWeatherCTAsync(string city)
{
try
{
return "{hot}";
}
catch (Exception ex)
{
return $"Error al obtener el clima: {ex.Message}";
}
}
} Is it important for the model to have descriptions? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
The descriptions just help the llm make a decision about what values to return and how to use the function call. They're optional, but help guide the model to make more accurate responses. |
Beta Was this translation helpful? Give feedback.
-
Hi Stephen!, I need to set the Strict property of the function parameter's definition to true |
Beta Was this translation helpful? Give feedback.
There are attributes for defining function calls:
OpenAI-DotNet/OpenAI-DotNet-Tests/TestServices/WeatherService.cs
Lines 8 to 32 in ab908ac