https://github.com/inkybubble/llm_patterns_openai
Patterns for the responses API (openai) and for iterative validation of toy structured output
https://github.com/inkybubble/llm_patterns_openai
multiturn openai responses-api tool-use
Last synced: 4 days ago
JSON representation
Patterns for the responses API (openai) and for iterative validation of toy structured output
- Host: GitHub
- URL: https://github.com/inkybubble/llm_patterns_openai
- Owner: inkybubble
- License: mit
- Created: 2025-11-30T05:48:07.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-11-30T06:06:46.000Z (6 months ago)
- Last Synced: 2025-12-02T10:55:51.231Z (6 months ago)
- Topics: multiturn, openai, responses-api, tool-use
- Language: Python
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LLM Patterns in openai - a multi-turn chat with tool-usage
Chat pipeline with tool calling. Starting point from OpenAI's function calling quickstart. A reference that I can use for other applications, to structure outputs.
The horoscope example was inspired by the openai developer guide and lightly modified.
## Setup
```
uv sync
```
## Chat pipeline
`src/chat.py` - Multi-turn chat class that:
- Maintains conversation history
- Routes tool calls to handlers
- Retries on validation errors for toy structured outputs
- Respects system prompt instructions
## Examples
`examples/00_horoscope_pipeline.py` - Pipeline test using fake horoscope tools. Tests multi-turn chat, tool selection, input validation, system prompt influence.
```
uv run examples/00_horoscope_pipeline.py
```
See `examples/00_horoscope_pipeline.md` for sample output walkthrough.