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
{{ message }}
Repository navigation
Feature: scriptable citations / annotations on text responses #547
Responses API output_text parts are always emitted with annotations: [], and Chat Completions / Anthropic / Gemini have no citation equivalent. There is no way to script a model turn that returns sources, so clients that surface citations (e.g. the AI SDK source stream part) can't be tested end-to-end against aimock.
Proposal
An optional citations (or annotations) field on TextResponse / ContentWithToolCallsResponse, e.g.
llm.on({endpoint: 'responses'},{content: 'Paris is the capital of France.',citations: [{type: 'url',url: 'https://example.com/paris',title: 'Paris',startIndex: 0,endIndex: 5}],});
Emitted per provider wire format:
OpenAI Responses: url_citation (and file_citation) entries in output_text.annotations, plus response.output_text.annotation.added events when streaming
Mastra is moving its agent-loop regression tests from hand-written mock models to aimock scenarios; source/citation propagation is one of the few behaviours we can't currently cover.
Your PR #550 covers Responses citations. It just needs the two changes from review: rename the new file type so it doesn't clash with FixtureFile, and keep Gemini files on the combined content + tool-call responses. Once that's in, I'll leave this open for the other providers.
Activity
jpr5 commentedon Oct 21, 2026
Your PR #550 covers Responses citations. It just needs the two changes from review: rename the new file type so it doesn't clash with
FixtureFile, and keep Gemini files on the combined content + tool-call responses. Once that's in, I'll leave this open for the other providers.jpr5 commentedon Oct 23, 2026
Reopening — #550 shipped citations for the Responses API only. Chat Completions, Anthropic and Gemini are next.
feat: citations and generated files on the remaining providers (#578)
feat(responses): scriptable url_citation annotations via fixture cita…
feat: scriptable citations (Responses) and model-generated files (Gem…