Metadata-Version: 2.5
Name: langchain-floo
Version: 0.1.0
Summary: Load floo application deployment and hosting tools into a LangChain agent.
Project-URL: Documentation, https://getfloo.com/docs/guides/mcp#langchain
Project-URL: Repository, https://github.com/getfloo/floo-cli/tree/main/python/langchain-floo
Author: floo
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: langchain-core<2,>=1
Requires-Dist: langchain-mcp-adapters<0.4,>=0.3.2
Description-Content-Type: text/markdown

# langchain-floo

Give a Python LangChain agent tools to deploy apps on floo, check deploys and read runtime logs. The tools use the permissions of the floo API key supplied by the application.

Install from this repository:

```bash
python -m pip install 'langchain-floo @ git+https://github.com/getfloo/floo-cli.git#subdirectory=python/langchain-floo'
```

Set `FLOO_KEY` in your application environment. For a different floo environment, set `FLOO_API_URL` to its API base URL and use a key from that environment. To give an inventory assistant access to two read tools:

```python
import asyncio

from langchain_floo import load_floo_tools


async def main():
    tools = await load_floo_tools(tool_names=["list_orgs", "list_apps"])
    print([tool.name for tool in tools])


asyncio.run(main())
```

Pass the returned tools to LangChain's `create_agent`. Omit `tool_names` to load all tools exposed by floo to that credential. To supply the key from your application's secret store, pass `api_key` to `load_floo_tools`.

## Deploy a weekly sales dashboard

The [weekly sales example](https://github.com/getfloo/floo-cli/tree/main/python/langchain-floo/examples/weekly-sales) deploys a public dashboard with the same LangChain tools an agent receives. It saves one report per week in managed Postgres and refreshes it on Mondays at 09:00 UTC. The five sample rows total 33 units and 840 in revenue.

From a checkout of this repository, with the package installed and `FLOO_KEY` and `FLOO_ORG_ID` set, run:

```sh
python python/langchain-floo/examples/weekly-sales/deploy.py "sales-report-$(date +%s)"
```

The script creates a new dev app and prints its URL. Open the dashboard or append `/api/report` to read the stored snapshot, refresh count and timestamp. Hosting, Postgres and scheduled runs use your floo org’s credits. Delete the sample app after testing if you want to stop its resources.

[floo MCP guide](https://getfloo.com/docs/guides/mcp#langchain)
