🧩 fix: plugins build options, prevent undefined tools error (#3876)

This commit is contained in:
Danny Avila 2024-09-01 08:35:05 -04:00 committed by GitHub
parent a0291ed155
commit 136599081c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,7 +6,7 @@ const buildOptions = (endpoint, parsedBody) => {
chatGptLabel, chatGptLabel,
promptPrefix, promptPrefix,
agentOptions, agentOptions,
tools, tools = [],
iconURL, iconURL,
greeting, greeting,
spec, spec,
@ -19,7 +19,7 @@ const buildOptions = (endpoint, parsedBody) => {
tools: tools:
tools tools
.map((tool) => tool?.pluginKey ?? tool) .map((tool) => tool?.pluginKey ?? tool)
.filter((toolName) => typeof toolName === 'string') ?? [], .filter((toolName) => typeof toolName === 'string'),
chatGptLabel, chatGptLabel,
promptPrefix, promptPrefix,
agentOptions, agentOptions,