Skip to content

Commit

Permalink
fix spelling error
Browse files Browse the repository at this point in the history
  • Loading branch information
l-winston committed Sep 24, 2024
1 parent e095df5 commit 3f1af62
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ type ChatCompletionRequest struct {
// This value is now deprecated in favor of max_completion_tokens, and is not compatible with o1 series models.
// refs: https://platform.openai.com/docs/api-reference/chat/create#chat-create-max_tokens
MaxTokens int `json:"max_tokens,omitempty"`
// MaxCompletionsTokens An upper bound for the number of tokens that can be generated for a completion,
// MaxCompletionTokens An upper bound for the number of tokens that can be generated for a completion,
// including visible output tokens and reasoning tokens https://platform.openai.com/docs/guides/reasoning
MaxCompletionsTokens int `json:"max_completions_tokens,omitempty"`
MaxCompletionTokens int `json:"max_completion_tokens,omitempty"`
Temperature float32 `json:"temperature,omitempty"`

Check failure on line 213 in chat.go

View workflow job for this annotation

GitHub Actions / Sanity check

File is not `goimports`-ed (goimports)
TopP float32 `json:"top_p,omitempty"`
N int `json:"n,omitempty"`
Expand Down
18 changes: 9 additions & 9 deletions chat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func TestO1ModelsChatCompletionsBetaLimitations(t *testing.T) {
{
name: "log_probs_unsupported",
in: openai.ChatCompletionRequest{
MaxCompletionsTokens: 1000,
MaxCompletionTokens: 1000,
LogProbs: true,

Check failure on line 104 in chat_test.go

View workflow job for this annotation

GitHub Actions / Sanity check

File is not `goimports`-ed (goimports)
Model: openai.O1Preview,
},
Expand All @@ -109,7 +109,7 @@ func TestO1ModelsChatCompletionsBetaLimitations(t *testing.T) {
{
name: "message_type_unsupported",
in: openai.ChatCompletionRequest{
MaxCompletionsTokens: 1000,
MaxCompletionTokens: 1000,
Model: openai.O1Mini,
Messages: []openai.ChatCompletionMessage{
{
Expand All @@ -122,7 +122,7 @@ func TestO1ModelsChatCompletionsBetaLimitations(t *testing.T) {
{
name: "tool_unsupported",
in: openai.ChatCompletionRequest{
MaxCompletionsTokens: 1000,
MaxCompletionTokens: 1000,
Model: openai.O1Mini,
Messages: []openai.ChatCompletionMessage{
{
Expand All @@ -143,7 +143,7 @@ func TestO1ModelsChatCompletionsBetaLimitations(t *testing.T) {
{
name: "set_temperature_unsupported",
in: openai.ChatCompletionRequest{
MaxCompletionsTokens: 1000,
MaxCompletionTokens: 1000,
Model: openai.O1Mini,
Messages: []openai.ChatCompletionMessage{
{
Expand All @@ -160,7 +160,7 @@ func TestO1ModelsChatCompletionsBetaLimitations(t *testing.T) {
{
name: "set_top_unsupported",
in: openai.ChatCompletionRequest{
MaxCompletionsTokens: 1000,
MaxCompletionTokens: 1000,
Model: openai.O1Mini,
Messages: []openai.ChatCompletionMessage{
{
Expand All @@ -178,7 +178,7 @@ func TestO1ModelsChatCompletionsBetaLimitations(t *testing.T) {
{
name: "set_n_unsupported",
in: openai.ChatCompletionRequest{
MaxCompletionsTokens: 1000,
MaxCompletionTokens: 1000,
Model: openai.O1Mini,
Messages: []openai.ChatCompletionMessage{
{
Expand All @@ -197,7 +197,7 @@ func TestO1ModelsChatCompletionsBetaLimitations(t *testing.T) {
{
name: "set_presence_penalty_unsupported",
in: openai.ChatCompletionRequest{
MaxCompletionsTokens: 1000,
MaxCompletionTokens: 1000,
Model: openai.O1Mini,
Messages: []openai.ChatCompletionMessage{
{
Expand All @@ -214,7 +214,7 @@ func TestO1ModelsChatCompletionsBetaLimitations(t *testing.T) {
{
name: "set_frequency_penalty_unsupported",
in: openai.ChatCompletionRequest{
MaxCompletionsTokens: 1000,
MaxCompletionTokens: 1000,
Model: openai.O1Mini,
Messages: []openai.ChatCompletionMessage{
{
Expand Down Expand Up @@ -297,7 +297,7 @@ func TestO1ModelChatCompletions(t *testing.T) {
server.RegisterHandler("/v1/chat/completions", handleChatCompletionEndpoint)
_, err := client.CreateChatCompletion(context.Background(), openai.ChatCompletionRequest{
Model: openai.O1Preview,
MaxCompletionsTokens: 1000,
MaxCompletionTokens: 1000,
Messages: []openai.ChatCompletionMessage{
{
Role: openai.ChatMessageRoleUser,
Expand Down
2 changes: 1 addition & 1 deletion completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

var (
ErrO1MaxTokensDeprecated = errors.New("this model is not supported MaxTokens, please use MaxCompletionsTokens") //nolint:lll
ErrO1MaxTokensDeprecated = errors.New("this model is not supported MaxTokens, please use MaxCompletionTokens") //nolint:lll

Check failure on line 10 in completion.go

View workflow job for this annotation

GitHub Actions / Sanity check

File is not `goimports`-ed (goimports)
ErrCompletionUnsupportedModel = errors.New("this model is not supported with this method, please use CreateChatCompletion client method instead") //nolint:lll
ErrCompletionStreamNotSupported = errors.New("streaming is not supported with this method, please use CreateCompletionStream") //nolint:lll
ErrCompletionRequestPromptTypeNotSupported = errors.New("the type of CompletionRequest.Prompt only supports string and []string") //nolint:lll
Expand Down

0 comments on commit 3f1af62

Please sign in to comment.