diff options
| author | sigoden <sigoden@gmail.com> | 2024-06-22 05:55:10 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-22 05:55:10 +0800 |
| commit | 52cd3efd6c6588a957fd11d56580cb54ba868724 (patch) | |
| tree | d92d16dba12cc6247939c774f47c84d6b3d4fbd3 /src/client | |
| parent | 7a089d846ec2b0f5447d253a52e884a5a6607881 (diff) | |
| download | aichat-52cd3efd6c6588a957fd11d56580cb54ba868724.tar.gz | |
refactor: some error messages (#627)
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/common.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/common.rs b/src/client/common.rs index 796c632..5e82f82 100644 --- a/src/client/common.rs +++ b/src/client/common.rs @@ -355,7 +355,7 @@ pub trait Client: Sync + Send { let data = input.prepare_completion_data(self.model(), false)?; self.chat_completions_inner(&client, data) .await - .with_context(|| "Failed to fetch chat completions") + .with_context(|| "Failed to call chat completions api") } async fn chat_completions_streaming( @@ -381,7 +381,7 @@ pub trait Client: Sync + Send { self.chat_completions_streaming_inner(&client, handler, data).await } => { handler.done()?; - ret.with_context(|| "Failed to fetch chat completions") + ret.with_context(|| "Failed to call chat completions api") } _ = watch_abort_signal(abort_signal) => { handler.done()?; @@ -395,14 +395,14 @@ pub trait Client: Sync + Send { self.model().guard_max_batch_size(&data)?; self.embeddings_inner(&client, data) .await - .context("Failed to fetch embeddings") + .context("Failed to call embeddings api") } async fn rerank(&self, data: RerankData) -> Result<RerankOutput> { let client = self.build_client()?; self.rerank_inner(&client, data) .await - .context("Failed to fetch rerank") + .context("Failed to call rerank api") } fn patch_chat_completions_body(&self, body: &mut Value) { |
