summaryrefslogtreecommitdiffstats
path: root/src/client/replicate.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-06-05 09:02:23 +0800
committerGitHub <noreply@github.com>2024-06-05 09:02:23 +0800
commit1ec6abfaee2fdc189b348b7e3a8145bd9a84da74 (patch)
tree6f68a860a39b0fbe87784de925b5a31e00e74e33 /src/client/replicate.rs
parent71f2e94579511d7524f5534377001ab3f02a9597 (diff)
downloadaichat-1ec6abfaee2fdc189b348b7e3a8145bd9a84da74.tar.gz
feat: support RAG (#560)
* feat: support RAG * support more embeddings models and implement concurrent embedding api * show the progress of addings paths * ignore embedding context when saving message * embedding model max_chunk_size => default_chunk_size * support pdf and pandoc formats (docx, epub, ipynb)
Diffstat (limited to 'src/client/replicate.rs')
-rw-r--r--src/client/replicate.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/client/replicate.rs b/src/client/replicate.rs
index 92c7e18..e96ed64 100644
--- a/src/client/replicate.rs
+++ b/src/client/replicate.rs
@@ -1,8 +1,5 @@
-use super::{
- catch_error, prompt_format::*, sse_stream, ChatCompletionsData, ChatCompletionsOutput, Client,
- ExtraConfig, Model, ModelData, ModelPatches, PromptAction, PromptKind, ReplicateClient,
- SseHandler, SseMmessage,
-};
+use super::*;
+use super::prompt_format::*;
use anyhow::{anyhow, Result};
use async_trait::async_trait;
@@ -36,7 +33,7 @@ impl ReplicateClient {
api_key: &str,
) -> Result<RequestBuilder> {
let mut body = build_chat_completions_body(data, &self.model)?;
- self.patch_request_body(&mut body);
+ self.patch_chat_completions_body(&mut body);
let url = format!("{API_BASE}/models/{}/predictions", self.model.name());