Files
task-6a1d75e5fd30e81cf3126b1a/README.md
T
2026-06-04 15:51:53 +00:00

25 lines
748 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Structured Output Union Events API
## Overview
This project demonstrates how to parse a raw log containing HTTP events into typed Pydantic models using LangChains structured output. It supports two event types successful requests and errors and aggregates them into a list.
## Files
- `main.py` CLI entry point with example log and parsing logic.
- `models.py` Pydantic v2 models for the events.
- `requirements.txt` Dependencies.
- `README.md` Project description.
## Installation
```bash
pip install -r requirements.txt
```
## Usage
Run the script:
```bash
python main.py
```
You can also pass a custom log via stdin or as an argument.
The output will be a table of parsed events and their JSON representations.