You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using an existing Mask, switching among different Models
(e.g. switching from the current Google model to OpenAI model)
will throw an error in the JS Concolse and can't send the request to API.
The console message:
[Chat] failed TypeError: Cannot read properties of undefined (reading 'map')
How to fix the bug: See the Additional Information.
📷 Recurrence Steps
No response
🚦 Expected Behavior
We can make the API requests normally when switching between different brand Models on a Mask.
📝 Additional Information
How to fix the bug:
In the file: \app\store\plugin.ts
We can ensure the "ids" to be empty array if it is "undefined". i.e.
toanngoit
changed the title
[Bug] [Chat] failed TypeError: Cannot read properties of undefined (reading 'map')
[Bug] [Chat] failed TypeError: Cannot read properties of undefined (reading 'map') when switching between diff-brand Models in a Mask
Sep 8, 2024
📦 Deployment Method
Official installation package
📌 Version
Sep 08, 2024
💻 Operating System
Windows
📌 System Version
Web version
🌐 Browser
Chrome
📌 Browser Version
Newest version on Sep 08, 2024
🐛 Bug Description
When using an existing Mask, switching among different Models
(e.g. switching from the current Google model to OpenAI model)
will throw an error in the JS Concolse and can't send the request to API.
The console message:
[Chat] failed TypeError: Cannot read properties of undefined (reading 'map')
How to fix the bug: See the Additional Information.
📷 Recurrence Steps
No response
🚦 Expected Behavior
We can make the API requests normally when switching between different brand Models on a Mask.
📝 Additional Information
How to fix the bug:
In the file: \app\store\plugin.ts
We can ensure the "ids" to be empty array if it is "undefined". i.e.
getAsTools(ids: string[]) {
if (!Array.isArray(ids)) {
ids = []; // Fix bug: ensure ids as an empty array if undefined.
}
const plugins = get().plugins;
const selected = ids
.map((id) => plugins[id])
.filter((i) => i)
.map((p) => FunctionToolService.add(p));
return [
// @ts-ignore
selected.reduce((s, i) => s.concat(i.tools), []),
selected.reduce((s, i) => Object.assign(s, i.funcs), {}),
];
},
The text was updated successfully, but these errors were encountered: