Skip to content

Commit

Permalink
feat: adds new Anthropic model (claude-3-5-sonnet-20241022) (#2)
Browse files Browse the repository at this point in the history
* feat: adds new Anthropic model (`claude-3-5-sonnet-20241022`)

* fix test
  • Loading branch information
kevinhermawan authored Oct 22, 2024
1 parent 5d22906 commit 2cd6b11
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions Sources/AIModelRetriever/AIModelRetriever.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ public extension AIModelRetriever {
/// - Returns: An array of ``AIModel`` that represents Anthropic's available models.
func anthropic() -> [AIModel] {
return [
AIModel(id: "claude-3-5-sonnet-20240620", name: "Claude 3.5 Sonnet"),
AIModel(id: "claude-3-opus-20240229", name: "Claude 3 Opus"),
AIModel(id: "claude-3-sonnet-20240229", name: "Claude 3 Sonnet"),
AIModel(id: "claude-3-haiku-20240307", name: "Claude 3 Haiku")
AIModel(id: "claude-3-5-sonnet-latest", name: "Claude 3.5 Sonnet (Latest)"),
AIModel(id: "claude-3-5-sonnet-20241022", name: "Claude 3.5 Sonnet (20241022)"),
AIModel(id: "claude-3-opus-latest", name: "Claude 3 Opus (Latest)"),
AIModel(id: "claude-3-opus-20240229", name: "Claude 3 Opus (20240229)"),
AIModel(id: "claude-3-sonnet-20240229", name: "Claude 3 Sonnet (20240229)"),
AIModel(id: "claude-3-haiku-20240307", name: "Claude 3 Haiku (20240307)")
]
}
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/AIModelRetrieverTests/AIModelRetrieverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ final class AIModelRetrieverTests: XCTestCase {
let models = retriever.anthropic()

XCTAssertFalse(models.isEmpty)
XCTAssertTrue(models.contains { $0.id == "claude-3-5-sonnet-20240620" })
XCTAssertTrue(models.contains { $0.name == "Claude 3.5 Sonnet" })
XCTAssertTrue(models.contains { $0.id == "claude-3-5-sonnet-latest" })
XCTAssertTrue(models.contains { $0.name == "Claude 3.5 Sonnet (Latest)" })
}

func testGoogle() {
Expand Down

0 comments on commit 2cd6b11

Please sign in to comment.