-
Notifications
You must be signed in to change notification settings - Fork 175
Flexus migration #833
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
Merged
Merged
Flexus migration #833
Conversation
This file contains hidden or 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
…ependency, and simplify data structures
- Update `current_model` usages to incorporate Option type for better error handling. - Modify `ft_toolset` field to utilize Option type, reflecting potential absence of toolset data. - Enhance safety by using `.ok_or` method to provide meaningful error messages when current_model is not set. - Simplify certain sections by eliminating unnecessary variable initialization and comments. - Optimize the connection initialization by directly passing required parameters.
- Update function parameter names and related logic to reflect the change from 'expert_name' to 'ft_fexp_id'. - Modify relevant parts of cloud processing, thread initialization, and subchat operations. - Ensure consistency in identifier usage across different modules such as `cloud`, `threads_req`, `subchat`, and `tool_*`.
- Remove redundant `ft_` prefix from `fexp_id` in `experts_req.rs`. - Add a filter to avoid duplicates in the tool description list. - Correct tool filtering logic to prevent possible race conditions. - Add 'User-Agent' header in GraphQL requests for better tracking. - Simplify GraphQL query parameters in `cloud_tools_req.rs`.
Update the method of finding the last tool calls in a thread to correctly filter by messages from the assistant role. This adjustment ensures the retrieval of the most recent tool calls made by the assistant, addressing potential errors in previous implementations.
Eliminate outdated code paths related to model selection from user preferences, including functions like `resolve_chat_model` and `try_load_caps_quickly_if_not_present`. Replace the constant retrieval of tokenizer instances with a more efficient approach that uses a placeholder when one is not needed. Simplify the handling of `subchat_model` by making it optional and using default strategies where necessary. Additionally, add a new GraphQL query helper function in `experts_req.rs` to dynamically determine model names based on expert contexts.
- Introduce a new parameter, `tool_call_id`, to the `subchat` function across various modules, enhancing clarity and tracking. - Add `generate_random_hash` utility function in `basic_utils.rs` for generating unique identifiers. - Remove inline random hash generation and replace with call to `generate_random_hash`. - Refactor subchat to avoid thread creation if existing threads are found for the given tool_id. - Update function signatures and calls in modules such as `compress_trajectory`, `generate_commit_message_by_diff`, and others to include the `tool_call_id` parameter. - Add error handling for existing threads check in `subchat`. - Cleanup by removing duplicate code and improving code organization for better readability.
Remove the early return on tool execution errors in `threads_processing.rs` and handle errors by pushing a default error message to avoid abrupt termination. In `subchat.rs`, reuse existing threads if they already exist instead of returning an error, ensuring smoother functionality. Add the `
Create a new GraphQL client module to handle GraphQL operations with error handling. Refactor existing API calls in the cloud module to use the new GraphQL client, replacing direct `reqwest` usage. This streamlines the process by consolidating network and error handling logic in one place, improving code maintainability and readability.
Introduce new fields `ft_confirmation_request` and `ft_confirmation_response` in thread data structures to handle confirmation requests and responses for tool calls. Implement the `set_thread_confirmation_request` function to update confirmation requests in the database via a GraphQL mutation. Modify `run_tool` to check if tool calls require confirmation and skip processing until confirmed, logging the necessary information and updating the confirmation request when needed. Ensure successful tool calls are processed without confirmation if already approved.
Eliminate deprecated `forward_to_hf_endpoint.rs` and functions related to Hugging Face endpoints. Remove ChatMeta and ChatMode from request handling to simplify data flow. Clean up unused structures and enums, such as ChatUsage and legacy model resolution logic. Streamline context management in AtCommandsContext for efficiency.
- Delete `at_web.rs` and `tool_web.rs` files due to functionality migration. - Remove `@web` command registration from `at_commands.rs`. - Comment out `ToolWeb` initialization in `tools_list.rs` to reflect removal. - Update URL in `caps.rs` to use new refact URL. - Ensure consistent module updates by removing imports from `mod.rs` files.
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.
No description provided.