snowflake.core.cortex.lite_agent_service.AgentRunRequest

class snowflake.core.cortex.lite_agent_service.AgentRunRequest(*, thread_id: Annotated[int, Strict(strict=True)] | None = None, parent_message_id: Annotated[int, Strict(strict=True)] | None = None, messages: Annotated[List[Message], MinLen(min_length=1)], tool_choice: ToolChoice | None = None, skill_choice: SkillChoice | None = None, experimental: Dict[str, Any] | None = None, variables: Dict[str, Any] | None = None, query_tags: List[Dict[str, Any]] | None = None, tool_bindings: Dict[str, Any] | None = None, origin_application: Annotated[str, Strict(strict=True)] | None = 'external', internal_metadata: Dict[str, Any] | None = None, client_metadata: Dict[str, Any] | None = None, stream: Annotated[bool, Strict(strict=True)] | None = True, background: Annotated[bool, Strict(strict=True)] | None = False, models: AgentModels | None = None, orchestration: AgentOrchestration | None = None, instructions: AgentInstructions | None = None, model: Annotated[str, Strict(strict=True)] | None = None, response_instruction: Annotated[str, Strict(strict=True)] | None = None, tools: List[Tool] | None = None, tool_resources: Dict[str, Dict[str, Any]] | None = None, mcp_servers: List[McpServerWrapper] | None = None, mcp_config: McpConfig | None = None, skills: List[SkillWrapper] | None = None)

Bases: BaseModel

A model object representing the AgentRunRequest resource.

Constructs an object of type AgentRunRequest with the provided properties.

Parameters:
  • messages (list[Message]) – If thread id and parent message id are present, the current user messages in this conversation turn. Else, the conversation history and current message. Contains both user queries and assistant responses in chronological order.

  • thread_id (int, optional) – The id of the thread.

  • parent_message_id (int, optional) – The id of the message from which this run should begin.

  • tool_choice (ToolChoice, optional)

  • skill_choice (SkillChoice, optional)

  • experimental (object, optional) – reserved

  • variables (object, optional) – Dictionary of variables with metadata. Each variable can include value, type information, and flags indicating whether it’s a session or prompt variable.

  • query_tags (list[object], optional) – Query tags to be attached to the Snowflake session. These will be applied for all queries executed by the agent.

  • tool_bindings (object, optional) – Maps tools to their variable bindings. For each tool, specifies which input parameters should be automatically injected with variable definitions.

  • origin_application (str, default 'external') – The application that initiated this agent run request. Used for tracking and analytics.

  • internal_metadata (object, optional) – Internal metadata for the request. This field is reserved for internal use.

  • client_metadata (object, optional) – Client-provided metadata for the request. Can be used by clients to pass additional context or configuration.

  • stream (bool, default True) – Whether to return a streaming response (text/event-stream) or a non-streaming JSON response (application/json). If true, the response will be streamed as Server-Sent Events. If false, the response will be returned as JSON.

  • background (bool, default False) – Whether to execute this request in background mode (asynchronously).

  • models (AgentModels, optional)

  • orchestration (AgentOrchestration, optional)

  • instructions (AgentInstructions, optional)

  • model (str, optional) – The identifier of the LLM to use for processing.

  • response_instruction (str, optional) – Optional instructions to guide the model’s response style and behavior. Can be used to set the tone, format, or specific requirements for responses.

  • tools (list[Tool], optional) – List of tools available for the agent to use. Tools may have a corresponding configuration in tool_resources.

  • tool_resources (Dict[str, object], optional) – Configuration for each tool referenced in the tools array. Keys must match the name field of tools.

  • mcp_servers (list[McpServerWrapper], optional) – List of MCP (Model Context Protocol) servers to use for this request. Each server is specified with a server_spec containing its fully qualified name. Used when mcp_config.selection is “specified” (the default).

  • mcp_config (McpConfig, optional)

  • skills (list[SkillWrapper], optional) – List of skills available for the agent to use. Each skill references external code from a stage or git repository.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Methods

classmethod from_dict(obj: dict) AgentRunRequest

Create an instance of AgentRunRequest from a dict.

classmethod from_json(json_str: str) AgentRunRequest

Create an instance of AgentRunRequest from a JSON string.

to_dict(hide_readonly_properties: bool = False) dict[str, Any]

Returns the dictionary representation of the model using alias.

to_dict_without_readonly_properties() dict[str, Any]

Return the dictionary representation of the model without readonly properties.

to_json() str

Returns the JSON representation of the model using alias.

to_str() str

Returns the string representation of the model using alias.