Metadata-Version: 2.4
Name: langchain-apertis
Version: 0.1.0
Summary: Native LangChain integration for the Apertis AI API
Project-URL: Homepage, https://apertis.ai
Project-URL: Documentation, https://docs.apertis.ai/api/sdks/langchain/
Project-URL: Repository, https://github.com/apertis-ai/langchain-apertis
Project-URL: Issues, https://github.com/apertis-ai/langchain-apertis/issues
Author: Apertis
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: apertis,chat,langchain,llm
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: <4.0,>=3.10
Requires-Dist: apertis<0.4.0,>=0.3.0
Requires-Dist: langchain-core<2.0.0,>=1.4.7
Provides-Extra: test
Requires-Dist: langchain-tests<2.0.0,>=1.1.9; extra == 'test'
Requires-Dist: pytest-asyncio<2.0.0,>=1.3.0; extra == 'test'
Requires-Dist: pytest<10.0.0,>=9.0.3; extra == 'test'
Description-Content-Type: text/markdown

# langchain-apertis

Native [LangChain](https://python.langchain.com/) integration for the
[Apertis AI API](https://apertis.ai). It uses the official `apertis` SDK directly and
does not depend on `langchain-openai`.

## Installation

```bash
pip install -U langchain-apertis
export APERTIS_API_KEY="..."
```

## Chat completions

```python
from langchain_apertis import ChatApertis

llm = ChatApertis(model="gpt-5.5", temperature=0)
print(llm.invoke("Explain what a native LangChain provider is.").text)
```

`bind_tools()` and `with_structured_output()` use Apertis' OpenAI-compatible tool
format. A current Web Search model keeps its exact `:web` model suffix and exposes
source records safely in `response_metadata["apertis"]["web_sources"]`.

```python
search = ChatApertis(
    model="gpt-5.5:web",
    web_results_count=5,
    web_content_length="medium",
)
response = search.invoke("What changed in this week's AI news?")
print(response.response_metadata["apertis"]["web_sources"])
```

## Development verification

The public package metadata resolves published `apertis>=0.3.0` from PyPI.

```bash
uv sync --group dev
uv run pytest -m "not integration"
uv build
docker build -t langchain-apertis-test -f Dockerfile.test .
docker run --rm --network none langchain-apertis-test
```

## Publishing

After `apertis>=0.3.0` is available on PyPI, configure PyPI Trusted Publishing for
`apertis-ai/langchain-apertis`, `.github/workflows/publish.yml`, and the `pypi`
environment. The manual **Publish to PyPI** workflow uploads only when dispatched with
the `publish` confirmation value.
