MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / with_model

Method with_model

crates/opencode-agent/src/agent.rs:390–402  ·  view source on GitHub ↗
(
        mut self,
        model_id: impl Into<String>,
        provider_id: impl Into<String>,
    )

Source from the content-addressed store, hash-verified

388 }
389
390 pub fn with_model(
391 mut self,
392 model_id: impl Into<String>,
393 provider_id: impl Into<String>,
394 ) -> Self {
395 let model = ModelRef {
396 model_id: model_id.into(),
397 provider_id: provider_id.into(),
398 };
399 self.model_preference = Some(model.clone());
400 self.model = Some(model);
401 self
402 }
403
404 pub fn with_system_prompt(mut self, prompt: impl Into<String>) -> Self {
405 self.system_prompt = Some(prompt.into());

Callers 4

run_chat_sessionFunction · 0.45
generate_agent_responseFunction · 0.45

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected