Skip to content

feat (ai/react): add setThreadId helper to switch between threads for useAssistant#2209

Merged
jeremyphilemon merged 4 commits intomainfrom
jrmy/ai-1200
Jul 8, 2024
Merged

feat (ai/react): add setThreadId helper to switch between threads for useAssistant#2209
jeremyphilemon merged 4 commits intomainfrom
jrmy/ai-1200

Conversation

@jeremyphilemon
Copy link
Copy Markdown
Contributor

@jeremyphilemon jeremyphilemon commented Jul 8, 2024

Addresses #1673

  • add setThreadId(threadId: string | undefined) helper function to useAssistant
    • setThreadId("thread_abc123") sets the assistant to that specific thread
    • setThreadId(undefined) creates a new thread
    • both actions will reset messages and update threadId
  • add tests for thread management
  • update reference to include setThreadId

@jeremyphilemon jeremyphilemon marked this pull request as ready for review July 8, 2024 13:40
@jeremyphilemon jeremyphilemon requested a review from lgrammel July 8, 2024 13:43
@lgrammel
Copy link
Copy Markdown
Collaborator

lgrammel commented Jul 8, 2024

Might be worth adding an example to the docs and tweeting about it?

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.

2 participants