Skip to content

Commit

Permalink
Merge pull request #25 from northes/feature/auto_model
Browse files Browse the repository at this point in the history
feature: add auto model enum
  • Loading branch information
northes authored Sep 4, 2024
2 parents 98d6c6a + 9afd7ba commit 938f70a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion chat_completions_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (c *chatCompletionsBuilder) preCheck() {
c.req.Messages = make([]*ChatCompletionsMessage, 0)
}
if c.req.Model == "" {
c.req.Model = ModelMoonshotV18K
c.req.Model = ModelMoonshotV1Auto
}
}

Expand Down
1 change: 1 addition & 0 deletions enum_chat_completions.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func (c ChatCompletionsMessageRole) String() string {
type ChatCompletionsModelID string

const (
ModelMoonshotV1Auto ChatCompletionsModelID = "moonshot-v1-auto"
ModelMoonshotV18K ChatCompletionsModelID = "moonshot-v1-8k"
ModelMoonshotV132K ChatCompletionsModelID = "moonshot-v1-32k"
ModelMoonshotV1128K ChatCompletionsModelID = "moonshot-v1-128k"
Expand Down
1 change: 1 addition & 0 deletions enum_chat_completions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func TestEnumChatCompletions(t *testing.T) {
tt.EqualValues(moonshot.ModelMoonshotV18K, moonshot.ModelMoonshotV18K.String())
tt.EqualValues(moonshot.ModelMoonshotV132K, moonshot.ModelMoonshotV132K.String())
tt.EqualValues(moonshot.ModelMoonshotV1128K, moonshot.ModelMoonshotV1128K.String())
tt.EqualValues(moonshot.ModelMoonshotV1Auto, moonshot.ModelMoonshotV1Auto.String())

tt.EqualValues(moonshot.FinishReasonStop, moonshot.FinishReasonStop.String())
tt.EqualValues(moonshot.FinishReasonLength, moonshot.FinishReasonLength.String())
Expand Down

0 comments on commit 938f70a

Please sign in to comment.