Skip to content

Commit

Permalink
Merge pull request #14 from 0xPlaygrounds/misc/add-http-error-logging
Browse files Browse the repository at this point in the history
misc: Add logging of http errors
  • Loading branch information
cvauclair authored Sep 5, 2024
2 parents e26a2e0 + 8076a3a commit 7af3603
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 7af3603

Please sign in to comment.