Incorrect Prompt.ts: Double Guidance for Tool Usage
Can I get anyone else's opinion to confirm whether the artifactsPrompt in lib/ai/prompts.ts text is incorrectly referencing or confusing the LLM on how to use the registered tools here? This is later appended as "systemPrompt" and sent to the LLM for all queries.
When to use `createDocument`: ..
When NOT to use `createDocument`: ..
Using `updateDocument`: ..
When NOT to use `updateDocument`: ..
My concern is the tool is already registered here. This additional prompting is not recommended or discussed in the docs.
Is this type of "explicit prompt suggestion" best practice, unneccessary, or potentially confusing for the LLM?
Thanks
Asking this question to an LLM provided better guidance, so perhaps it should be included in the core SDK docs?
Including specific tool usage instructions in the system prompt serves several important purposes: Usage guidance: The prompt explicitly instructs the AI on when to use (or not use) the tools with statements like "DO NOT UPDATE DOCUMENTS IMMEDIATELY AFTER CREATING THEM." Behavioral constraints: The prompt sets guardrails for appropriate tool usage that wouldn't be obvious from the tool's function signature alone. Context awareness: It helps the model understand how the tools fit into the user interface ("When artifact is open, it is on the right side of the screen..."). Tool selection: The prompt provides decision criteria for choosing between different tools ("When to use createDocument" vs "When NOT to use createDocument").