From db3cd17d76931395478e23e27197da1e35c790ca Mon Sep 17 00:00:00 2001 From: Fumito Ito Date: Sat, 7 Sep 2024 06:13:34 +0900 Subject: [PATCH] update beta description --- .../Network/HeaderProvider/AnthropicHeaderProvider.swift | 2 +- .../Network/AnthropicAPIClientTests.swift | 4 ++-- .../HeaderProvider/DefaultAnthropicHeaderProviderTests.swift | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/AnthropicSwiftSDK/Network/HeaderProvider/AnthropicHeaderProvider.swift b/Sources/AnthropicSwiftSDK/Network/HeaderProvider/AnthropicHeaderProvider.swift index cc03629..543f235 100644 --- a/Sources/AnthropicSwiftSDK/Network/HeaderProvider/AnthropicHeaderProvider.swift +++ b/Sources/AnthropicSwiftSDK/Network/HeaderProvider/AnthropicHeaderProvider.swift @@ -20,7 +20,7 @@ struct DefaultAnthropicHeaderProvider: AnthropicHeaderProvider { /// content type of response, now only support JSON let contentType = "application/json" - private let betaDescription = "messages-2023-12-15" + private let betaDescription = "prompt-caching-2024-07-31" func getAnthropicAPIHeaders() -> [String: String] { var headers: [String: String] = [ diff --git a/Tests/AnthropicSwiftSDKTests/Network/AnthropicAPIClientTests.swift b/Tests/AnthropicSwiftSDKTests/Network/AnthropicAPIClientTests.swift index 9afc782..7889d81 100644 --- a/Tests/AnthropicSwiftSDKTests/Network/AnthropicAPIClientTests.swift +++ b/Tests/AnthropicSwiftSDKTests/Network/AnthropicAPIClientTests.swift @@ -69,7 +69,7 @@ final class AnthropicAPIClientTests: XCTestCase { XCTAssertEqual(headers!["x-api-key"], "test-api-key") XCTAssertEqual(headers!["anthropic-version"], "2023-06-01") XCTAssertEqual(headers!["Content-Type"], "application/json") - XCTAssertEqual(headers!["anthropic-beta"], "messages-2023-12-15") + XCTAssertEqual(headers!["anthropic-beta"], "prompt-caching-2024-07-31") expectation.fulfill() }) @@ -90,7 +90,7 @@ final class AnthropicAPIClientTests: XCTestCase { XCTAssertEqual(headers!["x-api-key"], "test-api-key") XCTAssertEqual(headers!["anthropic-version"], "2023-06-01") XCTAssertEqual(headers!["Content-Type"], "application/json") - XCTAssertEqual(headers!["anthropic-beta"], "messages-2023-12-15") + XCTAssertEqual(headers!["anthropic-beta"], "prompt-caching-2024-07-31") expectation.fulfill() }) diff --git a/Tests/AnthropicSwiftSDKTests/Network/HeaderProvider/DefaultAnthropicHeaderProviderTests.swift b/Tests/AnthropicSwiftSDKTests/Network/HeaderProvider/DefaultAnthropicHeaderProviderTests.swift index ea7e109..8456c37 100644 --- a/Tests/AnthropicSwiftSDKTests/Network/HeaderProvider/DefaultAnthropicHeaderProviderTests.swift +++ b/Tests/AnthropicSwiftSDKTests/Network/HeaderProvider/DefaultAnthropicHeaderProviderTests.swift @@ -29,7 +29,7 @@ final class DefaultAnthropicHeaderProviderTests: XCTestCase { let provider = DefaultAnthropicHeaderProvider(useBeta: true) let headers = provider.getAnthropicAPIHeaders() - XCTAssertEqual(headers["anthropic-beta"], "messages-2023-12-15") + XCTAssertEqual(headers["anthropic-beta"], "prompt-caching-2024-07-31") } func testBetaHeaderShouldNotBeProvidedIfUseBeta() {