kernex_core/run.rs
1//! Configuration and outcome types for the agentic runtime loop.
2
3use crate::message::Response;
4
5/// Selects a performance/cost tier when creating a provider via `ProviderConfig`.
6///
7/// The factory resolves the concrete model name from the tier and provider type.
8/// An explicit `model` string on `ProviderConfig` always takes precedence over tier.
9#[derive(Debug, Clone, Copy, PartialEq, Eq)]
10pub enum ModelTier {
11 /// Cost-efficient model for standard tasks (e.g. Sonnet, GPT-4o-mini, Gemini Flash).
12 Standard,
13 /// Most capable model for complex tasks (e.g. Opus, GPT-4o, Gemini Pro).
14 Flagship,
15}
16
17/// Configuration for a [`Runtime::run`] invocation.
18///
19/// [`Runtime::run`]: crate::traits::Provider
20#[derive(Debug, Clone)]
21pub struct RunConfig {
22 /// Maximum number of agentic turns before stopping. Default: 50.
23 pub max_turns: u32,
24}
25
26impl Default for RunConfig {
27 fn default() -> Self {
28 Self { max_turns: 50 }
29 }
30}
31
32/// The terminal outcome of a [`Runtime::run`] call.
33#[derive(Debug)]
34pub enum RunOutcome {
35 /// Provider signaled end-of-turn. Contains the final response.
36 EndTurn(Response),
37 /// The run hit the `max_turns` limit before the provider stopped.
38 MaxTurns,
39}