We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 06ac34e commit 38beff2Copy full SHA for 38beff2
1 file changed
s07_skill_loading/code.py
@@ -344,13 +344,10 @@ def agent_loop(messages: list):
344
global rounds_since_todo
345
while True:
346
if rounds_since_todo >= 3 and messages:
347
- last = messages[-1]
348
- if last["role"] == "user" and isinstance(last.get("content"), list):
349
- last["content"].insert(0, {
350
- "type": "text",
351
- "text": "<reminder>Update your todos.</reminder>",
352
- })
353
-
+ messages.append({"role": "user",
+ "content": "<reminder>Update your todos.</reminder>"})
+ rounds_since_todo = 0
+
354
response = client.messages.create(
355
model=MODEL, system=SYSTEM, messages=messages,
356
tools=TOOLS, max_tokens=8000,
0 commit comments