Metadata-Version: 2.4
Name: aops
Version: 0.2.0
Summary: LangChain integration library for AOps
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic>=2.0
Requires-Dist: langchain-core>=0.3
Requires-Dist: python-dotenv>=1.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Requires-Dist: respx>=0.21; extra == "dev"
Dynamic: license-file

# aops

LangChain integration library for [AOps](https://github.com/cow-coding/aops) — load and version-control your agent prompts from the AOps backend.

## Installation

```bash
pip install aops
```

## Quick Start

```python
import aops
from aops.langchain import pull
from langchain_core.prompts import ChatPromptTemplate, HumanMessagePromptTemplate
from langchain_core.output_parsers import StrOutputParser
from langchain_openai import ChatOpenAI

aops.init(api_key="aops_...")

prompt = pull("my-agent/my-chain")

chain = (
    ChatPromptTemplate.from_messages([
        prompt,
        HumanMessagePromptTemplate.from_template("{user_input}"),
    ])
    | ChatOpenAI(model="gpt-4o-mini")
    | StrOutputParser()
)

result = chain.invoke({"user_input": "Hello!"})
```

## Requirements

- Python 3.12+
- AOps backend running (self-hosted)
- API key issued from the AOps UI: **Agent detail page → API Keys → New API Key**

## Docs

- [Configuration](docs/configuration.md) — API key, `aops.init()`, environment variables
- [API Reference](docs/api.md) — `pull()`, `@chain_prompt` function & class decorators
- [Live Updates](docs/live-updates.md) — polling, pattern selection guide

## License

MIT
