How to call functions with chat models - Force No Function
We can also force the model to not use a function at all. By doing so we prevent it from producing a proper function call. 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 the current weather (use Celcius) for Toronto, Canada.'}) chat_response = chat_completion_request( messages, functions=functions, function_call='none' ) chat_response.json()['choices'][0]['message']