Files
brojs-task-6a1d75e5fd30e81c…/README.md
T

25 lines
670 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 Log Parser
This repository contains a small CLI tool that demonstrates how to parse raw log lines into typed events using **Pydantic v2** and **LangChain** structured output.
## Features
* Discriminated union of two event types (`HttpOkEvent` and `HttpErrorEvent`).
* Uses LangChains `PydanticOutputParser` to let the LLM return a JSON that is automatically validated by Pydantic.
* Example log with mixed 200 and error responses.
* Simple table output for quick inspection.
## Installation
```bash
pip install -r requirements.txt
```
## Usage
```bash
python parse_log.py --log path/to/your.log
```
If `--log` is omitted, an example log is used.