▶️Fucntion calling
Define an API function
// Set the brightness and color temperature of a room light. (mock API).
// brightness: Light level from 0 to 100. Zero is off and 100 is full brightness
// colorTemp: Color temperature of the light fixture, which can be `daylight`, `cool` or `warm`.
public Dictionary<string, object> SetLightValues(int brightness, string colorTemp)
{
// Implement the real API call here
// Return the set brightness and color temperature.
return new Dictionary<string, object>
{
{ "brightness", brightness },
{ "colorTemperature", colorTemp }
};
}def set_light_values(brightness, color_temp):
"""Set the brightness and color temperature of a room light. (mock API).
Args:
brightness: Light level from 0 to 100. Zero is off and 100 is full brightness
color_temp: Color temperature of the light fixture, which can be `daylight`, `cool` or `warm`.
Returns:
A dictionary containing the set brightness and color temperature.
"""
return {
"brightness": brightness,
"colorTemperature": color_temp
}Declare functions during model initialization
Generate a function call
Parallel function calling
Function call data type mapping
Last updated
