How to call functions with chat models - Without Forcing Function
# if we don't force the model to use get_n_day_weather_forecast it may not messages = [] messages.append({'role': 'system', 'content': 'Don't make assumptions about what values to plug into functions. Ask for clarification if a user request is ambiguous.'}) messages.append({'role': 'user', 'content': 'Give me a weather report for Toronto, Canada.'}) chat_response = chat_completion_request( messages, functions=functions ) chat_response.json()['choices'][0]['message']