We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 27d95b2 commit ff53301Copy full SHA for ff53301
components/google_gemini/actions/common/generate-content.mjs
@@ -85,11 +85,13 @@ export default {
85
}
86
87
return safetySettings.map((settingStr) => {
88
- let setting;
89
- try {
90
- setting = JSON.parse(settingStr);
91
- } catch (e) {
92
- throw new ConfigurationError(`Invalid JSON in safety setting: ${settingStr}`);
+ let setting = settingStr;
+ if (typeof setting === "string") {
+ try {
+ setting = JSON.parse(settingStr);
+ } catch (e) {
93
+ throw new ConfigurationError(`Invalid JSON in safety setting: ${settingStr}`);
94
+ }
95
96
97
if (!setting.category || !setting.threshold) {
0 commit comments