We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ce6e31f commit 554e82cCopy full SHA for 554e82c
spanish/function_calling.py renamed to spanish/function_calling_basic.py
@@ -69,6 +69,11 @@
69
tools=tools,
70
)
71
72
-print(f"Respuesta de {API_HOST}: \n")
73
-print(response.choices[0].message.tool_calls[0].function.name)
74
-print(response.choices[0].message.tool_calls[0].function.arguments)
+print(f"Respuesta de {MODEL_NAME} en {API_HOST}: \n")
+
+if response.choices[0].message.tool_calls:
75
+ tool_call = response.choices[0].message.tool_calls[0]
76
+ print(tool_call.function.name)
77
+ print(tool_call.function.arguments)
78
+else:
79
+ print(response.choices[0].message.content)
0 commit comments