Claude API lets you add instructions and tools mid-conversation and change the thinking level(qiita.com)
Writing language: KoreanRead in the original language
Plain summary
- You can append an instruction to the AI (system prompt) in the middle of a conversation to change behavior such as tone or language. The author explains that because the earlier part is not changed, the prompt cache (reuse of previously processed content) is preserved.
- Tool definitions can also be added or removed during a conversation. In the author's example, when a time lookup tool was added to a conversation that had only a weather tool, both tools were called together. The author states this was a beta feature at the time of posting.
- The thinking level (effort) can also be changed during a conversation. In the author's run, the thinking tokens were high 465, low 0, and high again 169. This feature also requires specifying a beta header.
- You can also insert a temporary instruction that applies only until the next user turn. In the author's example, only response number 5 was fixed to French, and response number 6 returned to normal. This feature is also in beta.
Found on
Qiita ↗ / Published by source
Have you run into something like this? Tell us in a line or two what you did. You do not need to know the product.