Add README with installation instructions

This commit is contained in:
2026-07-02 16:40:35 +00:00
parent ff351640cf
commit ab786ec7a7
+32
View File
@@ -0,0 +1,32 @@
# Structured Output Union Events API
## Installation
```bash
# Create a virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
# Install dependencies
pip install -r requirements.txt
```
The repository contains a single `main.py` script that demonstrates how to parse a raw log into a list of typed events using LangChains structured output and Pydantic v2. The only external dependency required is **langchain-openai** (or **langchain-ollama** if you prefer a local model). The `deepagents` package has been removed because it is not part of the allowed stack.
## Usage
```bash
python main.py
```
You can also pass a custom log file path as a commandline argument:
```bash
python main.py --log custom_log.txt
```
The script will output a table of parsed events and their JSON representations.
---
**Note**: If you encounter any issues with the OpenAI API key, set the environment variable `OPENAI_API_KEY` before running the script.