@polymind-inc/agent-framework-openai
v0.3.0
Published
OpenAI (and Azure OpenAI) chat client for the Agent Framework, built on the official openai SDK.
Downloads
3,541
Maintainers
Readme
@polymind-inc/agent-framework-openai
Constituent package. The supported way to use the Agent Framework is the main
@polymind-inc/agent-frameworkpackage, which re-exports everything here under@polymind-inc/agent-framework/openaiand pins this package to its exact version. Installing this package directly works and resolves to the same modules, but examples and documentation import through the main package.
OpenAI (and Azure OpenAI) provider for the Agent Framework: OpenAIChatClient implements the
ChatClient interface from @polymind-inc/agent-framework-core on top of the official openai SDK's
Responses API, including streaming, structured output, and the provider-hosted tools
(web search, file search, code interpreter, hosted MCP).
Quick start
npm install @polymind-inc/agent-framework-core @polymind-inc/agent-framework-openai openaiimport { Agent } from '@polymind-inc/agent-framework-core';
import { OpenAIChatClient } from '@polymind-inc/agent-framework-openai';
const agent = new Agent({
client: new OpenAIChatClient({ model: 'gpt-4o' }), // reads OPENAI_API_KEY
instructions: 'You are a helpful assistant.',
});
const response = await agent.run('What can the Responses API do?');
console.log(response.text);Known limitations:
- Responses API only.
api: 'chat_completions'is permanently out of scope and throwsNotImplementedErrorat construction. Point a Chat Completions-only provider at a Responses-compatible endpoint viabaseURL, or implement theChatClientinterface from@polymind-inc/agent-framework-coredirectly.
Part of Agent Framework for TypeScript — an independent community implementation of the Microsoft Agent Framework programming model. Not an official Microsoft product, and not affiliated with or endorsed by Microsoft. MIT licensed.
