跳转至

编排器 API

LangGraph-based orchestrator for switching between AI and human responses.

graph property

graph

Return the compiled LangGraph for external reuse and inspection.

__init__

__init__(
    *,
    model_name=None,
    model_provider=None,
    model_temperature=None,
    system_prompt=None,
    fallback_response=None,
    agent_record=None,
    model_routing_config=None,
    mcp_runtime_config=None,
    explicit_model_override_active=False,
)

Initialize the orchestrator.

参数:

名称 类型 描述 默认
model_name str | None

Optional model name override.

None
model_provider str | None

Optional provider override.

None
model_temperature float | None

Optional temperature override.

None
system_prompt str | None

Optional system prompt.

None
fallback_response str | None

Optional fallback response override.

None

返回:

类型 描述
None

None.

引发:

类型 描述
Exception

Propagates unexpected initialization failures.

run

run(orchestrator_input)

Run a single orchestration step.

参数:

名称 类型 描述 默认
orchestrator_input OrchestratorInput

Input payload.

必需

返回:

名称 类型 描述
OrchestratorResult OrchestratorResult

Orchestration output.

引发:

类型 描述
Exception

Propagates unexpected failures from LangGraph execution.

Shared-infrastructure ReAct runtime for experimental chat agents.

__init__

__init__(
    *,
    model_name=None,
    model_provider=None,
    model_temperature=None,
    system_prompt=None,
    fallback_response=None,
    agent_record=None,
    model_routing_config=None,
    mcp_runtime_config=None,
    explicit_model_override_active=False,
)

Initialize the ReAct runtime.

run

run(orchestrator_input)

Execute one chat turn with the shared runtime kernel/pipeline.

Thin shared kernel that wraps event handling and root tracing.

__init__

__init__(
    *,
    tracing_service,
    apply_event,
    resolve_message_type,
    build_langfuse_metadata,
    record_observation_error,
)

Initialize the runtime kernel helper.

run_turn

run_turn(*, orchestrator_input, execute_turn)

Execute one orchestrator turn inside a shared root trace.

Run shared retrieval, memory, tool, generation, and observability stages.

__init__

__init__(*, agent_memory_service=None)

Initialize the shared capability pipeline.

run_turn

run_turn(
    *,
    request,
    retrieval_stage,
    skill_stage,
    scheduler_stage,
    mcp_stage,
    generation_stage,
)

Run the shared capability stages for one chat turn.

参数:

名称 类型 描述 默认
request CapabilityPipelineRequest

Shared runtime payload for the turn.

必需
retrieval_stage Optional[Callable[[CapabilityPipelineRequest, str], RetrievalStageResult]]

Optional deterministic retrieval stage callable.

必需
skill_stage Optional[Callable[[CapabilityPipelineRequest, str], ToolStageResult]]

Optional skill execution stage callable.

必需
mcp_stage Optional[Callable[[CapabilityPipelineRequest, str], ToolStageResult]]

Optional MCP execution stage callable.

必需
generation_stage Callable[[CapabilityPipelineRequest, str], GenerationStageResult]

Final response generation stage callable.

必需

返回:

名称 类型 描述
CapabilityPipelineResult CapabilityPipelineResult

Final turn response plus observability payload.

Input payload for the shared capability pipeline.

Final result returned by the shared capability pipeline.

Bases: BaseModel

Persisted resume state for one approval-gated MCP tool call.

Bases: BaseModel

Input payload for the orchestrator.

属性:

名称 类型 描述
session_id str

Session identifier.

current_status SessionStatus

Current session status.

incoming_role str

Role of the inbound message.

incoming_content str

Content of the inbound message.

conversation_history list[ConversationHistoryMessage]

Prior session messages ordered oldest -> newest.

event_name Optional[OrchestratorEvent]

Optional event to apply.

agent_id Optional[str]

Agent ID for knowledge filtering in RAG retrieval.

persist_session_artifacts bool

Whether session-bound memory, audit, and checkpoint records may be persisted for this turn.

Bases: BaseModel

Output payload after orchestration.

属性:

名称 类型 描述
next_status SessionStatus

Status after processing the event.

response_role Optional[str]

Role of the generated response.

response_content Optional[str]

Content of the generated response.

observability_payload Optional[dict[str, Any]]

Structured turn context metadata.

agent_id Optional[str]

Agent ID used for this orchestration.

Bases: str, Enum

Represents the active responder for a session.

Bases: str, Enum

Represents events that can update the orchestration flow.