https://github.com/trflorian/pydantic-ai-retry-fallback
Retry/Fallback with Pydantic-AI
https://github.com/trflorian/pydantic-ai-retry-fallback
antrophic api claude gemini google gpt llm openai pydantic-ai python
Last synced: about 2 months ago
JSON representation
Retry/Fallback with Pydantic-AI
- Host: GitHub
- URL: https://github.com/trflorian/pydantic-ai-retry-fallback
- Owner: trflorian
- Created: 2025-04-23T19:23:55.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-23T19:47:27.000Z (about 1 year ago)
- Last Synced: 2025-04-24T00:59:11.755Z (about 1 year ago)
- Topics: antrophic, api, claude, gemini, google, gpt, llm, openai, pydantic-ai, python
- Language: Python
- Homepage:
- Size: 29.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Retry / Fallback with Pydantic-AI
This project highlights a simple way to increase robustness when working with external APIs, such as LLM APIs from OpenAi, Google or Anthropic.
## Concepts

### Retry
Call the same api multiple times if a temporary problem prevents successfull responses.
### Fallback
Calling different models in case a provider is not reachable.
## Quickstart
### Prerequisites
- [uv](https://docs.astral.sh/uv/) package manager
- API keys for desired provider, see `.env.example` for reference
### Run Project
```
uv run main.py
```