Skip to content

Commit 329cd3e

Browse files
feat(api): make model and inputs not required to create response
1 parent 77f7b9f commit 329cd3e

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 97
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-9e41d2d5471d2c28bff0d616f4476f5b0e6c541ef4cb51bdaaef5fdf5e13c8b2.yml
3-
openapi_spec_hash: 86f765e18d00e32cf2ce9db7ab84d946
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-f411a68f272b8be0ab0c266043da33228687b9b2d76896724e3cef797de9563d.yml
3+
openapi_spec_hash: 89bf866ea95ecfb3d76c8833237047d6
44
config_hash: dc5515e257676a27cb1ace1784aa92b3

responses/response.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12244,22 +12244,6 @@ func (r *WebSearchToolUserLocationParam) UnmarshalJSON(data []byte) error {
1224412244
}
1224512245

1224612246
type ResponseNewParams struct {
12247-
// Text, image, or file inputs to the model, used to generate a response.
12248-
//
12249-
// Learn more:
12250-
//
12251-
// - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
12252-
// - [Image inputs](https://platform.openai.com/docs/guides/images)
12253-
// - [File inputs](https://platform.openai.com/docs/guides/pdf-files)
12254-
// - [Conversation state](https://platform.openai.com/docs/guides/conversation-state)
12255-
// - [Function calling](https://platform.openai.com/docs/guides/function-calling)
12256-
Input ResponseNewParamsInputUnion `json:"input,omitzero,required"`
12257-
// Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a
12258-
// wide range of models with different capabilities, performance characteristics,
12259-
// and price points. Refer to the
12260-
// [model guide](https://platform.openai.com/docs/models) to browse and compare
12261-
// available models.
12262-
Model shared.ResponsesModel `json:"model,omitzero,required"`
1226312247
// Whether to run the model response in the background.
1226412248
// [Learn more](https://platform.openai.com/docs/guides/background).
1226512249
Background param.Opt[bool] `json:"background,omitzero"`
@@ -12352,6 +12336,22 @@ type ResponseNewParams struct {
1235212336
//
1235312337
// Any of "auto", "disabled".
1235412338
Truncation ResponseNewParamsTruncation `json:"truncation,omitzero"`
12339+
// Text, image, or file inputs to the model, used to generate a response.
12340+
//
12341+
// Learn more:
12342+
//
12343+
// - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
12344+
// - [Image inputs](https://platform.openai.com/docs/guides/images)
12345+
// - [File inputs](https://platform.openai.com/docs/guides/pdf-files)
12346+
// - [Conversation state](https://platform.openai.com/docs/guides/conversation-state)
12347+
// - [Function calling](https://platform.openai.com/docs/guides/function-calling)
12348+
Input ResponseNewParamsInputUnion `json:"input,omitzero"`
12349+
// Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a
12350+
// wide range of models with different capabilities, performance characteristics,
12351+
// and price points. Refer to the
12352+
// [model guide](https://platform.openai.com/docs/models) to browse and compare
12353+
// available models.
12354+
Model shared.ResponsesModel `json:"model,omitzero"`
1235512355
// **o-series models only**
1235612356
//
1235712357
// Configuration options for

responses/response_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ func TestResponseNewWithOptionalParams(t *testing.T) {
2828
option.WithAPIKey("My API Key"),
2929
)
3030
_, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{
31+
Background: openai.Bool(true),
32+
Include: []responses.ResponseIncludable{responses.ResponseIncludableFileSearchCallResults},
3133
Input: responses.ResponseNewParamsInputUnion{
3234
OfString: openai.String("string"),
3335
},
34-
Model: shared.ResponsesModel("gpt-4o"),
35-
Background: openai.Bool(true),
36-
Include: []responses.ResponseIncludable{responses.ResponseIncludableFileSearchCallResults},
3736
Instructions: openai.String("instructions"),
3837
MaxOutputTokens: openai.Int(0),
3938
Metadata: shared.Metadata{
4039
"foo": "string",
4140
},
41+
Model: shared.ResponsesModel("gpt-4o"),
4242
ParallelToolCalls: openai.Bool(true),
4343
PreviousResponseID: openai.String("previous_response_id"),
4444
Prompt: responses.ResponsePromptParam{

0 commit comments

Comments
 (0)