OpenAI integrations for Microsoft Agent Framework.
Actively maintained. Last release 3 weeks ago. A safe choice.
pip install agent-framework-openaiagent-framework-openai
OpenAI integration for Microsoft Agent Framework.
This package provides:
OpenAIChatClientfor the OpenAI Responses APIOpenAIChatCompletionClientfor the Chat Completions APIOpenAIEmbeddingClientfor embeddings
Installation
pip install agent-framework-openai
Which chat client should I use?
Use OpenAIChatClient for new work unless you specifically need the Chat Completions API.
OpenAIChatClientuses the Responses API and is the preferred general-purpose chat client.OpenAIChatCompletionClientuses the Chat Completions API and is mainly for compatibility with existing Chat Completions-based integrations.
The previous deprecated Responses alias has been removed. Use OpenAIChatClient directly.
Citations and annotations
OpenAIChatClient exposes Responses API URL, file, file-path, and container-file citations through
Content.annotations, using the provider-neutral Annotation(type="citation", ...) representation.
URL citations retain their title, URL, and text-span indices, including SharePoint grounding citations.
Inspect content.annotations in response messages or streaming update.contents. Annotations can arrive
in an update whose content.text is empty: completed content parts and output messages supply citations
without repeating text that was already streamed. Annotation-added and completion events are deduplicated
by item, content part, and annotation position, so separate references to the same source remain distinct.
Foundry clients that inherit the Responses parser receive the same behavior.
Hosted function results
OpenAIChatClient parses hosted function_call_output items in both streaming and non-streaming responses.
Each result retains its call_id for correlation with the corresponding function call.
Outputs explicitly marked in_progress are deferred without claiming their deduplication ID, so an empty
or partial .added placeholder cannot suppress a later .done result. Completed empty results remain valid.
Rich output parts are available through the function result's items; the backward-compatible result
field contains only their text. Image and file parts retain their explicit provider type in OpenAI replay,
including hosted file references, extensionless image URLs, and files whose names have image extensions.