Document content is not part of the context?
Context
Hello, I’m currently working on the Mermaid editor and have chosen this project as my starting point.
The scenario I have in mind involves a user requesting the creation of a Mermaid schema and then having the ability to modify the schema, either manually or through a chat interface.
Issue
I’ve observed that the document content isn't included in the context; only document IDs are. This results in any user questions regarding the current schema in the chat being misleading, as the AI lacks the context of the tool's invocation and its outcome.
Questions
Q: Will the document content be included in the context in the future?
Q: If yes, do you have an ETA for that?
Q: If no, could you please provide some initial guidance on the proper way to add such context without disrupting the application?
Other
- It seems as if the content of the tool invocation is not populated here intentionally https://github.com/vercel/ai-chatbot/blob/93b02a85e1bef5a2efb1f7c55364f1a56357b8c7/lib/ai/tools/create-document.ts#L143
Solutions
- Populate context into chat.
- Add additional tool command to explain the current version of document.
facing same issue!
Allow the artifact to populate the tool result would solve this.
@jeremyphilemon Have you seen this? Artifact content not being included in the context for follow-up questions seems like a big miss.
One way to do this would be to provide a tool called read-document which simply returns the current content of the artifact to the LLM.
But artifacts are broken in other major ways. See #948 where create-document does not take the chat context into account for artifact generation! 😲