langchain-apertis
Native LangChain integration for the
Apertis AI API. It uses the official apertis SDK directly and
does not depend on langchain-openai.
Installation
pip install -U langchain-apertis
export APERTIS_API_KEY="..."
Chat completions
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"].
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"])
Both current SDK Web Search stream-status shapes are exposed before model text. When the
SDK supplies a status string, stream() and astream() retain it and set
response_metadata["apertis"]["web_search_status"] to "in_progress".
Multimodal and audio chat
ChatApertis forwards LangChain's OpenAI-shaped image, input-audio, and video content
parts directly to the official SDK. Model availability remains account- and
model-dependent; the integration preserves the request contract rather than claiming a
static catalog.
from langchain_core.messages import HumanMessage
vision = ChatApertis(model="gpt-5.5")
response = vision.invoke(
[
HumanMessage(
content=[
{"type": "text", "text": "Describe this image."},
{"type": "image_url", "image_url": {"url": "https://example.com/cat.png"}},
]
)
]
)
For audio-output requests, use the Apertis SDK-compatible modalities and audio
parameters. Returned audio data is retained in response.additional_kwargs["audio"];
Web Search URL citations are retained in
response.response_metadata["apertis"]["annotations"].
The current SDK's response_format and extra_body request fields are also direct
ChatApertis constructor parameters.
Development verification
The public package metadata resolves published apertis>=0.3.0 from PyPI.
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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_apertis-0.2.0.tar.gz.
File metadata
- Download URL: langchain_apertis-0.2.0.tar.gz
- Upload date:
- Size: 22.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6274fac14bb72720ec26a5241068ff1a88a17f973679c08056508a109abf7ac0
|
|
| MD5 |
215948728a4190f4a73273689161e470
|
|
| BLAKE2b-256 |
c8fcd6808caa3e558cf735e9b64b22975c1b14bd1336042cd30586519c24544b
|
Provenance
The following attestation bundles were made for langchain_apertis-0.2.0.tar.gz:
Publisher:
publish.yml on apertis-ai/langchain-apertis
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_apertis-0.2.0.tar.gz -
Subject digest:
6274fac14bb72720ec26a5241068ff1a88a17f973679c08056508a109abf7ac0 - Sigstore transparency entry: 2366306911
- Sigstore integration time:
-
Permalink:
apertis-ai/langchain-apertis@c9ed041d87887aab5327e86e5225ee37ab9b441a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/apertis-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c9ed041d87887aab5327e86e5225ee37ab9b441a -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file langchain_apertis-0.2.0-py3-none-any.whl.
File metadata
- Download URL: langchain_apertis-0.2.0-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf1747f937ff213e64902c3377a3d3ee567df4d5fa47ebff89bb48efc8edab52
|
|
| MD5 |
baf2251093a2f6a4c99a5138f1e88089
|
|
| BLAKE2b-256 |
3db8595a3877927b14aaf025be80620562ba9f9bb802c5fcb40e5f8cdc9f75ea
|
Provenance
The following attestation bundles were made for langchain_apertis-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on apertis-ai/langchain-apertis
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_apertis-0.2.0-py3-none-any.whl -
Subject digest:
bf1747f937ff213e64902c3377a3d3ee567df4d5fa47ebff89bb48efc8edab52 - Sigstore transparency entry: 2366307124
- Sigstore integration time:
-
Permalink:
apertis-ai/langchain-apertis@c9ed041d87887aab5327e86e5225ee37ab9b441a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/apertis-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c9ed041d87887aab5327e86e5225ee37ab9b441a -
Trigger Event:
workflow_dispatch
-
Statement type: