Skip to content

Conversation

@ianyimi
Copy link
Contributor

@ianyimi ianyimi commented Nov 28, 2025

Nice for building util functions wrapping the existing tool function. Current workaround passes the result of the tool function call with the options included, which requires importing the tool function for each file where the util is called.

import { tool, type Tool } from "@openai/agents"

function vaultTool(tool: Tool) {
  return {
    type: "vault",
    tool
  }
}

// usage
vaultTool(tool({/* tool options */}))

becomes:

import { tool, type ToolOptions } from "@openai/agents"

function vaultTool(options: ToolOptions) {
  return {
    type: "vault",
    tool: tool(options)
  }
}

// usage
vaultTool({/* tool options */})

Useful for building higher order functions wrapping the tool function
@changeset-bot
Copy link

changeset-bot bot commented Nov 28, 2025

🦋 Changeset detected

Latest commit: 7ef802f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@openai/agents-core Patch
@openai/agents-extensions Patch
@openai/agents-openai Patch
@openai/agents-realtime Patch
@openai/agents Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@seratch seratch added this to the 0.3.x milestone Dec 2, 2025
@seratch seratch enabled auto-merge (squash) December 2, 2025 06:26
@seratch seratch merged commit d1d7842 into openai:main Dec 2, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants