Skip to content

Commit

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

* fix test
  • Loading branch information
kevinhermawan authored Dec 10, 2024
1 parent 147d095 commit 075d52e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions Sources/AIModelRetriever/AIModelRetriever.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,17 @@ public struct AIModelRetriever: Sendable {
public extension AIModelRetriever {
/// Retrieves a list of AI models from Anthropic.
///
/// The list of available models is sourced from Anthropic's official documentation:
/// [Anthropic Models Documentation](https://docs.anthropic.com/en/docs/about-claude/models)
///
/// - Returns: An array of ``AIModel`` that represents Anthropic's available models.
func anthropic() -> [AIModel] {
return [
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-5-sonnet-latest", name: "Claude 3.5 Sonnet"),
AIModel(id: "claude-3-5-haiku-latest", name: "Claude 3.5 Haiku"),
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)")
AIModel(id: "claude-3-sonnet-20240229", name: "Claude 3 Sonnet"),
AIModel(id: "claude-3-haiku-20240307", name: "Claude 3 Haiku")
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/AIModelRetrieverTests/AIModelRetrieverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ final class AIModelRetrieverTests: XCTestCase {

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

/// Tests that the `cohere` method successfully retrieves models
Expand Down

0 comments on commit 075d52e

Please sign in to comment.