Skip to content

Commit

Permalink
update beta description
Browse files Browse the repository at this point in the history
  • Loading branch information
fumito-ito committed Sep 6, 2024
1 parent 2032bda commit db3cd17
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
Expand All @@ -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()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit db3cd17

Please sign in to comment.