Skip to content

Commit 59760c1

Browse files
timurrakhimzhanTimur R
andauthored
fix: Fixed "oneOf" toolChoice for google language model (#5834)
Co-authored-by: Timur R <[email protected]>
1 parent 5d7c9d8 commit 59760c1

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/eight-ears-sink.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@effect/ai-google": patch
3+
---
4+
5+
Fixed "oneOf" toolChoice for google language model

packages/ai/google/src/GoogleLanguageModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ const prepareTools: (options: LanguageModel.ProviderOptions, config: Config.Serv
945945
toolConfig = {
946946
functionCallingConfig: {
947947
mode: options.toolChoice.mode === "auto" ? "AUTO" : "ANY",
948-
allowedFunctionNames: Array.from(allowedTools)
948+
allowedFunctionNames: options.toolChoice.mode === "auto" ? undefined : Array.from(allowedTools)
949949
}
950950
}
951951
}

0 commit comments

Comments
 (0)