mirror of
https://github.com/openai/openai-go.git
synced 2026-04-01 17:17:14 +09:00
fix(client): fix verbosity parameter location in Responses
fixes error with unsupported `verbosity` parameter by correctly placing it inside the `text` parameter
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
configured_endpoints: 97
|
||||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-56d3a72a5caa187aebcf9de169a6a28a9dc3f70a79d7467a03a9e22595936066.yml
|
||||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-6a1bfd4738fff02ef5becc3fdb2bf0cd6c026f2c924d4147a2a515474477dd9a.yml
|
||||
openapi_spec_hash: 3eb8d86c06f0bb5e1190983e5acfc9ba
|
||||
config_hash: 7e18239879286d68a48ac5487a649aa6
|
||||
config_hash: a67c5e195a59855fe8a5db0dc61a3e7f
|
||||
|
||||
@@ -892,12 +892,6 @@ type Response struct {
|
||||
//
|
||||
// Deprecated: deprecated
|
||||
User string `json:"user"`
|
||||
// Constrains the verbosity of the model's response. Lower values will result in
|
||||
// more concise responses, while higher values will result in more verbose
|
||||
// responses. Currently supported values are `low`, `medium`, and `high`.
|
||||
//
|
||||
// Any of "low", "medium", "high".
|
||||
Verbosity ResponseVerbosity `json:"verbosity,nullable"`
|
||||
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
|
||||
JSON struct {
|
||||
ID respjson.Field
|
||||
@@ -929,7 +923,6 @@ type Response struct {
|
||||
Truncation respjson.Field
|
||||
Usage respjson.Field
|
||||
User respjson.Field
|
||||
Verbosity respjson.Field
|
||||
ExtraFields map[string]respjson.Field
|
||||
raw string
|
||||
} `json:"-"`
|
||||
@@ -1119,17 +1112,6 @@ const (
|
||||
ResponseTruncationDisabled ResponseTruncation = "disabled"
|
||||
)
|
||||
|
||||
// Constrains the verbosity of the model's response. Lower values will result in
|
||||
// more concise responses, while higher values will result in more verbose
|
||||
// responses. Currently supported values are `low`, `medium`, and `high`.
|
||||
type ResponseVerbosity string
|
||||
|
||||
const (
|
||||
ResponseVerbosityLow ResponseVerbosity = "low"
|
||||
ResponseVerbosityMedium ResponseVerbosity = "medium"
|
||||
ResponseVerbosityHigh ResponseVerbosity = "high"
|
||||
)
|
||||
|
||||
// Emitted when there is a partial audio response.
|
||||
type ResponseAudioDeltaEvent struct {
|
||||
// A chunk of Base64 encoded response audio bytes.
|
||||
@@ -11174,9 +11156,16 @@ type ResponseTextConfig struct {
|
||||
// ensures the message the model generates is valid JSON. Using `json_schema` is
|
||||
// preferred for models that support it.
|
||||
Format ResponseFormatTextConfigUnion `json:"format"`
|
||||
// Constrains the verbosity of the model's response. Lower values will result in
|
||||
// more concise responses, while higher values will result in more verbose
|
||||
// responses. Currently supported values are `low`, `medium`, and `high`.
|
||||
//
|
||||
// Any of "low", "medium", "high".
|
||||
Verbosity ResponseTextConfigVerbosity `json:"verbosity,nullable"`
|
||||
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
|
||||
JSON struct {
|
||||
Format respjson.Field
|
||||
Verbosity respjson.Field
|
||||
ExtraFields map[string]respjson.Field
|
||||
raw string
|
||||
} `json:"-"`
|
||||
@@ -11197,12 +11186,29 @@ func (r ResponseTextConfig) ToParam() ResponseTextConfigParam {
|
||||
return param.Override[ResponseTextConfigParam](json.RawMessage(r.RawJSON()))
|
||||
}
|
||||
|
||||
// Constrains the verbosity of the model's response. Lower values will result in
|
||||
// more concise responses, while higher values will result in more verbose
|
||||
// responses. Currently supported values are `low`, `medium`, and `high`.
|
||||
type ResponseTextConfigVerbosity string
|
||||
|
||||
const (
|
||||
ResponseTextConfigVerbosityLow ResponseTextConfigVerbosity = "low"
|
||||
ResponseTextConfigVerbosityMedium ResponseTextConfigVerbosity = "medium"
|
||||
ResponseTextConfigVerbosityHigh ResponseTextConfigVerbosity = "high"
|
||||
)
|
||||
|
||||
// Configuration options for a text response from the model. Can be plain text or
|
||||
// structured JSON data. Learn more:
|
||||
//
|
||||
// - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
|
||||
// - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
|
||||
type ResponseTextConfigParam struct {
|
||||
// Constrains the verbosity of the model's response. Lower values will result in
|
||||
// more concise responses, while higher values will result in more verbose
|
||||
// responses. Currently supported values are `low`, `medium`, and `high`.
|
||||
//
|
||||
// Any of "low", "medium", "high".
|
||||
Verbosity ResponseTextConfigVerbosity `json:"verbosity,omitzero"`
|
||||
// An object specifying the format that the model must output.
|
||||
//
|
||||
// Configuring `{ "type": "json_schema" }` enables Structured Outputs, which
|
||||
@@ -13485,12 +13491,6 @@ type ResponseNewParams struct {
|
||||
//
|
||||
// Any of "auto", "disabled".
|
||||
Truncation ResponseNewParamsTruncation `json:"truncation,omitzero"`
|
||||
// Constrains the verbosity of the model's response. Lower values will result in
|
||||
// more concise responses, while higher values will result in more verbose
|
||||
// responses. Currently supported values are `low`, `medium`, and `high`.
|
||||
//
|
||||
// Any of "low", "medium", "high".
|
||||
Verbosity ResponseNewParamsVerbosity `json:"verbosity,omitzero"`
|
||||
// Text, image, or file inputs to the model, used to generate a response.
|
||||
//
|
||||
// Learn more:
|
||||
@@ -13731,17 +13731,6 @@ const (
|
||||
ResponseNewParamsTruncationDisabled ResponseNewParamsTruncation = "disabled"
|
||||
)
|
||||
|
||||
// Constrains the verbosity of the model's response. Lower values will result in
|
||||
// more concise responses, while higher values will result in more verbose
|
||||
// responses. Currently supported values are `low`, `medium`, and `high`.
|
||||
type ResponseNewParamsVerbosity string
|
||||
|
||||
const (
|
||||
ResponseNewParamsVerbosityLow ResponseNewParamsVerbosity = "low"
|
||||
ResponseNewParamsVerbosityMedium ResponseNewParamsVerbosity = "medium"
|
||||
ResponseNewParamsVerbosityHigh ResponseNewParamsVerbosity = "high"
|
||||
)
|
||||
|
||||
type ResponseGetParams struct {
|
||||
// When true, stream obfuscation will be enabled. Stream obfuscation adds random
|
||||
// characters to an `obfuscation` field on streaming delta events to normalize
|
||||
|
||||
@@ -68,6 +68,7 @@ func TestResponseNewWithOptionalParams(t *testing.T) {
|
||||
Format: responses.ResponseFormatTextConfigUnionParam{
|
||||
OfText: &shared.ResponseFormatTextParam{},
|
||||
},
|
||||
Verbosity: responses.ResponseTextConfigVerbosityLow,
|
||||
},
|
||||
ToolChoice: responses.ResponseNewParamsToolChoiceUnion{
|
||||
OfToolChoiceMode: openai.Opt(responses.ToolChoiceOptionsNone),
|
||||
@@ -86,7 +87,6 @@ func TestResponseNewWithOptionalParams(t *testing.T) {
|
||||
TopP: openai.Float(1),
|
||||
Truncation: responses.ResponseNewParamsTruncationAuto,
|
||||
User: openai.String("user-1234"),
|
||||
Verbosity: responses.ResponseNewParamsVerbosityLow,
|
||||
})
|
||||
if err != nil {
|
||||
var apierr *openai.Error
|
||||
|
||||
Reference in New Issue
Block a user