Metadata-Version: 2.4
Name: kyvvu-langchain
Version: 0.1.0
Summary: Kyvvu callback handlers for LangChain and LangGraph
Author-email: "Kyvvu B.V." <info@kyvvu.com>
License: Copyright 2026 Kyvvu B.V.
        
        Licensed under the Apache License, Version 2.0 (the "License");
        you may not use this file except in compliance with the License.
        You may obtain a copy of the License at
        
        http://www.apache.org/licenses/LICENSE-2.0
        
        Unless required by applicable law or agreed to in writing, software
        distributed under the License is distributed on an "AS IS" BASIS,
        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        See the License for the specific language governing permissions and
        limitations under the License.
        
        This license applies only to the contents of the kyvvu-sdk/ directory
        of the Kyvvu monorepo. Other directories in this monorepo are governed
        by their own LICENSE files.
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: kyvvu<0.24.0,>=0.23.0
Requires-Dist: langchain-core>=0.1.0
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: jsonschema<5,>=4.23; extra == "dev"
Requires-Dist: rfc3339-validator>=0.1.4; extra == "dev"
Requires-Dist: langgraph>=1.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: ruff>=0.16.9; extra == "dev"
Dynamic: license-file

# kyvvu-langchain

LangChain and LangGraph callback handlers for Kyvvu.

Releases use `LANGCHAIN_VERSION` in the repository's `VERSIONS` file and
`langchain-v*` tags. Changes are recorded in [CHANGELOG.md](CHANGELOG.md).

```sh
pip install kyvvu-langchain
```

```python
from kyvvu import Kyvvu
from kyvvu_langchain import KyvvuLangChainHandler, KyvvuLangGraphHandler

kv = Kyvvu(api_url="https://platform.kyvvu.com", api_key="...", agent_key="bot")
handler = KyvvuLangChainHandler(kv)
# Pass handler through config={"callbacks": [handler]} when invoking a chain.
```

Install `langgraph` separately to run LangGraph agents. The package includes
both handlers; `KyvvuLangGraphHandler` adds node metadata and interrupt support
when LangGraph is installed.

### Interrupts and resumed runs

An `interrupt()` is recorded as a `step.gate` with `output.decision == "deny"`
and `output.status == "interrupted"`. LangGraph then finishes the root run
normally, so the task closes with `task.end`.

**In 1.0 a resumed graph run (`Command(resume=...)`) is recorded as a new
task.** Linking an interrupted task to its resumption is planned. Until then,
the root `task.start` of each run carries the checkpointer's
`properties.langgraph.thread_id` (and `checkpoint_ns` when LangGraph supplies
one), which both runs share.
