summaryrefslogtreecommitdiffstats
path: root/src/client/vertexai_claude.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-05-30 17:10:02 +0800
committerGitHub <noreply@github.com>2024-05-30 17:10:02 +0800
commit54a837784c3df7e73c7c95adfef96e68c842984b (patch)
treee090da40436bd3c1220d5ab88071ac33397ce57c /src/client/vertexai_claude.rs
parentfa4bf14e02b1e6361b38014fe6a986738cf06837 (diff)
downloadaichat-54a837784c3df7e73c7c95adfef96e68c842984b.tar.gz
refactor: rename `SendData` to `CompletionData` (#553)
Diffstat (limited to 'src/client/vertexai_claude.rs')
-rw-r--r--src/client/vertexai_claude.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/client/vertexai_claude.rs b/src/client/vertexai_claude.rs
index 6420611..fd06518 100644
--- a/src/client/vertexai_claude.rs
+++ b/src/client/vertexai_claude.rs
@@ -1,6 +1,6 @@
use super::{
- access_token::*, claude::*, vertexai::*, Client, CompletionOutput, ExtraConfig, Model,
- ModelData, ModelPatches, PromptAction, PromptKind, SendData, SseHandler, VertexAIClaudeClient,
+ access_token::*, claude::*, vertexai::*, Client, CompletionData, CompletionOutput, ExtraConfig,
+ Model, ModelData, ModelPatches, PromptAction, PromptKind, SseHandler, VertexAIClaudeClient,
};
use anyhow::Result;
@@ -29,7 +29,11 @@ impl VertexAIClaudeClient {
("location", "Location", true, PromptKind::String),
];
- fn request_builder(&self, client: &ReqwestClient, data: SendData) -> Result<RequestBuilder> {
+ fn request_builder(
+ &self,
+ client: &ReqwestClient,
+ data: CompletionData,
+ ) -> Result<RequestBuilder> {
let project_id = self.get_project_id()?;
let location = self.get_location()?;
let access_token = get_access_token(self.name())?;
@@ -62,7 +66,7 @@ impl Client for VertexAIClaudeClient {
async fn send_message_inner(
&self,
client: &ReqwestClient,
- data: SendData,
+ data: CompletionData,
) -> Result<CompletionOutput> {
prepare_gcloud_access_token(client, self.name(), &self.config.adc_file).await?;
let builder = self.request_builder(client, data)?;
@@ -73,7 +77,7 @@ impl Client for VertexAIClaudeClient {
&self,
client: &ReqwestClient,
handler: &mut SseHandler,
- data: SendData,
+ data: CompletionData,
) -> Result<()> {
prepare_gcloud_access_token(client, self.name(), &self.config.adc_file).await?;
let builder = self.request_builder(client, data)?;