Skip to content

Commit

Permalink
Fix assistant role's name map.
Browse files Browse the repository at this point in the history
  • Loading branch information
cryscan committed Nov 10, 2023
1 parent c6be083 commit 2ef9986
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/oai/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ impl From<ChatRequest> 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);
Expand Down

0 comments on commit 2ef9986

Please sign in to comment.