Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(agent): ensure safe access of conversation content #166

Merged
merged 2 commits into from
Nov 17, 2024

Conversation

gching
Copy link
Contributor

@gching gching commented Nov 17, 2024

When converting the LLM stream response to string, choices[0] could potentially be undefined

Changes

  • Add in optional chain check on choices[0]

Reproduction

  • Note Was testing on a local agent
  • Respond to agent via voice
  • When a response was returned from the LLM, choices[0] was undefined

Extra

Copy link

changeset-bot bot commented Nov 17, 2024

🦋 Changeset detected

Latest commit: f0f9d06

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@livekit/agents Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-silero Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gching gching changed the title fix(agent) Ensure llm string conversation safely accesses content fix(agent) Ensure llm string conversation safely accesses content Nov 17, 2024
@nbsp nbsp changed the title fix(agent) Ensure llm string conversation safely accesses content fix(agent): ensure safe access of conversation content Nov 17, 2024
@nbsp nbsp merged commit 1415190 into livekit:main Nov 17, 2024
4 checks passed
@github-actions github-actions bot mentioned this pull request Nov 17, 2024
@gching gching deleted the gching/choices-delta-optional branch November 19, 2024 04:02
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.

3 participants