-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: reroute threads and messages requests to cortex.cpp backend #4249
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
louis-jan
force-pushed
the
feat/threads-messages-requests-to-backend
branch
from
December 9, 2024 09:34
7801073
to
a446642
Compare
louis-jan
force-pushed
the
feat/threads-messages-requests-to-backend
branch
from
December 12, 2024 09:39
11fe565
to
f6ba447
Compare
louis-jan
commented
Dec 16, 2024
This is the build for this pull request. You can download it from the Artifacts section here: Build URL. |
louis-jan
changed the title
feat: reroute threads and messages requests to the backend
feat: reroute threads and messages requests to cortex.cpp backend
Dec 16, 2024
urmauur
approved these changes
Dec 16, 2024
This is the build for this pull request. You can download it from the Artifacts section here: Build URL. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe Your Changes
This PR refactors the application architecture by moving the /threads, /messages, and /assistants functionalities to the backend. This change aims to reduce the reliance on native APIs (e.g., fs operations) in the frontend and centralize these operations within the backend.
Some of the key changes
Fixes Issues
/messages
,/threads
to Cortex #3895Changes made
The code changes include a series of substantial modifications across multiple files aimed at improving the handling of conversational threads and their related components. Here’s a summary of the changes:
Method Renaming and Expansion: Several abstract methods in
ConversationalExtension
were renamed for clarity, such asgetThreads
tolistThreads
, and new methods were added (createThread
,modifyThread
, etc.) to handle CRUD operations more comprehensively.Elimination of Local Storage and Use of API: Local file operations were removed, replaced by network requests using
ky
. This includes using endpoints like/v1/threads
and mapping the CRUD operations to matching API calls.New Dependencies: Introduced libraries like
ky
for HTTP requests andp-queue
for request queuing, which are now included in thepackage.json
.Enhancement of Thread Handling: The assistant data for a thread is now handled more robustly, with methods added to modify and retrieve assistant information (
getThreadAssistant
,modifyThreadAssistant
, etc.).Global Typings: A
global.d.ts
was added to declare global constants (API_URL
,SOCKET_URL
) and enhance type definitions.Atom Management: Various states have been moved and managed using z, improving state management with
jotai
by transitioning to more structured atoms likeactiveAssistantAtom
.Refactoring UI Components: The code for UI components in various React files was updated to work with the new thread and message methods, and to utilize the newly structured atom states. This includes fetching and displaying thread messages and managing assistant-specific data.
Removal and Clean-Up: Code no longer needed, like handling JSON read/write for threads, was removed, and some test files were deleted to reflect updated logic that no longer relies on local file storage.
Overall, these changes enhance the application's ability to manage conversational data by shifting from a file-based system to an API service-driven architecture while also refactoring and making the code more maintainable and scalable.