Skip to content

Conversation

louis-menlo
Copy link
Contributor

@louis-menlo louis-menlo commented May 19, 2025

Describe Your Changes

This pull request introduces functionality to manage and utilize a "current assistant" across various parts of the application. Key changes include updates to the assistant and thread state management, integration of assistant-specific instructions in chat messages, and enhancements to the CompletionMessagesBuilder class.

CleanShot.2025-05-20.at.00.18.48.mp4

Image

Image

Image

Closes #2845

Assistant State Management

  • Added a currentAssistant property and corresponding setCurrentAssistant method to the useAssistant hook for tracking and updating the currently selected assistant. (web-app/src/hooks/useAssistant.ts, [1] [2] [3]

Thread State Management

  • Introduced an updateCurrentThreadAssistant method in the useThreads hook to associate the current assistant with the active thread. (web-app/src/hooks/useThreads.ts, [1] [2]

Chat Integration

  • Updated the useChat hook to include assistant-specific instructions in chat messages by leveraging the currentAssistant property. (web-app/src/hooks/useChat.ts, [1] [2] [3]

UI Updates

  • Modified the DropdownAssistant component to use currentAssistant for selection and ensure thread updates when switching assistants. (web-app/src/containers/DropdownAssistant.tsx, [1] [2]
  • Updated the Index and ThreadDetail components to synchronize the current assistant with the active thread and reset the thread ID when navigating. (web-app/src/routes/index.tsx, [1] [2] [3]; web-app/src/routes/threads/$threadId.tsx, [4] [5] [6]

Code Enhancements

  • Enhanced the CompletionMessagesBuilder class with a new addSystemMessage method and improved documentation for better maintainability. (web-app/src/lib/messages.ts, [1] [2]

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

@louis-menlo louis-menlo merged commit 2dac53e into release/v0.5.18 May 19, 2025
5 of 10 checks passed
@louis-menlo louis-menlo deleted the feat/jan-supports-multiple-assistants branch May 19, 2025 17:57
@github-project-automation github-project-automation bot moved this to QA in Jan May 19, 2025
@github-actions github-actions bot added this to the v0.5.18 milestone May 19, 2025
@david-menloai david-menloai moved this from QA to Done in Jan Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants