commit fedd46e98bd3b692c962869252f333b4e37b88a7 Author: Ринар Мирзагитов Date: Wed Jun 10 09:56:53 2026 +0000 Initial solution: add README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..81d5785 --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +# 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 LangChain’s `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.