Skip to content

Commit 08e89a6

Browse files
feat(api): workload identity in audit logs, additional_tools item in responses, fix ActionSearch.query to be optional.
1 parent 8f01a93 commit 08e89a6

8 files changed

Lines changed: 1023 additions & 571 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 249
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-afacc4343d0efc074c8c5667eb83570642c8b9acaa7792ca8e075c6d18ef9f3a.yml
3-
openapi_spec_hash: a62a557c61532681963fd21e748b0eb4
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-2a971ccbb946726988e96654eaecceb6d9b5ad27f5793c0064b864f5686d4fc1.yml
3+
openapi_spec_hash: a712e4ee68f829570b3f5b267afa5a05
44
config_hash: bb69d8d0771dbac4a84fc6dca11e3ceb

adminorganizationauditlog.go

Lines changed: 299 additions & 115 deletions
Large diffs are not rendered by default.

chatcompletion.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3089,6 +3089,14 @@ type ChatCompletionNewParams struct {
30893089
// prompt caching, which keeps cached prefixes active for longer, up to a maximum
30903090
// of 24 hours.
30913091
// [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
3092+
// For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported.
3093+
//
3094+
// For older models that support both `in_memory` and `24h`, the default depends on
3095+
// your organization's data retention policy:
3096+
//
3097+
// - Organizations without ZDR enabled default to `24h`.
3098+
// - Organizations with ZDR enabled default to `in_memory` when
3099+
// `prompt_cache_retention` is not specified.
30923100
//
30933101
// Any of "in_memory", "24h".
30943102
PromptCacheRetention ChatCompletionNewParamsPromptCacheRetention `json:"prompt_cache_retention,omitzero"`
@@ -3271,6 +3279,14 @@ func (r *ChatCompletionNewParamsFunction) UnmarshalJSON(data []byte) error {
32713279
// prompt caching, which keeps cached prefixes active for longer, up to a maximum
32723280
// of 24 hours.
32733281
// [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
3282+
// For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported.
3283+
//
3284+
// For older models that support both `in_memory` and `24h`, the default depends on
3285+
// your organization's data retention policy:
3286+
//
3287+
// - Organizations without ZDR enabled default to `24h`.
3288+
// - Organizations with ZDR enabled default to `in_memory` when
3289+
// `prompt_cache_retention` is not specified.
32743290
type ChatCompletionNewParamsPromptCacheRetention string
32753291

32763292
const (

conversations/item.go

Lines changed: 54 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ func (r *ItemService) Delete(ctx context.Context, conversationID string, itemID
124124
// [ConversationItemImageGenerationCall], [responses.ResponseComputerToolCall],
125125
// [responses.ResponseComputerToolCallOutputItem],
126126
// [responses.ResponseToolSearchCall], [responses.ResponseToolSearchOutputItem],
127-
// [responses.ResponseReasoningItem], [responses.ResponseCompactionItem],
128-
// [responses.ResponseCodeInterpreterToolCall], [ConversationItemLocalShellCall],
129-
// [ConversationItemLocalShellCallOutput],
127+
// [ConversationItemAdditionalTools], [responses.ResponseReasoningItem],
128+
// [responses.ResponseCompactionItem], [responses.ResponseCodeInterpreterToolCall],
129+
// [ConversationItemLocalShellCall], [ConversationItemLocalShellCallOutput],
130130
// [responses.ResponseFunctionShellToolCall],
131131
// [responses.ResponseFunctionShellToolCallOutput],
132132
// [responses.ResponseApplyPatchToolCall],
@@ -143,17 +143,16 @@ type ConversationItemUnion struct {
143143
// This field is a union of [[]MessageContentUnion],
144144
// [[]responses.ResponseReasoningItemContent]
145145
Content ConversationItemUnionContent `json:"content"`
146-
// This field is from variant [Message].
147-
Role MessageRole `json:"role"`
148-
Status string `json:"status"`
146+
Role string `json:"role"`
147+
Status string `json:"status"`
149148
// Any of "message", "function_call", "function_call_output", "file_search_call",
150149
// "web_search_call", "image_generation_call", "computer_call",
151-
// "computer_call_output", "tool_search_call", "tool_search_output", "reasoning",
152-
// "compaction", "code_interpreter_call", "local_shell_call",
153-
// "local_shell_call_output", "shell_call", "shell_call_output",
154-
// "apply_patch_call", "apply_patch_call_output", "mcp_list_tools",
155-
// "mcp_approval_request", "mcp_approval_response", "mcp_call", "custom_tool_call",
156-
// "custom_tool_call_output".
150+
// "computer_call_output", "tool_search_call", "tool_search_output",
151+
// "additional_tools", "reasoning", "compaction", "code_interpreter_call",
152+
// "local_shell_call", "local_shell_call_output", "shell_call",
153+
// "shell_call_output", "apply_patch_call", "apply_patch_call_output",
154+
// "mcp_list_tools", "mcp_approval_request", "mcp_approval_response", "mcp_call",
155+
// "custom_tool_call", "custom_tool_call_output".
157156
Type string `json:"type"`
158157
// This field is from variant [Message].
159158
Phase MessagePhase `json:"phase"`
@@ -187,7 +186,7 @@ type ConversationItemUnion struct {
187186
// This field is from variant [responses.ResponseComputerToolCallOutputItem].
188187
AcknowledgedSafetyChecks []responses.ResponseComputerToolCallOutputItemAcknowledgedSafetyCheck `json:"acknowledged_safety_checks"`
189188
Execution string `json:"execution"`
190-
// This field is a union of [[]responses.ToolUnion],
189+
// This field is a union of [[]responses.ToolUnion], [[]responses.ToolUnion],
191190
// [[]ConversationItemMcpListToolsTool]
192191
Tools ConversationItemUnionTools `json:"tools"`
193192
// This field is from variant [responses.ResponseReasoningItem].
@@ -262,6 +261,7 @@ type anyConversationItem interface {
262261

263262
func (Message) ImplConversationItemUnion() {}
264263
func (ConversationItemImageGenerationCall) ImplConversationItemUnion() {}
264+
func (ConversationItemAdditionalTools) ImplConversationItemUnion() {}
265265
func (ConversationItemLocalShellCall) ImplConversationItemUnion() {}
266266
func (ConversationItemLocalShellCallOutput) ImplConversationItemUnion() {}
267267
func (ConversationItemMcpListTools) ImplConversationItemUnion() {}
@@ -282,6 +282,7 @@ func (ConversationItemMcpCall) ImplConversationItemUnion() {}
282282
// case responses.ResponseComputerToolCallOutputItem:
283283
// case responses.ResponseToolSearchCall:
284284
// case responses.ResponseToolSearchOutputItem:
285+
// case conversations.ConversationItemAdditionalTools:
285286
// case responses.ResponseReasoningItem:
286287
// case responses.ResponseCompactionItem:
287288
// case responses.ResponseCodeInterpreterToolCall:
@@ -322,6 +323,8 @@ func (u ConversationItemUnion) AsAny() anyConversationItem {
322323
return u.AsToolSearchCall()
323324
case "tool_search_output":
324325
return u.AsToolSearchOutput()
326+
case "additional_tools":
327+
return u.AsAdditionalTools()
325328
case "reasoning":
326329
return u.AsReasoning()
327330
case "compaction":
@@ -406,6 +409,11 @@ func (u ConversationItemUnion) AsToolSearchOutput() (v responses.ResponseToolSea
406409
return
407410
}
408411

412+
func (u ConversationItemUnion) AsAdditionalTools() (v ConversationItemAdditionalTools) {
413+
apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v)
414+
return
415+
}
416+
409417
func (u ConversationItemUnion) AsReasoning() (v responses.ResponseReasoningItem) {
410418
apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v)
411419
return
@@ -588,12 +596,12 @@ func (r *ConversationItemUnionOutput) UnmarshalJSON(data []byte) error {
588596
// For type safety it is recommended to directly use a variant of the
589597
// [ConversationItemUnion].
590598
type ConversationItemUnionAction struct {
591-
// This field is from variant [responses.ResponseFunctionWebSearchActionUnion].
592-
Query string `json:"query"`
593-
Type string `json:"type"`
599+
Type string `json:"type"`
594600
// This field is from variant [responses.ResponseFunctionWebSearchActionUnion].
595601
Queries []string `json:"queries"`
596602
// This field is from variant [responses.ResponseFunctionWebSearchActionUnion].
603+
Query string `json:"query"`
604+
// This field is from variant [responses.ResponseFunctionWebSearchActionUnion].
597605
Sources []responses.ResponseFunctionWebSearchActionSearchSource `json:"sources"`
598606
URL string `json:"url"`
599607
// This field is from variant [responses.ResponseFunctionWebSearchActionUnion].
@@ -625,9 +633,9 @@ type ConversationItemUnionAction struct {
625633
// This field is from variant [responses.ResponseFunctionShellToolCallAction].
626634
MaxOutputLength int64 `json:"max_output_length"`
627635
JSON struct {
628-
Query respjson.Field
629636
Type respjson.Field
630637
Queries respjson.Field
638+
Query respjson.Field
631639
Sources respjson.Field
632640
URL respjson.Field
633641
Pattern respjson.Field
@@ -710,6 +718,35 @@ func (r *ConversationItemImageGenerationCall) UnmarshalJSON(data []byte) error {
710718
return apijson.UnmarshalRoot(data, r)
711719
}
712720

721+
type ConversationItemAdditionalTools struct {
722+
// The unique ID of the additional tools item.
723+
ID string `json:"id" api:"required"`
724+
// The role that provided the additional tools.
725+
//
726+
// Any of "unknown", "user", "assistant", "system", "critic", "discriminator",
727+
// "developer", "tool".
728+
Role string `json:"role" api:"required"`
729+
// The additional tool definitions made available at this item.
730+
Tools []responses.ToolUnion `json:"tools" api:"required"`
731+
// The type of the item. Always `additional_tools`.
732+
Type constant.AdditionalTools `json:"type" default:"additional_tools"`
733+
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
734+
JSON struct {
735+
ID respjson.Field
736+
Role respjson.Field
737+
Tools respjson.Field
738+
Type respjson.Field
739+
ExtraFields map[string]respjson.Field
740+
raw string
741+
} `json:"-"`
742+
}
743+
744+
// Returns the unmodified JSON received from the API
745+
func (r ConversationItemAdditionalTools) RawJSON() string { return r.JSON.raw }
746+
func (r *ConversationItemAdditionalTools) UnmarshalJSON(data []byte) error {
747+
return apijson.UnmarshalRoot(data, r)
748+
}
749+
713750
// A tool call to run a command on the local shell.
714751
type ConversationItemLocalShellCall struct {
715752
// The unique ID of the local shell call.

responses/inputtoken.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ type InputTokenCountParams struct {
102102
// An array of tools the model may call while generating a response. You can
103103
// specify which tool to use by setting the `tool_choice` parameter.
104104
Tools []ToolUnionParam `json:"tools,omitzero"`
105+
// A model-owned style preset to apply to this request. Omit this parameter to use
106+
// the model's default style. Supported values may expand over time. Values must be
107+
// at most 64 characters.
108+
Personality InputTokenCountParamsPersonality `json:"personality,omitzero"`
105109
// **gpt-5 and o-series models only** Configuration options for
106110
// [reasoning models](https://platform.openai.com/docs/guides/reasoning).
107111
Reasoning shared.ReasoningParam `json:"reasoning,omitzero"`
@@ -174,6 +178,16 @@ func (u *InputTokenCountParamsInputUnion) asAny() any {
174178
return nil
175179
}
176180

181+
// A model-owned style preset to apply to this request. Omit this parameter to use
182+
// the model's default style. Supported values may expand over time. Values must be
183+
// at most 64 characters.
184+
type InputTokenCountParamsPersonality string
185+
186+
const (
187+
InputTokenCountParamsPersonalityFriendly InputTokenCountParamsPersonality = "friendly"
188+
InputTokenCountParamsPersonalityPragmatic InputTokenCountParamsPersonality = "pragmatic"
189+
)
190+
177191
// Configuration options for a text response from the model. Can be plain text or
178192
// structured JSON data. Learn more:
179193
//

responses/inputtoken_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ func TestInputTokenCountWithOptionalParams(t *testing.T) {
3838
Instructions: openai.String("instructions"),
3939
Model: openai.String("model"),
4040
ParallelToolCalls: openai.Bool(true),
41+
Personality: responses.InputTokenCountParamsPersonalityFriendly,
4142
PreviousResponseID: openai.String("resp_123"),
4243
Reasoning: shared.ReasoningParam{
4344
Effort: shared.ReasoningEffortNone,

0 commit comments

Comments
 (0)