Skip to content

Conversation

starchou6
Copy link

Fix ChatYandexGPT TypeError with multi-iteration agents

Problem: ChatYandexGPT throws TypeError: Cannot read properties of undefined (reading 'additional_kwargs') when used with agents requiring multiple iterations.

Root Cause: AIMessage constructor was missing the additional_kwargs parameter.

Solution: Added additional_kwargs={} to AIMessage creation in both _generate and _agenerate methods.

Changes:

  • Line 95: AIMessage(content=text, additional_kwargs={})
  • Line 120: AIMessage(content=text, additional_kwargs={})

Fixes #287

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ChatYandexGPT: TypeError when creating AIMessage - additional_kwargs is undefined

1 participant