UNPKG

@openai/agents-core

Version:

The OpenAI Agents SDK is a lightweight yet powerful framework for building multi-agent workflows.

19 lines • 928 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getToolSearchAgentName = getToolSearchAgentName; exports.attributeToolSearchOutput = attributeToolSearchOutput; /** Returns a durable name only when it identifies one Agent in the run graph. */ function getToolSearchAgentName(agent, agents) { const matchingAgents = new Set([...agents].filter((candidate) => candidate.name === agent.name)); return matchingAgents.size === 1 && matchingAgents.has(agent) ? agent.name : undefined; } /** Records SDK-owned discovery attribution without changing the provider payload. */ function attributeToolSearchOutput(output, agentName) { const { toolSearchAgentName: _suppliedOwner, ...rawOutput } = output; return typeof agentName === 'string' ? { ...rawOutput, toolSearchAgentName: agentName } : rawOutput; } //# sourceMappingURL=toolSearchAttribution.js.map