Skip to content

OpenAIAgentTarget

junjo.plugins.openai_agents.evaluation.OpenAIAgentTarget

Kind: Class

SDK version: 0.67.0

Documentation channel: Stable release

OpenAIAgentTarget(*, key: str, name: str, input_version: int, input_type: TypeForm[InputT], expected_agent_name: str, factory: Callable[[InputT, EvaluationContext, ResourcesT], OpenAIAgentInvocation[ContextT] | Awaitable[OpenAIAgentInvocation[ContextT]]], projector: Callable[[RunResult, InputT, EvaluationContext, ResourcesT], object | Awaitable[object]])

View source

Execute an OpenAI Agent and bind its exact standard Agent span.

The target is conceptual kind agent in evaluation datasets without pretending the external runtime is a native Junjo Agent. It captures the one standard invoke_agent span whose Agent name matches expected_agent_name and returns an exact otel_span evidence reference. Missing, duplicate, or mismatched evidence fails clearly.

Declare one application-owned outer OpenAI Agent target.

Name Type Description Default
key str Stable dispatch identity within the application harness.
name str Human-readable target name snapshotted into Studio cases.
input_version int Positive version of the target input contract.
input_type TypeForm[InputT] Pydantic-compatible case input type.
expected_agent_name str Exact OpenAI Agent name expected on the
standard invoke_agent span.
factory Callable[[InputT, EvaluationContext, ResourcesT], OpenAIAgentInvocation[ContextT] | Awaitable[OpenAIAgentInvocation[ContextT]]] Application factory for a fresh invocation using the
validated input, evaluation context, and shared harness resources.
projector Callable[[RunResult, InputT, EvaluationContext, ResourcesT], object | Awaitable[object]] Mapping from the real RunResult to the subject
consumed by the case evaluator.
Exception Description
TargetContractError If declaration metadata or the input
contract is invalid.

input_schema: dict[str, object]

View source

Public attribute.

validate_input(input_json: object) -> InputT

View source

Public member documented by its signature.

execute(input_value: object, *, context: EvaluationContext, service_identity: ExecutionServiceIdentity, resources: object) -> TargetExecution

View source

Public member documented by its signature.