diff options
| author | sigoden <sigoden@gmail.com> | 2024-02-15 08:10:30 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-15 08:10:30 +0800 |
| commit | 5e4210980d6ed92c3850042c7b57ca7eef028be0 (patch) | |
| tree | 8bb2cbb6e1a4b8dcd22d062fe0dbd17724c5dd3b /src/client/gemini.rs | |
| parent | 3bf0c371e407c8c6d03840cac6662ddfbbea484c (diff) | |
| download | aichat-5e4210980d6ed92c3850042c7b57ca7eef028be0.tar.gz | |
feat: support vertexai (#308)
Diffstat (limited to 'src/client/gemini.rs')
| -rw-r--r-- | src/client/gemini.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/gemini.rs b/src/client/gemini.rs index 6f3141c..e846ab1 100644 --- a/src/client/gemini.rs +++ b/src/client/gemini.rs @@ -89,7 +89,7 @@ impl GeminiClient { } } -async fn send_message(builder: RequestBuilder) -> Result<String> { +pub(crate) async fn send_message(builder: RequestBuilder) -> Result<String> { let res = builder.send().await?; let status = res.status(); let data: Value = res.json().await?; @@ -102,7 +102,7 @@ async fn send_message(builder: RequestBuilder) -> Result<String> { Ok(output.to_string()) } -async fn send_message_streaming(builder: RequestBuilder, handler: &mut ReplyHandler) -> Result<()> { +pub(crate) async fn send_message_streaming(builder: RequestBuilder, handler: &mut ReplyHandler) -> Result<()> { let res = builder.send().await?; if res.status() != 200 { let data: Value = res.json().await?; @@ -178,7 +178,7 @@ fn check_error(data: &Value) -> Result<()> { } } -fn build_body(data: SendData, _model: String) -> Result<Value> { +pub(crate) fn build_body(data: SendData, _model: String) -> Result<Value> { let SendData { mut messages, temperature, |
