Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ jobs:
name: "build"
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
Comment thread
coderabbitai[bot] marked this conversation as resolved.
- name: Cache dependencies
uses: swatinem/rust-cache@v2
- name: Security Audit
uses: actions-rust-lang/audit@v1
Comment on lines +25 to +26

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im not sure this should be part of the build - you can see it fails CI right now and doesn't even state why
Maybe create a new step for this

- name: Check formatting
run: cargo fmt --check
- name: Check clippy
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please revert here as well, this file is automated

Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## v0.7.2-dev

### Ci

- add security audit step
- enable dependency caching
- use dtolnay/rust-toolchain for stable environment

### Fix

- **providers**: migrate openai to structured logging

## v0.7.1 (2025-08-10)

### Fix
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions src/providers/openai/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use axum::http::StatusCode;
use reqwest::Client;
use reqwest_streams::*;
use serde::{Deserialize, Serialize};
use tracing::info;
use tracing::error;

#[derive(Serialize, Deserialize, Clone)]
struct OpenAIChatCompletionRequest {
Expand Down Expand Up @@ -101,7 +101,7 @@ impl Provider for OpenAIProvider {
.send()
.await
.map_err(|e| {
eprintln!("OpenAI API request error: {e}");
error!("OpenAI API request error: {e}");
StatusCode::INTERNAL_SERVER_ERROR
})?;

Expand All @@ -117,12 +117,12 @@ impl Provider for OpenAIProvider {
.await
.map(ChatCompletionResponse::NonStream)
.map_err(|e| {
eprintln!("OpenAI API response error: {e}");
error!("OpenAI API response error: {e}");
StatusCode::INTERNAL_SERVER_ERROR
})
}
} else {
info!(
error!(
"OpenAI API request error: {}",
response.text().await.unwrap()
);
Expand All @@ -143,18 +143,18 @@ impl Provider for OpenAIProvider {
.send()
.await
.map_err(|e| {
eprintln!("OpenAI API request error: {e}");
error!("OpenAI API request error: {e}");
StatusCode::INTERNAL_SERVER_ERROR
})?;

let status = response.status();
if status.is_success() {
response.json().await.map_err(|e| {
eprintln!("OpenAI API response error: {e}");
error!("OpenAI API response error: {e}");
StatusCode::INTERNAL_SERVER_ERROR
})
} else {
eprintln!(
error!(
"OpenAI API request error: {}",
response.text().await.unwrap()
);
Expand All @@ -175,18 +175,18 @@ impl Provider for OpenAIProvider {
.send()
.await
.map_err(|e| {
eprintln!("OpenAI API request error: {e}");
error!("OpenAI API request error: {e}");
StatusCode::INTERNAL_SERVER_ERROR
})?;

let status = response.status();
if status.is_success() {
response.json().await.map_err(|e| {
eprintln!("OpenAI API response error: {e}");
error!("OpenAI API response error: {e}");
StatusCode::INTERNAL_SERVER_ERROR
})
} else {
eprintln!(
error!(
"OpenAI API request error: {}",
response.text().await.unwrap()
);
Expand Down
Loading