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
|
@ -20,6 +20,7 @@ anyhow.workspace = true
|
|||
futures.workspace = true
|
||||
http_client.workspace = true
|
||||
schemars = { workspace = true, optional = true }
|
||||
log.workspace = true
|
||||
serde.workspace = true
|
||||
serde_json.workspace = true
|
||||
strum.workspace = true
|
||||
|
|
|
@ -445,7 +445,15 @@ pub async fn stream_completion(
|
|||
Ok(ResponseStreamResult::Err { 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