Skip to content

Commit

Permalink
dust-apps: more stability + observability
Browse files Browse the repository at this point in the history
  • Loading branch information
spolu committed Apr 4, 2024
1 parent 081d591 commit d3cb123
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 95 deletions.
104 changes: 11 additions & 93 deletions core/Cargo.lock

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

2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ urlencoding = "2.1"
url = "2.3"
dns-lookup = "1.0"
async-stream = "0.3"
eventsource-client = "0.11"
eventsource-client = "0.12"
tera = "1.17"
fancy-regex = "0.11"
rustc-hash = "1.1"
Expand Down
9 changes: 8 additions & 1 deletion core/src/providers/anthropic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,14 @@ impl AnthropicLLM {
}
},
Err(error) => {
Err(anyhow!("Error streaming from Anthropic: {:?}", error))?;
Err(ModelError {
message: format!("Error streaming from Anthropic: {:?}", error),
retryable: Some(ModelErrorRetryOptions {
sleep: Duration::from_millis(500),
factor: 1,
retries: 1,
}),
})?;
break 'stream;
}
}
Expand Down
2 changes: 2 additions & 0 deletions types/src/front/lib/core_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,8 @@ export class CoreAPI {
logger.error(
{
error: e,
errorStr: JSON.stringify(e),
errorSource: "createRunStream",
},
"Error streaming chunks"
);
Expand Down
4 changes: 4 additions & 0 deletions types/src/front/lib/dust_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ export async function processStreamedRunResponse(
logger.error(
{
error: e,
errorStr: JSON.stringify(e),
errorSource: "processStreamedRunResponse",
},
"Error streaming chunks."
);
Expand Down Expand Up @@ -670,6 +672,8 @@ export class DustAPI {
logger.error(
{
error: e,
errorStr: JSON.stringify(e),
errorSource: "postUserMessage",
},
"Error streaming chunks."
);
Expand Down

0 comments on commit d3cb123

Please sign in to comment.