fix(openai) : solve the correct annotaitons url_citation
file_citation
container_file_citation
file_path
#9453
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
fix
response.output_text.annotation.added
object.I found some differences between OpenAI API and AI SDK.
OpenAI API's annotations are very useful for expand their features.
Built-in tools such as code interpreters can obtain important results from annotations.
Summary
Currently there are 4 types in annotations
file_citation
,url_citation
,container_file_citation
andfile_path
.file_path
.quota
was Assistants API's property..nullish()
option.index
orstart_index
,end_index
.OpenAI API Reference - Responses API annotations Reference
github OpenAI annotations definitions
Manual Verification
Checklist
pnpm changeset
in the project root)pnpm prettier-fix
in the project root)Future Work
Add a test for
file_path
annotation.Currently I don't know how to get this annotation.
Related Issues