-
Notifications
You must be signed in to change notification settings - Fork 3.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
Add DeepSeek integration for Zed Assistant #23551
base: main
Are you sure you want to change the base?
Conversation
- Add DeepSeek as a new language model provider - Implement DeepSeek API client with streaming support - Add DeepSeek configuration UI and settings - Update documentation with DeepSeek setup instructions - Add DeepSeek icon and model definitions - Integrate DeepSeek into language model registry
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
- Add message merging to fix '400 Bad Request' error for Reasoner model - Address error: 'deepseek-reasoner does not support successive user or assistant messages' - Merge consecutive messages of same role before sending to API - Handle User, System, Assistant and Tool message types - Preserve tool_calls in merged assistant messages - Add comprehensive test coverage for message merging logic - Optimize string concatenation with reserve and push_str - Make Model::id const for better performance Fixes ERROR assistant_context_editor] Failed to connect to DeepSeek API: 400 Bad Request {'error':{'message':'deepseek-reasoner does not support successive user or assistant messages (messages[0] and messages[1] in your input). You should interleave the user/assistant messages in the message sequence.','type':'invalid_request_error','param':null,'code':'invalid_request_error'}}
Fixed issues:
However, I'm not sure if the chosen method is the most appropriate. Welcome to discuss |
…ek API - Removed custom DeepSeekError struct and simplified error handling in the `complete` function. - Refactored `merge_consecutive_messages` to use a more straightforward iteration approach. - Introduced helper functions `merge_messages` and `can_merge` to improve readability. - Updated tests to reflect changes in message merging behavior.
- Added `Custom` variant to `deepseek::Model` enum to support custom models - Updated `id()`, `display_name()`, `max_token_count()`, and `max_output_tokens()` methods to handle custom models - Modified `provided_models()` in DeepSeek provider to include custom models from settings
I think the current implementation is ready for review. The only drawback is that the thinking process of |
… unused complete function - Removed the `complete` function and its associated tests from `deepseek.rs` - Moved message merging logic from `deepseek.rs` to `request.rs`'s `into_deepseek` method - Simplified `stream_completion` by removing redundant message merging - Updated message merging to handle both user and assistant messages in one pass - Maintained existing functionality while improving code organization
@Cupnfish you mention that this PR is "enabling users to utilize DeepSeek models for code completion". Which part of the changes deals with code completions in particular? I can't find anything implementing |
@shishkin Sorry for the misunderstanding, deepseek does indeed support code completion, but it was not implemented at the PR. I have already revised the release notes. If anyone is interested in implementing this feature, they can refer to this document: https://api-docs.deepseek.com/guides/fim_completion |
hi, |
Release Notes: