🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

@composio/openai-agents

Package Overview
Dependencies
Maintainers
6
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@composio/openai-agents

The OpenAI Agents API provider for Composio SDK, providing seamless integration with OpenAI's Agents API and tools.

latest
npmnpm
Version
0.2.5
Version published
Maintainers
6
Created
Source

@composio/openai-agents

The OpenAI Agents API provider for Composio SDK, providing seamless integration with OpenAI's Agents API and tools.

Features

  • OpenAI Agents Integration: Seamless integration with OpenAI's Agents SDK
  • Tool Integration: Easy integration of Composio tools with OpenAI Agents
  • Type Safety: Full TypeScript support with proper type definitions
  • Strict Mode: Support for strict mode tool parameter validation

Installation

npm install @composio/openai-agents @openai/agents
# or
yarn add @composio/openai-agents @openai/agents
# or
pnpm add @composio/openai-agents @openai/agents

Environment Variables

Required environment variables:

  • COMPOSIO_API_KEY: Your Composio API key
  • OPENAI_API_KEY: Your OpenAI API key

Example

import { OpenAIAgentsProvider } from '@composio/openai-agents';
import { Composio } from '@composio/core';
import { Agent, run } from '@openai/agents';

const composio = new Composio({
  provider: new OpenAIAgentsProvider(),
});

// Fetch tools from Composio
const tools = await composio.tools.get('default', 'HACKERNEWS_GET_USER', {
  beforeExecute: async (toolSlug, toolkitSlug, params) => {
    console.log(`🔄 Executing tool ${toolSlug} from toolkit ${toolkitSlug}...`);
    return params;
  },
  afterExecute: async (toolSlug, toolkitSlug, result) => {
    console.log(`âś… Tool ${toolSlug} executed`);
    return result;
  },
});

// Create an agent with the tools
const agent = new Agent({
  name: 'Hackernews assistant',
  tools: tools,
});

// Run the agent with a query
const result = await run(agent, 'Tell me about the user `pg` in hackernews');

Provider Configuration

The OpenAI Agents provider can be configured with various options:

const provider = new OpenAIAgentsProvider({
  strict: true, // Enable strict mode for tool parameters
});

Documentation

For more information about OpenAI Agents and how to use them, see:

  • OpenAI Strict Mode
  • OpenAI Agents SDK Documentation
  • OpenAI Agents SDK GitHub

FAQs

Package last updated on 22 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts