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

Method assistant

crates/opencode-session/src/message.rs:126–136  ·  view source on GitHub ↗
(session_id: impl Into<String>)

Source from the content-addressed store, hash-verified

124 }
125
126 pub fn assistant(session_id: impl Into<String>) -> Self {
127 Self {
128 id: format!("msg_{}", uuid::Uuid::new_v4()),
129 session_id: session_id.into(),
130 role: MessageRole::Assistant,
131 parts: Vec::new(),
132 created_at: Utc::now(),
133 metadata: HashMap::new(),
134 usage: None,
135 }
136 }
137
138 pub fn add_text(&mut self, text: impl Into<String>) {
139 self.parts.push(MessagePart {

Callers

nothing calls this directly

Calls 1

newFunction · 0.85

Tested by

no test coverage detected