Files
task-6a1865008a94f887e50d471c/README.md
T
2026-05-30 17:19:00 +00:00

27 lines
863 B
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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.
# Exam: Structured Output with Pydantic
This repository contains a small CLI tool that demonstrates how to extract structured data from raw text using LangChain and Pydantic.
## Features
- Two Pydantic models: `PersonInfo` and `MeetingNotes`.
- Automatic schema selection based on input type.
- Oneshot extraction via LangChains `PydanticOutputParser`.
- Simple command line interface with example texts.
## Usage
```bash
python -m cli --text "Анна, 28 лет, Python-разработчик. Навыки: FastAPI, Docker."
```
or
```bash
python -m cli --text "Встреча 2026-05-30: Участники: А., Б.; Темы: проект X; Решения: продлить срок."
```
## Requirements
- Python 3.10+
- `langchain-core`, `langchain-openai` (or `langchain-ollama`) and `pydantic`.
```bash
pip install -r requirements.txt
```