summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-07-11 07:40:24 +0800
committerGitHub <noreply@github.com>2024-07-11 07:40:24 +0800
commit0264ab80ab56d1ae78470c3fe860580b5bdc676a (patch)
tree2a6c72e943dabc85815745a4d3bbb7aa27f047a2 /src/client
parentcee0eb453e37667185025a1328ce5dea9b2bef4a (diff)
downloadaichat-0264ab80ab56d1ae78470c3fe860580b5bdc676a.tar.gz
refactor: update models.yaml and abandon anyscale (#701)
Diffstat (limited to 'src/client')
-rw-r--r--src/client/mod.rs3
-rw-r--r--src/client/vertexai.rs6
2 files changed, 2 insertions, 7 deletions
diff --git a/src/client/mod.rs b/src/client/mod.rs
index 6878541..b4c0091 100644
--- a/src/client/mod.rs
+++ b/src/client/mod.rs
@@ -51,8 +51,7 @@ register_client!(
(qianwen, "qianwen", QianwenConfig, QianwenClient),
);
-pub const OPENAI_COMPATIBLE_PLATFORMS: [(&str, &str); 13] = [
- ("anyscale", "https://api.endpoints.anyscale.com/v1"),
+pub const OPENAI_COMPATIBLE_PLATFORMS: [(&str, &str); 12] = [
("deepinfra", "https://api.deepinfra.com/v1/openai"),
("deepseek", "https://api.deepseek.com"),
("fireworks", "https://api.fireworks.ai/inference/v1"),
diff --git a/src/client/vertexai.rs b/src/client/vertexai.rs
index a4c4050..828c300 100644
--- a/src/client/vertexai.rs
+++ b/src/client/vertexai.rs
@@ -69,14 +69,10 @@ impl VertexAIClient {
let base_url = format!("https://{location}-aiplatform.googleapis.com/v1/projects/{project_id}/locations/{location}/publishers");
let url = format!("{base_url}/google/models/{}:predict", self.model.name());
- let task_type = match data.query {
- true => "RETRIEVAL_DOCUMENT",
- false => "QUESTION_ANSWERING",
- };
let instances: Vec<_> = data
.texts
.into_iter()
- .map(|v| json!({"task_type": task_type, "content": v}))
+ .map(|v| json!({"content": v}))
.collect();
let body = json!({
"instances": instances,