open_ai: Log inputs that caused parsing errors (#36063)
Release Notes: - N/A Co-authored-by: Michael Sloan <mgsloan@gmail.com>
This commit is contained in:
parent
7df8e05ad9
commit
7ff0f1525e
3 changed files with 11 additions and 1 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -11242,6 +11242,7 @@ dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"futures 0.3.31",
|
"futures 0.3.31",
|
||||||
"http_client",
|
"http_client",
|
||||||
|
"log",
|
||||||
"schemars",
|
"schemars",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
|
|
@ -20,6 +20,7 @@ anyhow.workspace = true
|
||||||
futures.workspace = true
|
futures.workspace = true
|
||||||
http_client.workspace = true
|
http_client.workspace = true
|
||||||
schemars = { workspace = true, optional = true }
|
schemars = { workspace = true, optional = true }
|
||||||
|
log.workspace = true
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
serde_json.workspace = true
|
serde_json.workspace = true
|
||||||
strum.workspace = true
|
strum.workspace = true
|
||||||
|
|
|
@ -445,7 +445,15 @@ pub async fn stream_completion(
|
||||||
Ok(ResponseStreamResult::Err { error }) => {
|
Ok(ResponseStreamResult::Err { error }) => {
|
||||||
Some(Err(anyhow!(error)))
|
Some(Err(anyhow!(error)))
|
||||||
}
|
}
|
||||||
Err(error) => Some(Err(anyhow!(error))),
|
Err(error) => {
|
||||||
|
log::error!(
|
||||||
|
"Failed to parse OpenAI response into ResponseStreamResult: `{}`\n\
|
||||||
|
Response: `{}`",
|
||||||
|
error,
|
||||||
|
line,
|
||||||
|
);
|
||||||
|
Some(Err(anyhow!(error)))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue