Metadata-Version: 2.4
Name: answerline-langchain
Version: 0.1.0
Summary: LangChain tools for the AnswerLine answer and search monitoring API.
Author-email: AnswerLine <support@answerline.dev>
License-Expression: MIT
Project-URL: Homepage, https://answerline.dev
Project-URL: Repository, https://github.com/hsdxpro/answerline
Keywords: answerline,ai,llm,langchain,search-api,monitoring
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: answerline<0.2,>=0.1.0
Requires-Dist: langchain-core<2,>=1.6.3
Requires-Dist: pydantic<3,>=2.13.5
Dynamic: license-file

# answerline-langchain

LangChain tools for the answer and search monitoring API, built on the Python SDK (`answerline`).

```bash
pip install answerline-langchain
```

`create_tools(client, engines=...)` returns one sync monitor tool per engine (`monitor_chatgpt`, `monitor_google_news`, ...), plus `create_async_task`, `get_task_status` and `get_credits`. `engines` lists the task types the deployment serves (its `served_engines`; the API refuses priced engines outside it) and defaults to every priced engine. An async task's `payload` is validated as the monitor request of its `taskType`. API errors, timeouts and connection errors come back to the model as the tool result.

```python
from answerline import Client
from answerline_langchain import create_tools

tools = create_tools(Client("sk_..."), engines=["CHATGPT"])
```

Tool input models in `src/answerline_langchain/schemas.py` are generated from `openapi/openapi.json` and the priced engines in `config/pricing.toml` by `integrations/codegen` (`npm run generate` there); do not edit them by hand.

## Develop

Until `answerline` is published, install the SDK from the repository:

```bash
python -m venv .venv && .venv/bin/pip install -e ../../sdk/python -e .
```

```bash
.venv/bin/python -m unittest discover -s tests
```

Tests run offline against a local stub server.
