Even within the InferenceClient class, chat_completion is quite special because it is modeled on the OpenAI API. For now, the return value needs to be plain like this.
output = client.chat_completion(messages=messages, tools=tools, max_tokens=500, temperature=0.3)
print(output.choices[0].message.tool_calls[0].function)
print(output.choices[0].message.content)
output = client.chat_completion(messages=messages, max_tokens=500, temperature=0.3)
print(output.choices[0].message.content)
ChatCompletionOutputFunctionDefinition(arguments={'format': 'celsius', 'location': 'San Giustino, Italy'}, name='get_current_weather', description=None)
None
The current temperature in San Giustino, Italy, is 22.0 degrees Celsius. However, please note that this information might change depending on the time of day and season. For the most accurate and up-to-date weather information, you can check a reliable weather website or app.
It’s probably buggy.