Spaces:
Runtime error
Runtime error
Download src/llm/errors.py from avfranco/runner-ai-intelligence: direct link, hf CLI and curl.
- Browser
- Download file 890 Bytes
-
https://huggingface.co/spaces/avfranco/runner-ai-intelligence/resolve/main/src/llm/errors.py
- Command line
-
hf download hf://spaces/avfranco/runner-ai-intelligence/src/llm/errors.py
-
curl -L -o errors.py https://huggingface.co/spaces/avfranco/runner-ai-intelligence/resolve/main/src/llm/errors.py
890 Bytes
| from typing import Optional, Any | |
| class StructuredOutputError(Exception): | |
| """Exception raised when an LLM fails to produce valid structured output.""" | |
| def __init__( | |
| self, | |
| provider: str, | |
| model: str, | |
| prompt_id: str, | |
| raw_output: str, | |
| reason: str, | |
| details: Optional[Any] = None, | |
| ): | |
| self.provider = provider | |
| self.model = model | |
| self.prompt_id = prompt_id | |
| self.raw_output = raw_output | |
| self.reason = reason | |
| self.details = details | |
| message = ( | |
| f"Structured output failure for {provider}/{model} (Prompt: {prompt_id}). " | |
| f"Reason: {reason}. Output snippet: {raw_output[:100]}..." | |
| ) | |
| super().__init__(message) | |
| class MissingCredentialError(Exception): | |
| """Raised when an LLM client cannot resolve required credentials.""" | |
| pass | |