diff options
| author | sigoden <sigoden@gmail.com> | 2024-06-28 07:11:20 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-28 07:11:20 +0800 |
| commit | 8b8f8b37c35479f747a70a65f069c0d8d4b01dcf (patch) | |
| tree | 35a235d09289357373e4235789fcbda1da57a404 /src/function.rs | |
| parent | 4fbbbd2d991b37ac04b77151ef862de9649bbfec (diff) | |
| download | aichat-8b8f8b37c35479f747a70a65f069c0d8d4b01dcf.tar.gz | |
fix: gemini with functions that have empty parameters (#666)
Diffstat (limited to 'src/function.rs')
| -rw-r--r-- | src/function.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/function.rs b/src/function.rs index 8528af5..e99d2c6 100644 --- a/src/function.rs +++ b/src/function.rs @@ -125,6 +125,15 @@ pub struct JsonSchema { pub required: Option<Vec<String>>, } +impl JsonSchema { + pub fn is_empty_properties(&self) -> bool { + match &self.properties { + Some(v) => v.is_empty(), + None => true, + } + } +} + #[derive(Debug, Clone, Default, Deserialize, Serialize)] pub struct ToolCall { pub name: String, |
