diff --git a/src/oai/chat.rs b/src/oai/chat.rs index 6dbe6d96..8776a5f3 100644 --- a/src/oai/chat.rs +++ b/src/oai/chat.rs @@ -109,7 +109,11 @@ impl From for GenerateRequest { .map(|record| record.content) .join("\n\n"); - let assistant = Role::Assistant.to_string(); + let assistant = Role::Assistant; + let assistant = names + .get(&assistant) + .cloned() + .unwrap_or(assistant.to_string()); let prompt = prompt + &format!("\n\n{assistant}:"); let max_tokens = max_tokens.min(crate::MAX_TOKENS);