Skip to content

Commit 3bae380

Browse files
committed
Allow explicit prompt_cache_key
1 parent 3eb695b commit 3bae380

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Sources/OpenAI/Public/Models/Responses API/CreateModelResponseQuery.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ public struct CreateModelResponseQuery: Codable, Equatable, Sendable {
2424
/// Model ID used to generate the response, like `gpt-4o` or `o1`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points.
2525
/// Refer to the [model guide](https://platform.openai.com/docs/models) to browse and compare available models.
2626
public let model: String
27-
27+
28+
/// An optional key to use for prompt caching.
29+
public let promptCacheKey: String?
30+
2831
/// Specify additional output data to include in the model response.
2932
///
3033
/// Currently supported values are:
@@ -129,6 +132,7 @@ public struct CreateModelResponseQuery: Codable, Equatable, Sendable {
129132
public init(
130133
input: Input,
131134
model: String,
135+
promptCacheKey: String? = nil,
132136
include: [Schemas.Includable]? = nil,
133137
background: Bool? = nil,
134138
instructions: String? = nil,
@@ -151,6 +155,7 @@ public struct CreateModelResponseQuery: Codable, Equatable, Sendable {
151155
) {
152156
self.input = input
153157
self.model = model
158+
self.promptCacheKey = promptCacheKey
154159
self.include = include
155160
self.background = background
156161
self.instructions = instructions
@@ -175,6 +180,7 @@ public struct CreateModelResponseQuery: Codable, Equatable, Sendable {
175180
private enum CodingKeys: String, CodingKey {
176181
case input
177182
case model
183+
case promptCacheKey = "prompt_cache_key"
178184
case include
179185
case background
180186
case instructions

0 commit comments

Comments
 (0)