From fedd46e98bd3b692c962869252f333b4e37b88a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D0=B8=D0=BD=D0=B0=D1=80=20=D0=9C=D0=B8=D1=80=D0=B7?= =?UTF-8?q?=D0=B0=D0=B3=D0=B8=D1=82=D0=BE=D0=B2?= Date: Wed, 10 Jun 2026 09:56:53 +0000 Subject: [PATCH] Initial solution: add README.md --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 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.