Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Errors in llm apps freezes the playground #2342

Merged
merged 2 commits into from
Dec 6, 2024
Merged
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
2 changes: 1 addition & 1 deletion agenta-cli/agenta/sdk/decorators/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ def handle_failure(self, error: Exception):
log.warning(format_exc().strip("\n"))
log.warning("--------------------------------------------------")

status_code = error.status_code if hasattr(error, "status_code") else 500
status_code = 500
message = str(error)
stacktrace = format_exception(error, value=error, tb=error.__traceback__) # type: ignore
detail = {"message": message, "stacktrace": stacktrace}
Expand Down
20 changes: 16 additions & 4 deletions agenta-web/src/services/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,11 @@ export async function callVariant(
return response
})
.catch(async (error) => {
console.log("Unsecure call to LLM App failed:", error?.status)
console.log("Unsecure call to LLM App failed:", error)

if (error?.response?.status !== 401) {
throw error
}

let response = await axios
.post(secure_url, requestBody, {
Expand All @@ -163,7 +167,9 @@ export async function callVariant(
return response
})
.catch((error) => {
console.log("Secure call to LLM App failed:", error?.status)
console.log("Secure call to LLM App failed:", error)

throw error
})

return response
Expand Down Expand Up @@ -200,7 +206,11 @@ export const fetchVariantParametersFromOpenAPI = async (
return response
})
.catch(async (error) => {
console.log("Unsecure call to LLM App failed:", error?.status)
console.log("Unsecure call to LLM App failed:", error)

if (error?.response?.status !== 401) {
throw error
}

let response = await axios
.get(secure_url, {
Expand All @@ -211,7 +221,9 @@ export const fetchVariantParametersFromOpenAPI = async (
return response
})
.catch((error) => {
console.log("Secure call to LLM App failed:", error?.status)
console.log("Secure call to LLM App failed:", error)

throw error
})

return response
Expand Down
Loading