diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d0ab664..2a8f4ff 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.2.0" + ".": "1.3.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 7b92598..f0ea95a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 249 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-a6fedde02dc6241719ebb2589062ba2892baa8dbe928a2d718643beede85e7b3.yml -openapi_spec_hash: a712e4ee68f829570b3f5b267afa5a05 -config_hash: e02ca1082421dfe55b145c45e95d6126 +configured_endpoints: 251 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-b5b621065906a2579dc180db1236ee3b08a4fca9539accc2fbbf88da0ca3923f.yml +openapi_spec_hash: 45b1b4692b26e714008d8120ccfc7433 +config_hash: ef3ce17315a31703e7af0567b3e9738c diff --git a/CHANGELOG.md b/CHANGELOG.md index 068fdd6..cedbeda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 1.3.0 (2026-06-17) + +Full Changelog: [v1.2.0...v1.3.0](https://github.com/openai/openai-cli/compare/v1.2.0...v1.3.0) + +### Features + +* **api:** admin spend_alerts ([f183cb0](https://github.com/openai/openai-cli/commit/f183cb04db80e2a89364c0b46b81f355edbeced5)) +* **api:** responses.moderation and chat_completions.moderation ([d660d08](https://github.com/openai/openai-cli/commit/d660d0873624f3895d9463ec98e6afc9d63a52b8)) +* **api:** update OpenAPI spec or Stainless config ([7aefee4](https://github.com/openai/openai-cli/commit/7aefee4982a088a9299dc68953f0dea796ee5ff5)) +* **api:** update OpenAPI spec or Stainless config ([dee1f3e](https://github.com/openai/openai-cli/commit/dee1f3ea2e7dee54aaa44faddd27675d7e44e43d)) + ## 1.2.0 (2026-06-01) Full Changelog: [v1.1.2...v1.2.0](https://github.com/openai/openai-cli/compare/v1.1.2...v1.2.0) diff --git a/go.mod b/go.mod index 1b64599..6153409 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/goccy/go-yaml v1.18.0 github.com/itchyny/json2yaml v0.1.4 github.com/muesli/reflow v0.3.0 - github.com/openai/openai-go/v3 v3.38.0 + github.com/openai/openai-go/v3 v3.40.0 github.com/stretchr/testify v1.10.0 github.com/tidwall/gjson v1.18.0 github.com/tidwall/pretty v1.2.1 diff --git a/go.sum b/go.sum index 7d3852c..4e7bde8 100644 --- a/go.sum +++ b/go.sum @@ -45,8 +45,8 @@ github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8= github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc= github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk= -github.com/openai/openai-go/v3 v3.38.0 h1:Kre0Fz9mPUxtWjRB/CoNBHflp9W7FkztOm/XMDr/A3E= -github.com/openai/openai-go/v3 v3.38.0/go.mod h1:cdufnVK14cWcT9qA1rRtrXx4FTRsgbDPW7Ia7SS5cZo= +github.com/openai/openai-go/v3 v3.40.0 h1:nohsDVADU/JFPiwi5bD3G6Eo35CjNKv7Ompqc7H2cmY= +github.com/openai/openai-go/v3 v3.40.0/go.mod h1:cdufnVK14cWcT9qA1rRtrXx4FTRsgbDPW7Ia7SS5cZo= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= diff --git a/pkg/cmd/adminorganizationadminapikey.go b/pkg/cmd/adminorganizationadminapikey.go index 37e627b..efaf99b 100644 --- a/pkg/cmd/adminorganizationadminapikey.go +++ b/pkg/cmd/adminorganizationadminapikey.go @@ -24,6 +24,11 @@ var adminOrganizationAdminAPIKeysCreate = cli.Command{ Required: true, BodyPath: "name", }, + &requestflag.Flag[int64]{ + Name: "expires-in-seconds", + Usage: "The number of seconds until the API key expires. Omit this field for a key that does not expire.", + BodyPath: "expires_in_seconds", + }, }, Action: handleAdminOrganizationAdminAPIKeysCreate, HideHelpCommand: true, diff --git a/pkg/cmd/adminorganizationadminapikey_test.go b/pkg/cmd/adminorganizationadminapikey_test.go index df8099a..c2a295f 100644 --- a/pkg/cmd/adminorganizationadminapikey_test.go +++ b/pkg/cmd/adminorganizationadminapikey_test.go @@ -16,12 +16,15 @@ func TestAdminOrganizationAdminAPIKeysCreate(t *testing.T) { "--admin-api-key", "string", "admin:organization:admin-api-keys", "create", "--name", "New Admin Key", + "--expires-in-seconds", "2592000", ) }) t.Run("piping data", func(t *testing.T) { // Test piping YAML data over stdin - pipeData := []byte("name: New Admin Key") + pipeData := []byte("" + + "name: New Admin Key\n" + + "expires_in_seconds: 2592000\n") mocktest.TestRunMockTestWithPipeAndFlags( t, pipeData, "--api-key", "string", diff --git a/pkg/cmd/adminorganizationauditlog.go b/pkg/cmd/adminorganizationauditlog.go index 7386e80..ee842dc 100644 --- a/pkg/cmd/adminorganizationauditlog.go +++ b/pkg/cmd/adminorganizationauditlog.go @@ -62,9 +62,15 @@ var adminOrganizationAuditLogsList = requestflag.WithInnerFlags(cli.Command{ }, &requestflag.Flag[[]string]{ Name: "resource-id", - Usage: "Return only events performed on these targets. For example, a project ID updated.", + Usage: "Return only events performed on these targets. For example, a project ID updated. For ChatGPT connector role events, use the workspace connector resource ID shown in `details.id`, such as `__`.", QueryPath: "resource_ids", }, + &requestflag.Flag[bool]{ + Name: "tenant-only", + Usage: "Return only tenant-scoped events associated with this organization. Required for tenant-scoped events such as `role.bound_to_resource` and `role.unbound_from_resource`. When `true`, all supplied event types must be tenant-scoped.", + Default: false, + QueryPath: "tenant_only", + }, &requestflag.Flag[int64]{ Name: "max-items", Usage: "The maximum number of items to return (use -1 for unlimited).", diff --git a/pkg/cmd/adminorganizationauditlog_test.go b/pkg/cmd/adminorganizationauditlog_test.go index 4d2dc3d..0b1e164 100644 --- a/pkg/cmd/adminorganizationauditlog_test.go +++ b/pkg/cmd/adminorganizationauditlog_test.go @@ -26,6 +26,7 @@ func TestAdminOrganizationAuditLogsList(t *testing.T) { "--limit", "0", "--project-id", "string", "--resource-id", "string", + "--tenant-only=true", ) }) @@ -52,6 +53,7 @@ func TestAdminOrganizationAuditLogsList(t *testing.T) { "--limit", "0", "--project-id", "string", "--resource-id", "string", + "--tenant-only=true", ) }) } diff --git a/pkg/cmd/adminorganizationprojectspendalert.go b/pkg/cmd/adminorganizationprojectspendalert.go index 4e1daa0..74448cf 100644 --- a/pkg/cmd/adminorganizationprojectspendalert.go +++ b/pkg/cmd/adminorganizationprojectspendalert.go @@ -71,6 +71,26 @@ var adminOrganizationProjectsSpendAlertsCreate = requestflag.WithInnerFlags(cli. }, }) +var adminOrganizationProjectsSpendAlertsRetrieve = cli.Command{ + Name: "retrieve", + Usage: "Retrieves a project spend alert.", + Suggest: true, + Flags: []cli.Flag{ + &requestflag.Flag[string]{ + Name: "project-id", + Required: true, + PathParam: "project_id", + }, + &requestflag.Flag[string]{ + Name: "alert-id", + Required: true, + PathParam: "alert_id", + }, + }, + Action: handleAdminOrganizationProjectsSpendAlertsRetrieve, + HideHelpCommand: true, +} + var adminOrganizationProjectsSpendAlertsUpdate = requestflag.WithInnerFlags(cli.Command{ Name: "update", Usage: "Updates a project spend alert.", @@ -242,6 +262,57 @@ func handleAdminOrganizationProjectsSpendAlertsCreate(ctx context.Context, cmd * }) } +func handleAdminOrganizationProjectsSpendAlertsRetrieve(ctx context.Context, cmd *cli.Command) error { + client := openai.NewClient(getDefaultRequestOptions(cmd)...) + unusedArgs := cmd.Args().Slice() + if !cmd.IsSet("project-id") && len(unusedArgs) > 0 { + cmd.Set("project-id", unusedArgs[0]) + unusedArgs = unusedArgs[1:] + } + if !cmd.IsSet("alert-id") && len(unusedArgs) > 0 { + cmd.Set("alert-id", unusedArgs[0]) + unusedArgs = unusedArgs[1:] + } + if len(unusedArgs) > 0 { + return fmt.Errorf("Unexpected extra arguments: %v", unusedArgs) + } + + options, err := flagOptions( + cmd, + apiquery.NestedQueryFormatBrackets, + apiquery.ArrayQueryFormatBrackets, + EmptyBody, + false, + ) + if err != nil { + return err + } + + var res []byte + options = append(options, option.WithResponseBodyInto(&res)) + _, err = client.Admin.Organization.Projects.SpendAlerts.Get( + ctx, + cmd.Value("project-id").(string), + cmd.Value("alert-id").(string), + options..., + ) + if err != nil { + return err + } + + obj := gjson.ParseBytes(res) + format := cmd.Root().String("format") + explicitFormat := cmd.Root().IsSet("format") + transform := cmd.Root().String("transform") + return ShowJSON(obj, ShowJSONOpts{ + ExplicitFormat: explicitFormat, + Format: format, + RawOutput: cmd.Root().Bool("raw-output"), + Title: "admin:organization:projects:spend-alerts retrieve", + Transform: transform, + }) +} + func handleAdminOrganizationProjectsSpendAlertsUpdate(ctx context.Context, cmd *cli.Command) error { client := openai.NewClient(getDefaultRequestOptions(cmd)...) unusedArgs := cmd.Args().Slice() diff --git a/pkg/cmd/adminorganizationprojectspendalert_test.go b/pkg/cmd/adminorganizationprojectspendalert_test.go index c391722..698eef1 100644 --- a/pkg/cmd/adminorganizationprojectspendalert_test.go +++ b/pkg/cmd/adminorganizationprojectspendalert_test.go @@ -65,6 +65,19 @@ func TestAdminOrganizationProjectsSpendAlertsCreate(t *testing.T) { }) } +func TestAdminOrganizationProjectsSpendAlertsRetrieve(t *testing.T) { + t.Run("regular flags", func(t *testing.T) { + mocktest.TestRunMockTestWithFlags( + t, + "--api-key", "string", + "--admin-api-key", "string", + "admin:organization:projects:spend-alerts", "retrieve", + "--project-id", "project_id", + "--alert-id", "alert_id", + ) + }) +} + func TestAdminOrganizationProjectsSpendAlertsUpdate(t *testing.T) { t.Run("regular flags", func(t *testing.T) { mocktest.TestRunMockTestWithFlags( diff --git a/pkg/cmd/adminorganizationspendalert.go b/pkg/cmd/adminorganizationspendalert.go index 1b1d782..665e94d 100644 --- a/pkg/cmd/adminorganizationspendalert.go +++ b/pkg/cmd/adminorganizationspendalert.go @@ -66,6 +66,21 @@ var adminOrganizationSpendAlertsCreate = requestflag.WithInnerFlags(cli.Command{ }, }) +var adminOrganizationSpendAlertsRetrieve = cli.Command{ + Name: "retrieve", + Usage: "Retrieves an organization spend alert.", + Suggest: true, + Flags: []cli.Flag{ + &requestflag.Flag[string]{ + Name: "alert-id", + Required: true, + PathParam: "alert_id", + }, + }, + Action: handleAdminOrganizationSpendAlertsRetrieve, + HideHelpCommand: true, +} + var adminOrganizationSpendAlertsUpdate = requestflag.WithInnerFlags(cli.Command{ Name: "update", Usage: "Updates an organization spend alert.", @@ -214,6 +229,48 @@ func handleAdminOrganizationSpendAlertsCreate(ctx context.Context, cmd *cli.Comm }) } +func handleAdminOrganizationSpendAlertsRetrieve(ctx context.Context, cmd *cli.Command) error { + client := openai.NewClient(getDefaultRequestOptions(cmd)...) + unusedArgs := cmd.Args().Slice() + if !cmd.IsSet("alert-id") && len(unusedArgs) > 0 { + cmd.Set("alert-id", unusedArgs[0]) + unusedArgs = unusedArgs[1:] + } + if len(unusedArgs) > 0 { + return fmt.Errorf("Unexpected extra arguments: %v", unusedArgs) + } + + options, err := flagOptions( + cmd, + apiquery.NestedQueryFormatBrackets, + apiquery.ArrayQueryFormatBrackets, + EmptyBody, + false, + ) + if err != nil { + return err + } + + var res []byte + options = append(options, option.WithResponseBodyInto(&res)) + _, err = client.Admin.Organization.SpendAlerts.Get(ctx, cmd.Value("alert-id").(string), options...) + if err != nil { + return err + } + + obj := gjson.ParseBytes(res) + format := cmd.Root().String("format") + explicitFormat := cmd.Root().IsSet("format") + transform := cmd.Root().String("transform") + return ShowJSON(obj, ShowJSONOpts{ + ExplicitFormat: explicitFormat, + Format: format, + RawOutput: cmd.Root().Bool("raw-output"), + Title: "admin:organization:spend-alerts retrieve", + Transform: transform, + }) +} + func handleAdminOrganizationSpendAlertsUpdate(ctx context.Context, cmd *cli.Command) error { client := openai.NewClient(getDefaultRequestOptions(cmd)...) unusedArgs := cmd.Args().Slice() diff --git a/pkg/cmd/adminorganizationspendalert_test.go b/pkg/cmd/adminorganizationspendalert_test.go index f0bf70d..2df5fa5 100644 --- a/pkg/cmd/adminorganizationspendalert_test.go +++ b/pkg/cmd/adminorganizationspendalert_test.go @@ -62,6 +62,18 @@ func TestAdminOrganizationSpendAlertsCreate(t *testing.T) { }) } +func TestAdminOrganizationSpendAlertsRetrieve(t *testing.T) { + t.Run("regular flags", func(t *testing.T) { + mocktest.TestRunMockTestWithFlags( + t, + "--api-key", "string", + "--admin-api-key", "string", + "admin:organization:spend-alerts", "retrieve", + "--alert-id", "alert_id", + ) + }) +} + func TestAdminOrganizationSpendAlertsUpdate(t *testing.T) { t.Run("regular flags", func(t *testing.T) { mocktest.TestRunMockTestWithFlags( diff --git a/pkg/cmd/chatcompletion.go b/pkg/cmd/chatcompletion.go index 936eff8..6cd3ef6 100644 --- a/pkg/cmd/chatcompletion.go +++ b/pkg/cmd/chatcompletion.go @@ -83,6 +83,11 @@ var chatCompletionsCreate = requestflag.WithInnerFlags(cli.Command{ Usage: "Output types that you would like the model to generate.\nMost models are capable of generating text, which is the default:\n\n`[\"text\"]`\n\nThe `gpt-4o-audio-preview` model can also be used to\n[generate audio](https://platform.openai.com/docs/guides/audio). To request that this model generate\nboth text and audio responses, you can use:\n\n`[\"text\", \"audio\"]`\n", BodyPath: "modalities", }, + &requestflag.Flag[map[string]any]{ + Name: "moderation", + Usage: "Configuration for running moderation on the request input and generated output.\n", + BodyPath: "moderation", + }, &requestflag.Flag[*int64]{ Name: "n", Usage: "How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs.", @@ -245,6 +250,13 @@ var chatCompletionsCreate = requestflag.WithInnerFlags(cli.Command{ InnerField: "parameters", }, }, + "moderation": { + &requestflag.InnerFlag[string]{ + Name: "moderation.model", + Usage: "The moderation model to use for moderated completions, e.g. 'omni-moderation-latest'.", + InnerField: "model", + }, + }, "prediction": { &requestflag.InnerFlag[any]{ Name: "prediction.content", diff --git a/pkg/cmd/chatcompletion_test.go b/pkg/cmd/chatcompletion_test.go index a170f02..c5c7337 100644 --- a/pkg/cmd/chatcompletion_test.go +++ b/pkg/cmd/chatcompletion_test.go @@ -29,6 +29,7 @@ func TestChatCompletionsCreate(t *testing.T) { "--max-tokens", "0", "--metadata", "{foo: string}", "--modality", "[text]", + "--moderation", "{model: model}", "--n", "1", "--parallel-tool-calls=true", "--prediction", "{content: string, type: content}", @@ -81,6 +82,7 @@ func TestChatCompletionsCreate(t *testing.T) { "--max-tokens", "0", "--metadata", "{foo: string}", "--modality", "[text]", + "--moderation.model", "model", "--n", "1", "--parallel-tool-calls=true", "--prediction.content", "string", @@ -137,6 +139,8 @@ func TestChatCompletionsCreate(t *testing.T) { " foo: string\n" + "modalities:\n" + " - text\n" + + "moderation:\n" + + " model: model\n" + "'n': 1\n" + "parallel_tool_calls: true\n" + "prediction:\n" + diff --git a/pkg/cmd/cmd.go b/pkg/cmd/cmd.go index 84d666c..1c30e3c 100644 --- a/pkg/cmd/cmd.go +++ b/pkg/cmd/cmd.go @@ -517,6 +517,7 @@ func init() { Suggest: true, Commands: []*cli.Command{ &adminOrganizationSpendAlertsCreate, + &adminOrganizationSpendAlertsRetrieve, &adminOrganizationSpendAlertsUpdate, &adminOrganizationSpendAlertsList, &adminOrganizationSpendAlertsDelete, @@ -670,6 +671,7 @@ func init() { Suggest: true, Commands: []*cli.Command{ &adminOrganizationProjectsSpendAlertsCreate, + &adminOrganizationProjectsSpendAlertsRetrieve, &adminOrganizationProjectsSpendAlertsUpdate, &adminOrganizationProjectsSpendAlertsList, &adminOrganizationProjectsSpendAlertsDelete, diff --git a/pkg/cmd/inputtoken.go b/pkg/cmd/inputtoken.go index 56fc6b6..a310f0e 100644 --- a/pkg/cmd/inputtoken.go +++ b/pkg/cmd/inputtoken.go @@ -85,6 +85,11 @@ var responsesInputTokensCount = requestflag.WithInnerFlags(cli.Command{ HideHelpCommand: true, }, map[string][]requestflag.HasOuterFlag{ "reasoning": { + &requestflag.InnerFlag[*string]{ + Name: "reasoning.context", + Usage: "Controls which reasoning items are rendered back to the model on later turns.\nWhen returned on a response, this is the effective reasoning context mode\nused for the response.\n", + InnerField: "context", + }, &requestflag.InnerFlag[*string]{ Name: "reasoning.effort", Usage: "Constrains effort on reasoning for\n[reasoning models](https://platform.openai.com/docs/guides/reasoning).\nCurrently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing\nreasoning effort can result in faster responses and fewer tokens used\non reasoning in a response.\n\n- `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.\n- All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.\n- The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.\n- `xhigh` is supported for all models after `gpt-5.1-codex-max`.\n", diff --git a/pkg/cmd/inputtoken_test.go b/pkg/cmd/inputtoken_test.go index 3be084a..8545c9f 100644 --- a/pkg/cmd/inputtoken_test.go +++ b/pkg/cmd/inputtoken_test.go @@ -23,7 +23,7 @@ func TestResponsesInputTokensCount(t *testing.T) { "--parallel-tool-calls=true", "--personality", "friendly", "--previous-response-id", "resp_123", - "--reasoning", "{effort: none, generate_summary: auto, summary: auto}", + "--reasoning", "{context: auto, effort: none, generate_summary: auto, summary: auto}", "--text", "{format: {type: text}, verbosity: low}", "--tool-choice", "none", "--tool", "[{name: name, parameters: {foo: bar}, strict: true, type: function, defer_loading: true, description: description}]", @@ -48,6 +48,7 @@ func TestResponsesInputTokensCount(t *testing.T) { "--parallel-tool-calls=true", "--personality", "friendly", "--previous-response-id", "resp_123", + "--reasoning.context", "auto", "--reasoning.effort", "none", "--reasoning.generate-summary", "auto", "--reasoning.summary", "auto", @@ -70,6 +71,7 @@ func TestResponsesInputTokensCount(t *testing.T) { "personality: friendly\n" + "previous_response_id: resp_123\n" + "reasoning:\n" + + " context: auto\n" + " effort: none\n" + " generate_summary: auto\n" + " summary: auto\n" + diff --git a/pkg/cmd/response.go b/pkg/cmd/response.go index a824310..5be8ed6 100644 --- a/pkg/cmd/response.go +++ b/pkg/cmd/response.go @@ -70,6 +70,11 @@ var responsesCreate = requestflag.WithInnerFlags(cli.Command{ Name: "model", BodyPath: "model", }, + &requestflag.Flag[map[string]any]{ + Name: "moderation", + Usage: "Configuration for running moderation on the input and output of this response.\n", + BodyPath: "moderation", + }, &requestflag.Flag[*bool]{ Name: "parallel-tool-calls", Usage: "Whether to allow the model to run tool calls in parallel.\n", @@ -194,6 +199,13 @@ var responsesCreate = requestflag.WithInnerFlags(cli.Command{ OuterIsArrayOfObjects: true, }, }, + "moderation": { + &requestflag.InnerFlag[string]{ + Name: "moderation.model", + Usage: "The moderation model to use for moderated completions, e.g. 'omni-moderation-latest'.", + InnerField: "model", + }, + }, "prompt": { &requestflag.InnerFlag[string]{ Name: "prompt.id", @@ -212,6 +224,11 @@ var responsesCreate = requestflag.WithInnerFlags(cli.Command{ }, }, "reasoning": { + &requestflag.InnerFlag[*string]{ + Name: "reasoning.context", + Usage: "Controls which reasoning items are rendered back to the model on later turns.\nWhen returned on a response, this is the effective reasoning context mode\nused for the response.\n", + InnerField: "context", + }, &requestflag.InnerFlag[*string]{ Name: "reasoning.effort", Usage: "Constrains effort on reasoning for\n[reasoning models](https://platform.openai.com/docs/guides/reasoning).\nCurrently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing\nreasoning effort can result in faster responses and fewer tokens used\non reasoning in a response.\n\n- `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.\n- All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.\n- The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.\n- `xhigh` is supported for all models after `gpt-5.1-codex-max`.\n", diff --git a/pkg/cmd/response_test.go b/pkg/cmd/response_test.go index b830076..ef83614 100644 --- a/pkg/cmd/response_test.go +++ b/pkg/cmd/response_test.go @@ -27,12 +27,13 @@ func TestResponsesCreate(t *testing.T) { "--max-tool-calls", "0", "--metadata", "{foo: string}", "--model", "gpt-5.1", + "--moderation", "{model: model}", "--parallel-tool-calls=true", "--previous-response-id", "previous_response_id", "--prompt", "{id: id, variables: {foo: string}, version: version}", "--prompt-cache-key", "prompt-cache-key-1234", "--prompt-cache-retention", "in_memory", - "--reasoning", "{effort: none, generate_summary: auto, summary: auto}", + "--reasoning", "{context: auto, effort: none, generate_summary: auto, summary: auto}", "--safety-identifier", "safety-identifier-1234", "--service-tier", "auto", "--store=true", @@ -71,6 +72,7 @@ func TestResponsesCreate(t *testing.T) { "--max-tool-calls", "0", "--metadata", "{foo: string}", "--model", "gpt-5.1", + "--moderation.model", "model", "--parallel-tool-calls=true", "--previous-response-id", "previous_response_id", "--prompt.id", "id", @@ -78,6 +80,7 @@ func TestResponsesCreate(t *testing.T) { "--prompt.version", "version", "--prompt-cache-key", "prompt-cache-key-1234", "--prompt-cache-retention", "in_memory", + "--reasoning.context", "auto", "--reasoning.effort", "none", "--reasoning.generate-summary", "auto", "--reasoning.summary", "auto", @@ -115,6 +118,8 @@ func TestResponsesCreate(t *testing.T) { "metadata:\n" + " foo: string\n" + "model: gpt-5.1\n" + + "moderation:\n" + + " model: model\n" + "parallel_tool_calls: true\n" + "previous_response_id: previous_response_id\n" + "prompt:\n" + @@ -125,6 +130,7 @@ func TestResponsesCreate(t *testing.T) { "prompt_cache_key: prompt-cache-key-1234\n" + "prompt_cache_retention: in_memory\n" + "reasoning:\n" + + " context: auto\n" + " effort: none\n" + " generate_summary: auto\n" + " summary: auto\n" + diff --git a/pkg/cmd/version.go b/pkg/cmd/version.go index a9464c4..dcf0774 100644 --- a/pkg/cmd/version.go +++ b/pkg/cmd/version.go @@ -2,4 +2,4 @@ package cmd -const Version = "1.2.0" // x-release-please-version +const Version = "1.3.0" // x-release-please-version