pub enum RigAgent {
OpenAi {
agent: Agent<RetryingModel<CompletionModel>>,
tool_call_max: usize,
},
}Expand description
Runtime-dispatched Rig agent. The OpenAi-backed and mistralrs-backed
CompletionModel impls produce concretely different Agent<M> types
(Rig’s trait carries associated types, so a single concrete RigAgent
can’t carry both). Callers (the agent loop) match on the variant.
Variants§
OpenAi
Implementations§
Source§impl RigAgent
impl RigAgent
Sourcepub async fn run_turn(
&self,
prompt: &str,
history: &mut Vec<Message>,
) -> Result<String>
pub async fn run_turn( &self, prompt: &str, history: &mut Vec<Message>, ) -> Result<String>
Run one user turn: prompt the model, drive the model->tool->model loop,
extend history with everything emitted (user prompt + tool turns +
final assistant reply), and return the assistant’s text reply.
The per-turn OutrigPromptHook prints [outrig] tool call: ... to
stderr for every tool invocation and terminates the loop after
the resolved tool-call max. If the hook terminates the loop, Rig
returns the partial chat history it had accumulated; outrig splices in
that new suffix so the user can send a follow-up prompt to continue.