intergation validation passed for automation
This commit is contained in:
parent
94128bfc46
commit
a98bc941d2
2 changed files with 15 additions and 3 deletions
|
|
@ -219,8 +219,14 @@ class AiAnthropic(BaseConnectorAi):
|
||||||
)
|
)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error calling Anthropic API: {str(e)}")
|
error_msg = str(e) if str(e) else f"{type(e).__name__}"
|
||||||
raise HTTPException(status_code=500, detail=f"Error calling Anthropic API: {str(e)}")
|
error_detail = f"Error calling Anthropic API: {error_msg}"
|
||||||
|
if hasattr(e, 'detail') and e.detail:
|
||||||
|
error_detail += f" | Detail: {e.detail}"
|
||||||
|
if hasattr(e, 'status_code'):
|
||||||
|
error_detail += f" | Status: {e.status_code}"
|
||||||
|
logger.error(error_detail, exc_info=True)
|
||||||
|
raise HTTPException(status_code=500, detail=error_detail)
|
||||||
|
|
||||||
async def callAiImage(self, modelCall: AiModelCall) -> AiModelResponse:
|
async def callAiImage(self, modelCall: AiModelCall) -> AiModelResponse:
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -350,7 +350,13 @@ class AiObjects:
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
lastError = e
|
lastError = e
|
||||||
logger.warning(f"❌ Model {model.name} failed for content part: {str(e)}")
|
error_msg = str(e) if str(e) else f"{type(e).__name__}"
|
||||||
|
error_detail = f"❌ Model {model.name} failed for content part: {error_msg}"
|
||||||
|
if hasattr(e, 'detail') and e.detail:
|
||||||
|
error_detail += f" | Detail: {e.detail}"
|
||||||
|
if hasattr(e, 'status_code'):
|
||||||
|
error_detail += f" | Status: {e.status_code}"
|
||||||
|
logger.warning(error_detail, exc_info=True)
|
||||||
|
|
||||||
if attempt < len(failoverModelList) - 1:
|
if attempt < len(failoverModelList) - 1:
|
||||||
logger.info(f"🔄 Trying next failover model...")
|
logger.info(f"🔄 Trying next failover model...")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue