You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
system ="You are a helpful assistant that can execute Python code. Only respond with the code to be executed and nothing else. Strip backticks in code blocks."
250
-
prompt ="Calculate how many r's are in the word 'strawberry'."
249
+
system ="""
250
+
You are a helpful assistant that can execute code written in the C programming language.
251
+
Only respond with the code written in the C programming language that needs to be executed and nothing else.
252
+
Strip the backticks in code blocks.
253
+
"""
254
+
prompt ="How many r's are in the word 'strawberry'."
251
255
252
256
response = client.chat(
253
257
model="gpt-oss:120b-cloud",
@@ -258,10 +262,10 @@ response = client.chat(
258
262
)
259
263
260
264
code = response["message"]["content"]
261
-
print(f"Generated code:\n{code}")
265
+
print(f"CODE GENERATED BY THE MODEL:\n{code}\n")
262
266
263
-
result = judge0.run(source_code=code, language=judge0.PYTHON)
264
-
print(f"Execution result:\n{result.stdout}")
267
+
result = judge0.run(source_code=code, language=judge0.C)
268
+
print(f"CODE EXECUTION RESULT:\n{result.stdout}")
265
269
```
266
270
267
271
#### Tool Calling (a.k.a. Function Calling) with Ollama
0 commit comments