Skip to content

Commit

Permalink
fix: add completion_request.documents to chat_history
Browse files Browse the repository at this point in the history
  • Loading branch information
0xMochan committed Sep 23, 2024
1 parent c708e1f commit 6dd9cd1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rig-core/src/providers/anthropic/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ impl completion::CompletionModel for CompletionModel {
.chat_history
.into_iter()
.map(Message::from)
.chain(completion_request.documents.into_iter().map(|doc| Message {
role: "system".to_owned(),
content: serde_json::to_string(&doc).expect("Document should serialize"),
}))
.chain(iter::once(Message {
role: "user".to_owned(),
content: completion_request.prompt,
Expand Down

0 comments on commit 6dd9cd1

Please sign in to comment.