Skip to content

Commit 0d87ad8

Browse files
authored
feat: extend model checking to include "deepseek" in model names (#221)
- 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 <[email protected]>
1 parent 7bc81d3 commit 0d87ad8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

provider/openai/openai.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"regexp"
7+
"strings"
78

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

0 commit comments

Comments
 (0)