# openai-agents

URL: https://tailrace.dev/docs/reference/openai-agents

> Reference for @tailrace/openai-agents - wrapTool, wrapTools, withOpenAiAgents.



`@tailrace/openai-agents` wraps OpenAI Agents SDK `FunctionTool.invoke` so args and results pass through Tailrace.

## Install [#install]

```bash
pnpm add @tailrace/core @tailrace/openai-agents @openai/agents
```

Peer: `@openai/agents` `>=0.3` (bound against `0.3.9`).

## Exports [#exports]

| Export                    | Description                    |
| ------------------------- | ------------------------------ |
| `wrapTool`                | Wrap one FunctionTool          |
| `wrapTools`               | Wrap an array of FunctionTools |
| `withOpenAiAgents`        | Fluent `.tool` / `.tools`      |
| `OpenAiAgentsWrapOptions` | Options type                   |

## Options [#options]

| Option       | Required | Notes               |
| ------------ | -------- | ------------------- |
| `agent`      | no       | Default `"default"` |
| `workflowId` | no       | Default `"default"` |
| `onDecision` | no       | Audit callback      |

## Guides [#guides]

* [OpenAI Agents integration](/docs/guides/openai-agents-integration)
