From b4a40e3fedb438570770a224b890ea24f6e660a9 Mon Sep 17 00:00:00 2001 From: sigoden Date: Sat, 18 May 2024 19:06:21 +0800 Subject: feat: support function calling (#514) * feat: support function calling * fix on Windows OS * implement multi-steps function calling * fix on Windows OS * add error for client not support function calling * refactor message data structure and make claude client supporting function calling * support reuse previous call results * improve error handling for function calling * use prefix `may_` as indicator for `execute` type fucntions --- src/client/gemini.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/client/gemini.rs') diff --git a/src/client/gemini.rs b/src/client/gemini.rs index 28fc93e..1ffb9a9 100644 --- a/src/client/gemini.rs +++ b/src/client/gemini.rs @@ -1,5 +1,5 @@ use super::vertexai::gemini_build_body; -use super::{ExtraConfig, GeminiClient, Model, ModelConfig, PromptAction, PromptKind, SendData}; +use super::{ExtraConfig, GeminiClient, Model, ModelData, PromptAction, PromptKind, SendData}; use anyhow::Result; use reqwest::{Client as ReqwestClient, RequestBuilder}; @@ -14,7 +14,7 @@ pub struct GeminiConfig { #[serde(rename = "safetySettings")] pub safety_settings: Option, #[serde(default)] - pub models: Vec, + pub models: Vec, pub extra: Option, } @@ -34,7 +34,7 @@ impl GeminiClient { let body = gemini_build_body(data, &self.model, self.config.safety_settings.clone())?; - let model = &self.model.name; + let model = &self.model.name(); let url = format!("{API_BASE}{}:{}?key={}", model, func, api_key); -- cgit v1.2.3