Metadata-Version: 2.5
Name: langchain-curt
Version: 0.1.0
Summary: LangChain chat loader for .curt conversation files (.curt v1 — open single-file AI conversation format)
Project-URL: Homepage, https://github.com/JordanNewell/langchain-curt
Project-URL: Repository, https://github.com/JordanNewell/langchain-curt
Project-URL: Documentation, https://github.com/JordanNewell/dot_curt
Author: Jordan Newell
License: MIT License
        
        Copyright (c) 2025-2026 Jordan Newell
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT 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: >=3.10
Requires-Dist: langchain-core<2.0,>=0.3
Description-Content-Type: text/markdown

# langchain-curt

[LangChain](https://github.com/langchain-ai/langchain) chat loader for
[`.curt`](https://github.com/JordanNewell/dot_curt) — the open (MIT),
single-file AI conversation format. One timestamped, attributed conversation
per file; unknown fields are data and survive round-trips.

```python
from langchain_curt import CurtChatLoader

loader = CurtChatLoader("./conversations/*.curt")
sessions = loader.lazy_load()   # one ChatSession per .curt file
```

- **Role mapping:** `user` → `HumanMessage`, `assistant` → `AIMessage`,
  `system` → `SystemMessage`. `tool` messages are skipped and counted
  (`loader.stats["tool_messages_skipped"]`) — `ToolMessage` requires a
  `tool_call_id` that `.curt` v1 does not carry.
- **Metadata:** per-message timestamps (epoch ms → ISO 8601 UTC), model, and
  all unknown/extension fields under `additional_kwargs["curt"]`;
  conversation-level metadata in `loader.conversation_metadata`.
- **Validation:** spec-compliant whole-file rejection (bad magic, wrong
  version, missing fields → rejected, never half-loaded). `on_error="skip"`
  imports valid files and reports invalid ones in `loader.errors`.
- **Dependencies:** `langchain-core` only. The `.curt` parser is stdlib-only.

Converters into `.curt` exist for Claude Code transcripts
([curt-convert](https://github.com/JordanNewell/curt-convert)), Open WebUI
exports ([curt-openwebui](https://github.com/JordanNewell/curt-openwebui)),
and the WildChat-1M research corpus
([curt-wildchat](https://github.com/JordanNewell/curt-wildchat)).

Spec: https://github.com/JordanNewell/dot_curt · npm reference impl:
[`curt-format`](https://www.npmjs.com/package/curt-format)

## Development

```sh
pip install -e . pytest
pytest
```

MIT License.
