Merge remote-tracking branch 'origin/main'
Some checks failed
Test Suite / test (3.11) (push) Failing after 1m2s
Test Suite / test (3.12) (push) Failing after 1m1s
Test Suite / test (3.13) (push) Failing after 59s

This commit is contained in:
Hua
2026-03-17 14:47:40 +08:00
2 changed files with 18 additions and 0 deletions

View File

@@ -54,6 +54,11 @@ class CustomProvider(LLMProvider):
return LLMResponse(content=f"Error: {e}", finish_reason="error")
def _parse(self, response: Any) -> LLMResponse:
if not response.choices:
return LLMResponse(
content="Error: API returned empty choices. This may indicate a temporary service issue or an invalid model response.",
finish_reason="error"
)
choice = response.choices[0]
msg = choice.message
tool_calls = [