@devries-cameron20 / composio Mirror · read-only / commits / cedf1a421
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 12:15 UTC

docs(openai): align responses examples on gpt-5 and document provider types

- Use gpt-5 in the Responses API examples; gpt-4 predates the Responses API and the repo's other Responses examples use gpt-5. - Print response.output_text instead of indexing into content items, which assumes non-empty message content. - Add the OpenAIResponsesProvider type surface to the Type Definitions section, which previously only showed the chat completions provider.

jkomyno committed Sep 15, 2026 at 16:42 UTC cedf1a421782f6ea525ad43a293085fc3595e102
1 file changed +46 -7
ts/docs/providers/openai.md
+46 -7
@@ -155,7 +155,7 @@ const tools = await composio.tools.get('default', {
155 });
156
157 let response = await openai.responses.create({
158 - model: 'gpt-4',
158 + model: 'gpt-5',
159 tools,
160 input: 'Find information about the Composio SDK repository',
161 });
@@ -163,18 +163,14 @@ let response = await openai.responses.create({
163 while (response.output.some(item => item.type === 'function_call')) {
164 const toolOutputs = await composio.provider.handleToolCalls('default', response.output);
165 response = await openai.responses.create({
166 - model: 'gpt-4',
166 + model: 'gpt-5',
167 tools,
168 previous_response_id: response.id,
169 input: toolOutputs,
170 });
171 }
172
173 -for (const item of response.output) {
174 - if (item.type === 'message' && item.content[0].type === 'output_text') {
175 - console.log(item.content[0].text);
176 - }
177 -}
173 +console.log(response.output_text);
174 ```
175
176 ## Modifiers with OpenAI Provider
@@ -261,4 +257,47 @@ class OpenAIProvider extends BaseNonAgenticProvider<OpenAiToolCollection, OpenAi
257 modifiers?: ExecuteToolModifiers
258 ): Promise<OpenAI.ChatCompletionToolMessageParam[]>;
259 }
260 +
261 +// The tool type for the Responses API
262 +// (the Responses provider's OpenAiTool is OpenAI.Responses.FunctionTool)
263 +type ResponsesTool = OpenAI.Responses.FunctionTool;
264 +
265 +// The provider class for the Responses API
266 +// (OpenAIResponsesProvider re-exports from '@composio/openai')
267 +class OpenAIResponsesProvider extends BaseNonAgenticProvider<
268 + ResponsesTool[],
269 + ResponsesTool
270 +> {
271 + readonly name = 'openai';
272 +
273 + wrapTool(tool: Tool): ResponsesTool;
274 + wrapTools(tools: Tool[]): ResponsesTool[];
275 +
276 + executeToolCall(
277 + userId: string,
278 + tool: OpenAI.Responses.ResponseFunctionToolCall,
279 + options?: ExecuteToolFnOptions,
280 + modifiers?: ExecuteToolModifiers
281 + ): Promise<string>;
282 +
283 + handleToolCalls(
284 + userId: string,
285 + toolCalls: OpenAI.Responses.ResponseOutputItem[],
286 + options?: ExecuteToolFnOptions,
287 + modifiers?: ExecuteToolModifiers
288 + ): Promise<OpenAI.Responses.ResponseInputItem.FunctionCallOutput[]>;
289 +
290 + handleResponse(
291 + userId: string,
292 + response: OpenAI.Responses.Response,
293 + options?: ExecuteToolFnOptions,
294 + modifiers?: ExecuteToolModifiers
295 + ): Promise<OpenAI.Responses.ResponseInputItem.FunctionCallOutput[]>;
296 +}
297 ```
298 +
299 +Like the chat completions provider, the Responses provider also accepts a
300 +`ToolCallSession` as the execution target, and it can wrap MCP servers for the
301 +Responses API via `wrapMcpServerResponse`. See
302 +`ts/packages/providers/openai/src/OpenAIResponsesProvider.ts` for the full
303 +surface.