UNPKG

@openai/agents-core

Version:

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

15 lines • 746 B
/** Returns a durable name only when it identifies one Agent in the run graph. */ export 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. */ export function attributeToolSearchOutput(output, agentName) { const { toolSearchAgentName: _suppliedOwner, ...rawOutput } = output; return typeof agentName === 'string' ? { ...rawOutput, toolSearchAgentName: agentName } : rawOutput; } //# sourceMappingURL=toolSearchAttribution.mjs.map