feat: solution for 'Повторный экзамен #2: Сравнительный обзор 3 сущностей (Tavily)'
This commit is contained in:
@@ -1,82 +1,21 @@
|
||||
# Entity Comparison Tool
|
||||
# Повторный экзамен #2: Сравнительный обзор 3 сущностей (Tavily)
|
||||
|
||||
This project demonstrates how to integrate the Qdrant vector database with the Tavily search API to generate a markdown table comparing three entities. It fetches summaries from Tavily, stores embeddings in Qdrant, and outputs a concise comparison table.
|
||||
Главная
|
||||
Мои задания
|
||||
Повторный экзамен #2: Сравнительный обзор 3 сущностей (Tavily)
|
||||
5Д
|
||||
EN
|
||||
Повторный экзамен #2: Сравнительный обзор 3 сущностей (Tavily)
|
||||
Зачёт
|
||||
Версия 9
|
||||
Дедлайн сдачи: 31.08.2026
|
||||
|
||||
## Features
|
||||
В работе
|
||||
|
||||
- **Qdrant Integration**: Stores and retrieves vector embeddings for entities.
|
||||
- **Tavily Search**: Retrieves up-to-date summaries and URLs for each entity.
|
||||
- **Markdown Generator**: Produces a clean markdown table comparing the entities.
|
||||
Требуется доработка
|
||||
|
||||
## Prerequisites
|
||||
В работе отсутствуют обязательные пакеты LangGraph и LangChain, необходимые для реализации заданной функциональности. Пожалуйста, добавьте их в requirements.txt и убедитесь, что все импорты работают без ошибок.
|
||||
|
||||
- Python 3.9+
|
||||
- A running Qdrant instance (default: `localhost:6333`)
|
||||
- A Tavily API key
|
||||
Редактирование ответа
|
||||
|
||||
## Setup
|
||||
|
||||
```bash
|
||||
# Clone the repository
|
||||
git clone https://github.com/yourusername/entity-comparison-tool.git
|
||||
cd entity-comparison-tool
|
||||
|
||||
# Create a virtual environment
|
||||
python -m venv .venv
|
||||
source .venv/bin/activate # On Windows: .venv\Scripts\activate
|
||||
|
||||
# Install dependencies
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
Create a `.env` file in the project root with the following variables:
|
||||
|
||||
```dotenv
|
||||
# Tavily API key
|
||||
TAVILY_API_KEY=your_tavily_api_key
|
||||
|
||||
# Qdrant connection (optional, defaults to localhost:6333)
|
||||
QDRANT_HOST=localhost
|
||||
QDRANT_PORT=6333
|
||||
QDRANT_COLLECTION=entities
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
# Compare three entities
|
||||
python src/main.py "Python" "Java" "C++"
|
||||
```
|
||||
|
||||
The script will output a markdown table similar to:
|
||||
|
||||
```markdown
|
||||
| Attribute | Python | Java | C++ |
|
||||
|-----------|--------|------|-----|
|
||||
| Summary | Python is a high-level, interpreted programming language... | Java is a class-based, object-oriented programming language... | C++ is a general-purpose programming language that supports procedural, object-oriented, and generic programming... |
|
||||
| URL | https://www.python.org/ | https://www.oracle.com/java/ | https://isocpp.org/ |
|
||||
```
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
entity-comparison-tool/
|
||||
├── src/
|
||||
│ ├── main.py
|
||||
│ ├── qdrant_client.py
|
||||
│ └── markdown_generator.py
|
||||
├── requirements.txt
|
||||
└── README.md
|
||||
```
|
||||
|
||||
## Extending the Tool
|
||||
|
||||
- **Custom Attributes**: Modify `markdown_generator.py` to extract additional attributes from the Tavily response.
|
||||
- **Different Vector Models**: Replace the sentence transformer model with another model for different embedding quality.
|
||||
- **Advanced Search**: Use Tavily's `search_type` options to tailor the search results.
|
||||
|
||||
## License
|
||||
|
||||
MIT License
|
||||
Заполните ответ и отправьте работу на пр
|
||||
Reference in New Issue
Block a user