Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Feature: scriptable citations / annotations on text responses

Aperta
#547 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@abhiaiyer91 ci sta già lavorando.

Dal 17/10/2026.

  • #550 di @abhiaiyer91 — aperta

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
typescript

Direzione di ricerca

Start with the TextResponse and ContentWithToolCallsResponse response types, then trace the Responses, Chat Completions, Anthropic, and Gemini serialization and streaming paths. Locate tests covering output_text.annotations and provider-specific streaming events. Done means optional citations round-trip in each supported wire format, including streaming annotations or citation deltas.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

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
  • Chat Completions: message.annotations / delta.annotations (url_citation)
  • Anthropic: citations on text blocks (citations_delta when streaming)
  • Gemini: groundingMetadata.groundingChunks / groundingSupports

Use case

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.

Lingua principale
TypeScript
Stelle
979
Fork
84
Merge medio
1g 5h
PR unite (30g)
75

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di CopilotKit/aimock

Tutte le issue di CopilotKit/aimock

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.