pub struct AgentBase {Show 24 fields
pub upstream: Upstream,
pub model: String,
pub output_mode: OutputMode,
pub synthetic_reasoning: Option<bool>,
pub top_logprobs: Option<u64>,
pub prefix_messages: Option<Vec<Message>>,
pub post_system_prefix_messages: Option<Vec<Message>>,
pub suffix_messages: Option<Vec<Message>>,
pub mcp_servers: Option<McpServers>,
pub frequency_penalty: Option<f64>,
pub logit_bias: Option<IndexMap<String, i64>>,
pub max_completion_tokens: Option<u64>,
pub presence_penalty: Option<f64>,
pub stop: Option<Stop>,
pub temperature: Option<f64>,
pub top_p: Option<f64>,
pub max_tokens: Option<u64>,
pub min_p: Option<f64>,
pub provider: Option<Provider>,
pub reasoning: Option<Reasoning>,
pub repetition_penalty: Option<f64>,
pub top_a: Option<f64>,
pub top_k: Option<u64>,
pub verbosity: Option<Verbosity>,
}Expand description
The base configuration for an OpenRouter Agent (without computed ID).
Fields§
§upstream: UpstreamThe upstream provider marker.
model: StringThe upstream language model identifier (e.g., "gpt-4", "claude-3-opus").
output_mode: OutputModeThe output mode for vector completions. Ignored for agent completions.
synthetic_reasoning: Option<bool>Enable synthetic reasoning for non-reasoning LLMs.
Vector completions only. Ignored for agent completions.
top_logprobs: Option<u64>Number of top log probabilities to return (2-20).
Vector completions only. Ignored for agent completions.
prefix_messages: Option<Vec<Message>>Messages prepended to the user’s prompt.
post_system_prefix_messages: Option<Vec<Message>>Messages inserted after the leading chain of system/developer messages.
suffix_messages: Option<Vec<Message>>Messages appended after the user’s prompt.
mcp_servers: Option<McpServers>MCP servers the agent can connect to.
frequency_penalty: Option<f64>Penalizes tokens based on their frequency in the output so far (-2.0 to 2.0).
logit_bias: Option<IndexMap<String, i64>>Token ID to bias mapping (-100 to 100). Positive values increase likelihood.
max_completion_tokens: Option<u64>Maximum tokens in the completion.
presence_penalty: Option<f64>Penalizes tokens based on their presence in the output so far (-2.0 to 2.0).
stop: Option<Stop>Stop sequences that halt generation.
temperature: Option<f64>Sampling temperature (0.0 to 2.0). Higher = more random.
top_p: Option<f64>Nucleus sampling probability (0.0 to 1.0).
max_tokens: Option<u64>Maximum tokens (OpenRouter variant of max_completion_tokens).
min_p: Option<f64>Minimum probability threshold for sampling (0.0 to 1.0).
provider: Option<Provider>Provider routing preferences.
reasoning: Option<Reasoning>Reasoning/thinking configuration for supported models.
repetition_penalty: Option<f64>Repetition penalty (0.0 to 2.0). Values > 1.0 penalize repetition.
top_a: Option<f64>Top-a sampling parameter (0.0 to 1.0).
top_k: Option<u64>Top-k sampling: only consider the k most likely tokens.
verbosity: Option<Verbosity>Output verbosity hint for supported models.
Implementations§
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for AgentBase
impl<'arbitrary> Arbitrary<'arbitrary> for AgentBase
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured this type
needs to construct itself. Read moreSource§impl<'de> Deserialize<'de> for AgentBase
impl<'de> Deserialize<'de> for AgentBase
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for AgentBase
impl JsonSchema for AgentBase
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreimpl StructuralPartialEq for AgentBase
Auto Trait Implementations§
impl Freeze for AgentBase
impl RefUnwindSafe for AgentBase
impl Send for AgentBase
impl Sync for AgentBase
impl Unpin for AgentBase
impl UnsafeUnpin for AgentBase
impl UnwindSafe for AgentBase
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more