Skip to content

Commit

Permalink
misc: Add logging of http errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cvauclair committed Sep 5, 2024
1 parent e26a2e0 commit 8076a3a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rig-core/src/providers/cohere.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ impl embeddings::EmbeddingModel for EmbeddingModel {
}))
.send()
.await?
.error_for_status()?
.json::<ApiResponse<EmbeddingResponse>>()
.await?;

Expand Down Expand Up @@ -503,6 +504,7 @@ impl completion::CompletionModel for CompletionModel {
)
.send()
.await?
.error_for_status()?
.json::<ApiResponse<CompletionResponse>>()
.await?;

Expand Down
2 changes: 2 additions & 0 deletions rig-core/src/providers/openai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ impl embeddings::EmbeddingModel for EmbeddingModel {
}))
.send()
.await?
.error_for_status()?
.json::<ApiResponse<EmbeddingResponse>>()
.await?;

Expand Down Expand Up @@ -525,6 +526,7 @@ impl completion::CompletionModel for CompletionModel {
)
.send()
.await?
.error_for_status()?
.json::<ApiResponse<CompletionResponse>>()
.await?;

Expand Down

0 comments on commit 8076a3a

Please sign in to comment.