llumpy.retry.RetryHandler¶
- class RetryHandler[source]¶
Bases:
_FormatMixIn,ABCRetry handler to validate LLM responses
- __init__()¶
Methods
__init__()try_prompt(prompt_fn, extract_fn, retries)Prompt an LLM to get a valid response
- try_prompt(prompt_fn, extract_fn, retries)[source]¶
Prompt an LLM to get a valid response
- Parameters:
- Raises:
ExceededRetriesError – Exceed the number of permitted retries
- Returns:
Validated chat response text
- Return type: