semvec/pypi-packages huggingface dataset:
automation-error-detector 1.3.6
Automation browser error detection and screen detection with AI fallback and cache
Requires Python: >=3.9

# Automation Error Detector

🚀 **Automation Error Detector** là một Python package giúp bạn **phát hiện và phân loại lỗi màn hình trình duyệt trong automation**, sử dụng **OpenAI API chỉ một lần**, sau đó **cache kết quả để tái sử dụng mà không cần AI nữa**.

Package được thiết kế theo **DDD + Clean Architecture**, cho phép bạn **tự do lưu cache ở bất kỳ đâu** (Redis, PostgreSQL, file, cloud, v.v.) thông qua **callback**.

---

## ✨ Features

- ✅ Phát hiện lỗi từ **text trên màn hình trình duyệt**
- 🤖 **AI fallback (OpenAI)** chỉ dùng khi cache miss
- ⚡ Cache thông minh bằng **signature từ keywords**
- 🔌 **Pluggable cache callback** (Redis, Postgres, JSON, custom)
- 🧱 Kiến trúc **DDD + Clean Architecture**
- 📦 Sẵn sàng publish & reuse qua **PyPI**
- 🧪 Dễ test, dễ mở rộng, production-ready

---

## 📦 Installation

```bash
pip install automation-error-detector
```

---

## 🔐 Environment Variables

| Name | Required | Description |
|---|---|---|
| OPENAI_API_KEY | ✅ | OpenAI API key |
| OPENAI_MODEL | ❌ | Model name (default: gpt-4.1-mini) |
| ERROR_CACHE_FILE | ❌ | Cache file path (JSON adapter) |

```bash
export OPENAI_API_KEY="sk-xxxx"
```

---

## 🚀 Quick Start

```python
from application.use_cases.detect_error_use_case import DetectErrorUseCase
from infrastructure.ai.openai_client import OpenAIClient
from infrastructure.cache.json_cache_callback import JsonCacheCallback

cache = JsonCacheCallback()
ai = OpenAIClient()

use_case = DetectErrorUseCase(
    cache_callback=cache,
    ai_client=ai
)

screen_text = """
Your session has expired.
Please log in again.
"""

result = use_case.execute(screen_text)
print(result.to_dict())
```
🌐 OpenAI Proxy (Instance-based)

Package KHÔNG dùng HTTP_PROXY / HTTPS_PROXY của OS.
Proxy được inject theo từng OpenAIClient instance.

HTTP / HTTPS Proxy
```python 
proxy = {
    "https": "http://127.0.0.1:8080"
}

ai = OpenAIClient(proxy=proxy)
```


SOCKS5 Proxy
```python 
proxy = {
    "socks": "socks5://127.0.0.1:1080"
}

ai = OpenAIClient(proxy=proxy)
```
---

## 🔌 Custom Cache Callback

Bạn có thể lưu cache ở **bất kỳ đâu** bằng cách implement callback.

```python
from domain.services.cache_callback import CacheSaveCallback

class CacheSaveCallback:
    def load(self, signature: str) -> dict | None:
        pass

    def save(self, signature: str, data: dict) -> None:
        pass
```

---

## ⚙️ Configuration API

```python
from config import AppConfig

AppConfig.openai_api_key
AppConfig.openai_model
AppConfig.cache_file
```

---

## 🔒 Security Notes

- Không hard-code API key
- Không commit `.env`
- Luôn dùng ENV variables

---

## 📄 License

MIT License
currency-history-mcp 0.1.0
A Model Context Protocol (MCP) server for fetching historical currency exchange rates using the Frankfurter API.
Requires Python: >=3.10
Keywords: currency, exchange-rates, frankfurter, history, mcp

# Currency History MCP

A Model Context Protocol (MCP) server that provides historical currency exchange rates and currency conversion.
Powered by the [Frankfurter API](https://api.frankfurter.app/), which is free and open-source.

## Features

- **Get Historical Rates**: Fetch exchange rates for a specific date (e.g., "2023-01-01").
- **Convert Currency**: Convert amounts between currencies using historical rates.

## Installation & Usage (with uv)

You can run this MCP server directly using `uv` without manually installing it everywhere:

```bash
# Run directly
uvx currency-history-mcp
```

Or install it as a tool:

```bash
uv tool install currency-history-mcp
```

## Manual Installation

```bash
pip install currency-history-mcp
```

## Running the Server

```bash
# If installed via pip
currency-history-mcp

# Or connect via an MCP client inspector
npx @modelcontextprotocol/inspector uvx currency-history-mcp
```

## Tools

1. `get_historical_rate`
   - `date`: YYYY-MM-DD
   - `base`: Base currency (default USD)
   - `symbols`: Target currencies (default CNY, EUR, JPY, GBP)

2. `convert_historical_amount`
   - `amount`: Amount to convert
   - `from_curr`: Source currency
   - `to_curr`: Target currency
   - `date`: YYYY-MM-DD