Metadata-Version: 2.5
Name: parlant-datacircle
Version: 0.1.0
Summary: Parlant tools for the Datacircle API: find the best GTM APIs
Project-URL: Homepage, https://datacircle.dev
Project-URL: Documentation, https://api.datacircle.dev/v1/openapi.json
Project-URL: Repository, https://github.com/waynehamadi/parlant-datacircle
License-Expression: MIT
License-File: LICENSE
Keywords: agents,api,api-pricing,b2b-data,customer-facing-agents,datacircle,gtm,guidelines,parlant,tools
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Requires-Dist: parlant>=3.0.0
Description-Content-Type: text/markdown

# parlant-datacircle

Find the best GTM APIs. We benchmark all the GTM APIs and we put the results on our website.

Our website: https://datacircle.dev

This package gives [Parlant](https://github.com/emcie-co/parlant) agents four tools that call Datacircle's public API, https://api.datacircle.dev/v1. You need no key and no account.

| Tool | Gives | Call |
| --- | --- | --- |
| `datacircle_list_apis` | Every GTM API on Datacircle, with the API's slug, number of plans, number of providers and best plan | `GET /apis` |
| `datacircle_best_plans` | One API's plans, sorted by score out of 100, best first. Each plan comes with a rank and a price per 1,000 calls | `GET /apis/{slug}/best` |
| `datacircle_search_plans` | Plans that match a provider or plan name, on all APIs or on one API. You can sort them by score, provider or price | `GET /plans` |
| `datacircle_provider` | The APIs a provider sells, and the provider's rank on each API | `GET /providers/{slug}` |

## Install

```bash
pip install parlant-datacircle
```

The package works with Parlant 4 and Parlant 3, on Python 3.10 or later.

## Give the tools to an agent

On Parlant 4, `attach` adds one policy to the agent. The policy brings in the four tools for questions about data APIs. Customers can ask for the best API for sales or marketing data. Customers can also ask about API prices and providers.

```python
import asyncio

import parlant.sdk as p
import parlant_datacircle


async def main():
    async with p.Server() as server:
        agent = await server.create_agent(
            name="Gina",
            instructions="You help sales teams choose a data API. Answer in a few lines.",
        )
        await parlant_datacircle.attach(agent)


asyncio.run(main())
```

Ask the agent "Who is best for the email finder API?" The agent calls `datacircle_best_plans`. The answer lists the top plans with a score and a price for each plan.

To write the policy yourself, list `parlant_datacircle.TOOLS` next to your own tools:

```python
await agent.create_policy(
    title="Data APIs",
    content="When the customer asks about a data API, look it up with the Datacircle tools.",
    tools=[*parlant_datacircle.TOOLS, check_budget],
)
```

To give an agent only some of the tools, name them: `await parlant_datacircle.attach(agent, tools=[parlant_datacircle.datacircle_best_plans])`.

## Parlant 3

On Parlant 3, `attach` adds one guideline for the Datacircle tools. Parlant 3 needs `description=` when you create the agent:

```python
agent = await server.create_agent(name="Gina", description="You help sales teams choose a data API.")
await parlant_datacircle.attach(agent)
```

To write the guideline yourself:

```python
await agent.create_guideline(
    condition="The customer asks about a data API",
    action="Look up the answer with the Datacircle tools",
    tools=parlant_datacircle.TOOLS,
)
```

A new install of Parlant 3.0.0 also needs older fastmcp and pydantic packages:

```bash
pip install parlant-datacircle "parlant==3.0.0" "fastmcp<2.12" "pydantic<2.12"
```

## Call a tool yourself

The functions `list_apis`, `best_plans`, `search_plans` and `provider` return each tool's output as Python dicts:

```python
import parlant_datacircle

result = parlant_datacircle.best_plans("email-finder", limit=3)
print(result["plans"][0])
```

## Tool output for the model

Each result is our API's answer. Each plan comes with a rank, provider, plan, score, price per 1,000 calls (`perThousand`, in dollars) and a page on datacircle.dev. That page lists every field.

Parlant refuses a tool result over 16 KB and warns about long results. Each tool keeps the first items of a long list, up to 4,000 bytes. A cut result gives the number of items kept (`shown`) and a way to get the rest (`more`). For a `PARLANT_TOOL_RESULT_MAX_PAYLOAD_KB` setting below 6, the tools cut results to three quarters of that setting. The tools keep a result over 2,000 bytes for one reply only (`lifespan` set to `response`). A result for one reply keeps the session short.

You can give a provider's name in place of a slug. The tool turns `Bright Data` into `bright-data`.

For an unknown slug, the model gets `{"error": ...}` with a list of every valid slug. The model can then pick a valid slug and call the tool again. The tool checks each value from the model before the API call. For a number out of range, the tool makes no API call. The model gets `{"error": ...}` instead.

## Network

Each tool call makes one HTTPS GET request to https://api.datacircle.dev/v1 and no other network calls. The request holds only the tool's input. The API takes up to 60 calls a minute from one IP address. If the API says to wait, the tool waits up to a minute. The tool waits at most once per call. All plans are in one file at https://datacircle.dev/datacircle.json.

## Links

- Datacircle: https://datacircle.dev
- The API: https://datacircle.dev/api
- The API's spec: https://api.datacircle.dev/v1/openapi.json
- The meaning of each key: https://datacircle.dev/fields

MIT license.
