struct

Crig::Agent(M)

Inherits Crig::Integrations::DiscordExt < Crig::StreamingChat < Crig::StreamingPrompt < Crig::StreamingPrompt < Struct < Value < Object

Constructors

new(model : M, name : String | Nil = nil, description : String | Nil = nil, preamble : String | Nil = nil, static_context : Array(Crig::Completion::Request::Document) = [] of Crig::Completion::Request::Document, dynamic_context : Array(DynamicContextSource) = [] of DynamicContextSource, static_tools : Array(Crig::Completion::ToolDefinition) = [] of Crig::Completion::ToolDefinition, dynamic_tools : Array(DynamicToolSource) = [] of DynamicToolSource, tool_server_handle : ToolServerHandle | Nil = nil, additional_params : JSON::Any | Nil = nil, max_tokens : Int64 | Nil = nil, default_max_turns : Int32 | Nil = nil, temperature : Float64 | Nil = nil, tool_choice : Crig::Completion::ToolChoice | Nil = nil, output_schema : JSON::Any | Nil = nil, memory : Crig::Memory::ConversationMemory | Nil = nil, default_conversation_id : String | Nil = nil)
Source

Instance methods

add_hook(hook : AgentHook) : self
Source
additional_params
Source

Build a raw completion request from agent config. Used by the deprecated streaming prompt request. Upstream has no public Agent#completion/ Agent#stream_completion — execution goes through the runner.

Source
call(args : String) : String
Source
default_conversation_id
Source
default_max_turns
Source
description
Source
dynamic_context
Source
dynamic_tools
Source
into_tool

Convert this agent into a runtime-defined tool.

The configured agent name becomes the tool name. Unnamed agents use agent_tool. This matches upstream Agent::into_tool.

Source
max_tokens
Source
memory
Source
model
Source
name
Source
output_schema
Source
preamble
Source
prompt_typed(type : T.class, prompt : Crig::Completion::Message | String) : Crig::TypedPromptRequest(T, Crig::Standard, M) forall T
Source
resolved_name
Source
runner(prompt : Crig::Completion::Message) : AgentRunner(M)

Create a runner for this agent using the new v0.39.0 architecture. The runner drives the AgentRun state machine with hook dispatch.

Source
static_context
Source
static_tools
Source

Deprecated: use runner(prompt).history(history).stream instead.

Source

Deprecated: use runner(prompt).stream instead.

Source
temperature
Source
tool_choice
Source
tool_description
Source
tool_parameters
Source
tool_server_handle
Source