Skip to content
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: add support for DeepSeek provider #153

Merged
merged 2 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,15 @@ provider = cohere
api_key = <your API key>
```

If you use [DeepSeek](https://www.deepseek.com):

```ini
[deepseek]
provider = deepseek
api_key = <your API key>
model = deepseek-chat
```

## 🙉 How to use

### Transform comments into commands and vice versa
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "fish_ai"
version = "1.0.3"
version = "1.1.0"
authors = [{ name = "Bastian Fredriksson", email = "realiserad@gmail.com" }]
description = "Provides core functionality for fish-ai, an AI plugin for the fish shell."
readme = "README.md"
Expand Down
6 changes: 6 additions & 0 deletions src/fish_ai/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ def get_openai_client():
api_key=get_config('api_key'),
organization=get_config('organization'),
)
elif (get_config('provider') == 'deepseek'):
# DeepSeek is compatible with OpenAI Python SDK
return OpenAI(
api_key=get_config('api_key'),
base_url='https://api.deepseek.com'
)
else:
raise Exception('Unknown provider "{}".'
.format(get_config('provider')))
Expand Down
Loading