Metadata-Version: 2.4
Name: univer-use
Version: 0.1.0
Summary: Univer Use: LangGraph-powered agent utilities and tools for Univer spreadsheets
Project-URL: Homepage, https://github.com/dream-num/univer-use
Project-URL: Repository, https://github.com/dream-num/univer-use
Project-URL: Issues, https://github.com/dream-num/univer-use/issues
Author: Univer Team
License: MIT License
        
        Copyright (c) 2025 Univer Team
        
        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
Keywords: agents,langchain,langgraph,mcp,spreadsheets,univer
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Requires-Python: <4.0,>=3.11
Requires-Dist: jinja2>=3.1.6
Requires-Dist: langchain-core>=0.3.76
Requires-Dist: langchain-mcp-adapters>=0.1.10
Requires-Dist: langchain-openai<0.4.0,>=0.3.33
Requires-Dist: langchain==0.3.27
Requires-Dist: langgraph==0.6.6
Requires-Dist: python-dotenv>=1.0.0
Description-Content-Type: text/markdown

Univer Use
==========

LangGraph-powered agent utilities and tools for Univer spreadsheets. This library provides a ready-to-use graph entrypoint and helper tools to build agents that operate against Univer via [Univer-MCP](https://github.com/dream-num/univer-mcp).

Features
- LangGraph graph entrypoint: `univer_use/graph.py:build_graph`
- Spreadsheet action agent with MCP tools
- Prompt templates packaged with the library

Install
- pip: `pip install univer-use`
- uv: `uv add univer-use`
- Poetry: `poetry add univer-use`

Requirements
- Python 3.11+
- Credentials via environment or `.env` (python-dotenv):
  - `OPENROUTER_API_KEY` – API key for your OpenRouter-compatible provider
  - `OPENROUTER_ENDPOINT` – Base URL for the provider endpoint
  - `UNIVER_API_KEY` – Univer API key (if required by your MCP setup)

Quickstart
Minimal example to compile and run the graph once:

```python
import asyncio
from univer_use import build_graph

async def main():
    graph = await build_graph()
    # Provide initial state. At minimum, include a conversation_id.
    state = {
        "messages": [],
        "conversation_id": "local-dev",
    }
    result = await graph.ainvoke(state)
    print(result)

asyncio.run(main())
```

Run Locally with LangGraph CLI
The repo includes a local dev config that uses the `build_graph` entrypoint:

```bash
langgraph dev --config examples/sheet_edit/langgraph.json --debug-port 5678 --allow-blocking
```

This uses the graph at `univer_use/graph.py:build_graph`. Set env vars in `.env` or your shell before running. See `examples/sheet_edit/.env` for an example.

Development
- Install dependencies: `uv sync`
- Run tests: `uv run pytest -q`

License
MIT. See `LICENSE`.
