Skip to content

Commit

Permalink
add claude-3-5-haiku-20241022 model (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
liushuangls authored Nov 5, 2024
1 parent 29da120 commit c538633
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions common.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const (
ModelClaude3Dot5Sonnet20241022 Model = "claude-3-5-sonnet-20241022"
ModelClaude3Dot5SonnetLatest Model = "claude-3-5-sonnet-latest"
ModelClaude3Haiku20240307 Model = "claude-3-haiku-20240307"
ModelClaude3Dot5HaikuLatest Model = "claude-3-5-haiku-latest"
ModelClaude3Dot5Haiku20241022 Model = "claude-3-5-haiku-20241022"
)

type ChatRole string
Expand Down
21 changes: 21 additions & 0 deletions integrationtest/messages_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,25 @@ func TestIntegrationMessages(t *testing.T) {
t.Logf("RateLimitHeaders: %+v", rateLimHeader)
})
})

t.Run("CreateMessages on real API with claude-3-5-haiku", func(t *testing.T) {
newClient := anthropic.NewClient(APIKey)
req := request
req.Model = anthropic.ModelClaude3Dot5Haiku20241022

resp, err := newClient.CreateMessages(ctx, req)
if err != nil {
t.Fatalf("CreateMessages error: %s", err)
}
t.Logf("CreateMessages resp: %+v", resp)
t.Logf("CreteMessages resp content: %s", resp.GetFirstContentText())

t.Run("RateLimitHeaders are present", func(t *testing.T) {
rateLimHeader, err := resp.GetRateLimitHeaders()
if err != nil {
t.Fatalf("GetRateLimitHeaders error: %s", err)
}
t.Logf("RateLimitHeaders: %+v", rateLimHeader)
})
})
}

0 comments on commit c538633

Please sign in to comment.