Skip to content

Support url_citation annotations in .outputTextAnnotationAdded events #258

@richarddas

Description

@richarddas

Current behavior:

AIProxySwift 0.141.0 supports .outputTextAnnotationAdded for .fileCitation only. Web search citations aren't available as annotations.

What's missing:

The Responses API includes url_citation annotations with start_index/end_index indicating where URLs are cited in the text. These should be exposed via .outputTextAnnotationAdded, similar to .fileCitation.

Why it's needed:

Annotation indices allow precise detection of citation positions without regex parsing. This is more reliable and matches how file citations are handled.

Reference:

OpenAI docs:

  1. response.output_text.annotation.added with url_citation type containing url, title, start_index, end_index.

  2. https://platform.openai.com/docs/guides/tools-web-search

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions