Skip to content

[BUG] - TypeError: Cannot read properties of undefined (reading 'seed') #11

@aPersonWithName

Description

@aPersonWithName

Description
TypeError in function buildOptions(options: ChatGptOptions) of index.helper.ts if options isn't defined.
Can not establish a connection to ChatGpt with valid ChatGpt api key and valid modell selection in the global ChatGpt settings.

Expectation
buildOptions function should return valid options also if specific chatgpt options are null or undefined

Error Message
TypeError: Cannot read properties of undefined (reading 'seed')
at ChatGptLlmHelper.buildOptions (/app/src/.hexabot/contrib/extensions/helpers/hexabot-helper-chatgpt/index.helper.ts:87:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at ChatGptLlmHelper.generateStructuredResponse (/app/src/.hexabot/contrib/extensions/helpers/hexabot-helper-chatgpt/index.helper.ts:160:18)
at LlmNluHelper.predict (/app/src/extensions/helpers/llm-nlu/index.helper.ts:115:22)

Result
ChatGpt connection isn't working

Solution by @crux25
Check for existence of the options object. See commit 761f514

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions