Skip to content

Commit

Permalink
feat: extend model checking to include "deepseek" in model names (#221)
Browse files Browse the repository at this point in the history
- Add `strings` package to imports for string manipulation.
- Extend model checking logic to include models containing `"deepseek"` in their name.

Signed-off-by: Yang,Jingrong <immofon@163.com>
  • Loading branch information
immofon authored Feb 26, 2025
1 parent 7bc81d3 commit 0d87ad8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion provider/openai/openai.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"regexp"
"strings"

"github.com/appleboy/CodeGPT/core"
"github.com/appleboy/CodeGPT/proxy"
Expand Down Expand Up @@ -64,7 +65,7 @@ func (c *Client) Completion(ctx context.Context, content string) (*core.Response
func (c *Client) GetSummaryPrefix(ctx context.Context, content string) (*core.Response, error) {
var resp openai.ChatCompletionResponse
var err error
if checkOSeriesModels.MatchString(c.model) {
if checkOSeriesModels.MatchString(c.model) || strings.Contains(strings.ToLower(c.model), "deepseek") {
resp, err = c.CreateChatCompletion(ctx, content)
if err != nil || len(resp.Choices) != 1 {
return nil, err
Expand Down

0 comments on commit 0d87ad8

Please sign in to comment.