parlant-datacircle 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,173 @@
1
+ """Parlant tools for Datacircle's open API (https://api.datacircle.dev/v1), no key: find the best GTM APIs.
2
+
3
+ TOOLS holds the four tools (Parlant ToolEntry objects made by @p.tool) for a policy's or a guideline's tools, beside an
4
+ app's own; attach(agent) adds them to an agent in one line. list_apis, best_plans, search_plans and provider give each
5
+ tool's output as dicts, for an app's own code.
6
+ """
7
+
8
+ import asyncio
9
+ import enum
10
+ import json
11
+ import os
12
+ from typing import Annotated, Any, Callable, Dict, Optional
13
+
14
+ import parlant.sdk as p
15
+
16
+ from parlant_datacircle._api import DatacircleError
17
+ from parlant_datacircle._plain import best_plans, list_apis, provider, search_plans
18
+
19
+ __version__ = "0.1.0"
20
+
21
+ __all__ = ["TOOLS", "NAMES", "attach", "Sort", "MAX_BYTES", "SESSION_BYTES", "DatacircleError", "datacircle_list_apis", "datacircle_best_plans",
22
+ "datacircle_search_plans", "datacircle_provider", "list_apis", "best_plans", "search_plans", "provider"]
23
+
24
+
25
+ class Sort(enum.Enum):
26
+ """How datacircle_search_plans sorts plans: score (best first), provider (A to Z) or price (lowest first)."""
27
+
28
+ score = "score"
29
+ provider = "provider"
30
+ price = "price"
31
+
32
+
33
+ # Parlant takes a tool's result up to PARLANT_TOOL_RESULT_MAX_PAYLOAD_KB (16 KB when unset) and warns past 2,000 tokens
34
+ # (8,000 bytes of plans are about 3,700): a result is cut to the lower of MAX_BYTES and three quarters of that limit,
35
+ # its list's first items kept.
36
+ MAX_BYTES = 4000
37
+ # A result past this many bytes is kept for the reply it was called for only (lifespan "response"), as Parlant 4 does
38
+ # itself past 1,000 tokens, with a warning: Parlant 3 would keep it in the session, and in every later turn's prompt.
39
+ SESSION_BYTES = 2000
40
+
41
+
42
+ def _size(data: Any) -> int:
43
+ return len(json.dumps(data, ensure_ascii=False).encode())
44
+
45
+
46
+ def _fit(data: Dict[str, Any], key: str, more: Callable[[Dict[str, Any], int], str]) -> Dict[str, Any]:
47
+ """data, or its list under key cut to the most first items that fit the budget, with shown (how many it keeps)
48
+ and more (how to get the rest) beside them."""
49
+ items = data.get(key)
50
+ try:
51
+ limit = int(os.environ.get("PARLANT_TOOL_RESULT_MAX_PAYLOAD_KB") or 16) * 1024 * 3 // 4
52
+ except ValueError:
53
+ limit = 12 * 1024
54
+ budget = min(MAX_BYTES, limit)
55
+ if not isinstance(items, list) or _size(data) <= budget:
56
+ return data
57
+
58
+ def cut(count: int) -> Dict[str, Any]:
59
+ return {**data, key: items[:count], "shown": count, "more": more(data, count)}
60
+
61
+ low, high = 1, len(items)
62
+ while low < high:
63
+ middle = (low + high + 1) // 2
64
+ low, high = (middle, high) if _size(cut(middle)) <= budget else (low, middle - 1)
65
+ return cut(low)
66
+
67
+
68
+ async def _result(call: Callable[..., Any], key: str, more: Callable[[Dict[str, Any], int], str], *args: Any) -> p.ToolResult:
69
+ """A plain function's answer as the tool's result, cut to fit, run off the event loop as its HTTPS call blocks;
70
+ the API's refusal or an argument it can't take as {"error": ...}, so the agent can tell the customer or call again."""
71
+ try:
72
+ data = _fit(await asyncio.to_thread(call, *args), key, more)
73
+ return p.ToolResult(data=data, control={"lifespan": "response"} if _size(data) > SESSION_BYTES else {})
74
+ except DatacircleError as error:
75
+ return p.ToolResult(data={"error": str(error)})
76
+
77
+
78
+ def _more_apis(data: Dict[str, Any], shown: int) -> str:
79
+ return f"Only the first {shown} of {data.get('total')} APIs fit here: give more words in query to narrow them."
80
+
81
+
82
+ def _more_best(data: Dict[str, Any], shown: int) -> str:
83
+ return (f"Only the best {shown} plans fit here: datacircle_search_plans with api '{data.get('slug')}' and offset "
84
+ f"{shown} gives the next ones.")
85
+
86
+
87
+ def _more_plans(data: Dict[str, Any], shown: int) -> str:
88
+ return (f"Only {shown} of the {data.get('total')} plans found fit here: call again with offset "
89
+ f"{int(data.get('offset') or 0) + shown} for the next ones.")
90
+
91
+
92
+ def _more_provider(data: Dict[str, Any], shown: int) -> str:
93
+ return (f"Only its {shown} best ranked APIs of {data.get('total')} fit here: datacircle_search_plans with query "
94
+ f"'{data.get('provider')}' lists its plans on every API.")
95
+
96
+
97
+ def _about(description: str, examples: Optional[list] = None) -> p.ToolParameterOptions:
98
+ return p.ToolParameterOptions(description=description, examples=examples or [])
99
+
100
+
101
+ @p.tool
102
+ async def datacircle_list_apis(
103
+ context: p.ToolContext,
104
+ query: Annotated[Optional[str], _about("Words of the API's name or slug: the APIs that hold the most of them come "
105
+ "first. Every API when left out.", ["email finder", "linkedin profile"])] = None,
106
+ limit: Annotated[Optional[int], _about("How many APIs to give, 1 to 200. 20 when left out.")] = None,
107
+ ) -> p.ToolResult:
108
+ """Lists the GTM APIs on Datacircle's sheet (https://datacircle.dev), with each API's slug, how many plans and
109
+ providers it has and its best plan. Use it first to find an API's slug. Gives total, the APIs found, and apis, up to
110
+ limit of them. A long answer keeps its first items, and shown and more say how to get the rest."""
111
+ return await _result(list_apis, "apis", _more_apis, query, limit)
112
+
113
+
114
+ @p.tool
115
+ async def datacircle_best_plans(
116
+ context: p.ToolContext,
117
+ slug: Annotated[str, _about("The API's slug. The list of APIs gives every slug.", ["email-finder", "linkedin-profile"])],
118
+ limit: Annotated[Optional[int], _about("How many plans to give, 1 to 50. 10 when left out.")] = None,
119
+ ) -> p.ToolResult:
120
+ """Gives an API's plans best first by their score out of 100 on Datacircle's benchmark (https://datacircle.dev),
121
+ each with its rank, provider, plan, $ per 1,000 calls and its page: the best providers of an API. perThousand is a
122
+ plan's price of 1,000 calls in dollars. A long answer keeps its first items, and shown and more say how to get the
123
+ rest."""
124
+ return await _result(best_plans, "plans", _more_best, slug, limit)
125
+
126
+
127
+ @p.tool
128
+ async def datacircle_search_plans(
129
+ context: p.ToolContext,
130
+ api: Annotated[Optional[str], _about("Only this API's plans: its name or slug. A provider's name goes in query, never "
131
+ "here. Every API when left out.", ["email-finder"])] = None,
132
+ query: Annotated[Optional[str], _about("Words that must all appear in the provider's or plan's name.",
133
+ ["bright data"])] = None,
134
+ sort: Annotated[Optional[Sort], _about("score (best first, the default), provider (A to Z) or price ($ per 1,000, "
135
+ "lowest first).")] = None,
136
+ limit: Annotated[Optional[int], _about("How many plans to give, 1 to 50. 10 when left out.")] = None,
137
+ offset: Annotated[Optional[int], _about("How many found plans to skip first. 0 when left out.")] = None,
138
+ ) -> p.ToolResult:
139
+ """Searches every plan on Datacircle's sheet (https://datacircle.dev), or one API's, by provider or plan name,
140
+ sorted by score, provider or price. Gives total, offset and up to limit plans. perThousand is a plan's price of
141
+ 1,000 calls in dollars. A long answer keeps its first items, and shown and more say how to get the rest."""
142
+ return await _result(search_plans, "plans", _more_plans, api, query, sort, limit, offset)
143
+
144
+
145
+ @p.tool
146
+ async def datacircle_provider(
147
+ context: p.ToolContext,
148
+ slug: Annotated[str, _about("The provider's slug or its name: a name is made a slug.", ["bright-data", "Bright Data"])],
149
+ ) -> p.ToolResult:
150
+ """Gives each API one provider sells, its best rank first, with its rank on each on Datacircle's benchmark
151
+ (https://datacircle.dev) and its best plan there. A long answer keeps its first items, and shown and more say how
152
+ to get the rest."""
153
+ return await _result(provider, "apis", _more_provider, slug)
154
+
155
+
156
+ TOOLS = [datacircle_list_apis, datacircle_best_plans, datacircle_search_plans, datacircle_provider]
157
+ NAMES = [entry.tool.name for entry in TOOLS]
158
+
159
+ _TITLE = "Choosing a GTM API"
160
+ _CONDITION = "The customer asks which API to use for sales or marketing data, what an API costs, or about an API provider"
161
+ _ACTION = ("Look it up with the Datacircle tools and answer from their results: the best plans of an API, its price "
162
+ "per 1,000 calls and the plan's page on datacircle.dev")
163
+
164
+
165
+ async def attach(agent: Any, tools: Optional[list] = None) -> Any:
166
+ """Adds the tools to a Parlant agent: a policy on Parlant 4, a guideline on Parlant 3, that brings them in when the
167
+ customer asks which API to use for sales or marketing data, what one costs, or about a provider. tools: the ones
168
+ to add, all four when left out. Gives the policy or the guideline made."""
169
+ chosen = list(tools if tools is not None else TOOLS)
170
+ if hasattr(agent, "create_policy"):
171
+ return await agent.create_policy(title=_TITLE, content=f"When {_CONDITION[0].lower()}{_CONDITION[1:]}: "
172
+ f"{_ACTION[0].lower()}{_ACTION[1:]}.", tools=chosen)
173
+ return await agent.create_guideline(condition=_CONDITION, action=_ACTION, tools=chosen)
@@ -0,0 +1,102 @@
1
+ """One HTTPS GET to Datacircle's open API (https://api.datacircle.dev/v1), no key, and what its answers are cut to for a model."""
2
+
3
+ import json
4
+ import math
5
+ import re
6
+ import time
7
+ import unicodedata
8
+ import urllib.error
9
+ import urllib.parse
10
+ import urllib.request
11
+ from typing import Any, Dict, List, Optional
12
+
13
+ BASE_URL = "https://api.datacircle.dev/v1"
14
+ TIMEOUT = 30.0
15
+ USER_AGENT = "parlant-datacircle/0.1.0"
16
+
17
+ # A plan holds about 90 keys (its terms of use, its aggregators...): the tools keep the ones that choose a plan, the rest is on its page.
18
+ # Parlant keeps tool results small (16 KB at most by default): its pricing page and docs are on the plan's page.
19
+ PLAN_KEYS = ["api", "rank", "provider", "plan", "score", "perThousand", "notFoundPerThousand", "billing", "pay",
20
+ "currency", "units", "unit", "strengths", "latencyMs", "page"]
21
+ API_KEYS = ["api", "slug", "plans", "providers", "best", "bestPage", "sheetPage"]
22
+
23
+
24
+ class DatacircleError(Exception):
25
+ """The API's refusal in its own words, why it could not be reached, or an argument it can't take: each tool gives
26
+ the model its words as the call's result, {"error": ...}. status is the API's HTTP status, None when
27
+ it gave none; retryable, whether the same call may be answered later (the API out of reach, busy or failing)."""
28
+
29
+ def __init__(self, message: str, status: Optional[int] = None, retryable: bool = False):
30
+ super().__init__(message)
31
+ self.status = status
32
+ self.retryable = retryable
33
+
34
+
35
+ def brief(item: Dict[str, Any], keys: List[str] = PLAN_KEYS) -> Dict[str, Any]:
36
+ return {key: item[key] for key in keys if item.get(key) is not None and item.get(key) != []}
37
+
38
+
39
+ def slug(value: Any) -> str:
40
+ """The API's rule for a slug: the name in lowercase letters and digits, the rest a hyphen."""
41
+ plain = unicodedata.normalize("NFKD", str(value or "").strip().lower())
42
+ plain = "".join(char for char in plain if not unicodedata.combining(char))
43
+ return re.sub(r"[^a-z0-9]+", "-", plain).strip("-")
44
+
45
+
46
+ def whole(name: str, value: Any, low: int, high: Optional[int] = None) -> Optional[int]:
47
+ """A whole number from low to high, or None when left out: a plain call may send one as text."""
48
+ if value is None or value == "":
49
+ return None
50
+ try:
51
+ number = float(value)
52
+ except (TypeError, ValueError):
53
+ number = float("nan")
54
+ if isinstance(value, bool) or not math.isfinite(number) or number != int(number):
55
+ raise DatacircleError(f"{name} must be a whole number, not {value!r}")
56
+ if number < low or (high is not None and number > high):
57
+ raise DatacircleError(f"{name} must be from {low} to {high}, not {int(number)}" if high is not None
58
+ else f"{name} must be {low} or more, not {int(number)}")
59
+ return int(number)
60
+
61
+
62
+ def _words(body: bytes) -> str:
63
+ """A refusal's words: the API's error, with every slug when the slug was unknown."""
64
+ text = body.decode("utf-8", "replace")
65
+ try:
66
+ parsed = json.loads(text)
67
+ if parsed.get("slugs"):
68
+ return f"{parsed['error']}; the slugs: {', '.join(parsed['slugs'])}"
69
+ return str(parsed.get("error", text))
70
+ except (ValueError, KeyError, TypeError, AttributeError):
71
+ return text
72
+
73
+
74
+ def get(path: str, params: Optional[Dict[str, Any]] = None) -> Any:
75
+ """The API's JSON answer, or a DatacircleError with its words: waits once when it answers 429."""
76
+ query = urllib.parse.urlencode({key: value for key, value in (params or {}).items() if value not in (None, "")})
77
+ url = f"{BASE_URL.rstrip('/')}{path}" + (f"?{query}" if query else "")
78
+ request = urllib.request.Request(url, headers={"Accept": "application/json", "User-Agent": USER_AGENT})
79
+ for attempt in range(2):
80
+ try:
81
+ with urllib.request.urlopen(request, timeout=TIMEOUT) as answer:
82
+ body = answer.read()
83
+ except urllib.error.HTTPError as error:
84
+ body = error.read()
85
+ if error.code == 429 and not attempt:
86
+ try:
87
+ wait = int(error.headers.get("Retry-After") or 30)
88
+ except ValueError:
89
+ wait = 30
90
+ time.sleep(min(max(wait, 1), 60))
91
+ continue
92
+ if error.code == 429:
93
+ raise DatacircleError("Datacircle's API answered 429 twice: wait a minute and call again", 429, True) from None
94
+ raise DatacircleError(f"Datacircle's API answered {error.code}: {_words(body)[:3000]}", error.code,
95
+ error.code >= 500) from None
96
+ except (urllib.error.URLError, OSError) as error:
97
+ raise DatacircleError(f"Datacircle's API could not be reached: {getattr(error, 'reason', error)}",
98
+ retryable=True) from None
99
+ try:
100
+ return json.loads(body)
101
+ except ValueError as error:
102
+ raise DatacircleError(f"Datacircle's API gave no JSON: {error}") from None
@@ -0,0 +1,70 @@
1
+ """The four calls of Datacircle's open API as plain functions giving dicts. The Parlant tools are made from these."""
2
+
3
+ import enum
4
+ import urllib.parse
5
+ from typing import Any, Dict, Optional
6
+
7
+ from parlant_datacircle import _api
8
+
9
+
10
+ def _best(plans: Any) -> Optional[Dict[str, Any]]:
11
+ """A provider's best plan on an API: its lowest rank, a plan with no score having none."""
12
+ ranked = sorted(plans, key=lambda plan: plan.get("rank") if isinstance(plan.get("rank"), (int, float)) else float("inf"))
13
+ return _api.brief(ranked[0], ["plan", "score", "perThousand", "page"]) if ranked else None
14
+
15
+
16
+ def _text(value: Any) -> Optional[str]:
17
+ """A text argument as the API takes it: an enum's value, a number made text, null left out."""
18
+ if isinstance(value, enum.Enum):
19
+ value = value.value
20
+ return None if value is None else str(value)
21
+
22
+
23
+ def list_apis(query: Optional[str] = None, limit: Optional[int] = None) -> Dict[str, Any]:
24
+ """Every API on the sheet, those whose name or slug holds the most words of query first: {"total", "apis"}."""
25
+ count = _api.whole("limit", limit, 1, 200) or 20
26
+ apis = _api.get("/apis")
27
+ words = [word for word in str(query or "").lower().replace("-", " ").split() if word]
28
+ held = []
29
+ for index, api in enumerate(apis):
30
+ name = f"{api.get('api', '')} {str(api.get('slug', '')).replace('-', ' ')}".lower()
31
+ matched = sum(word in name for word in words)
32
+ if matched or not words:
33
+ held.append((-matched, index, api))
34
+ found = [_api.brief(api, _api.API_KEYS) for _, _, api in sorted(held, key=lambda h: h[:2])]
35
+ return {"total": len(found), "apis": found[:count]}
36
+
37
+
38
+ def best_plans(slug: Optional[str] = None, limit: Optional[int] = None) -> Dict[str, Any]:
39
+ """One API's plans best first by score, each with its rank."""
40
+ made = _api.slug(slug)
41
+ if not made:
42
+ raise _api.DatacircleError("Give an API's slug, like 'email-finder'. The list of APIs gives every slug.")
43
+ answer = _api.get(f"/apis/{urllib.parse.quote(made)}/best", {"limit": _api.whole("limit", limit, 1, 50)})
44
+ return {**answer, "plans": [_api.brief(plan) for plan in answer.get("plans") or []]}
45
+
46
+
47
+ def search_plans(api: Optional[str] = None, query: Optional[str] = None, sort: Any = None,
48
+ limit: Optional[int] = None, offset: Optional[int] = None) -> Dict[str, Any]:
49
+ """Every plan, or one API's, or those whose provider or plan name holds every word of query: {"total", "offset", "plans"}."""
50
+ order = _text(sort)
51
+ order = order.strip().lower() if order not in (None, "") else None
52
+ if order is not None and order not in ("score", "provider", "price"):
53
+ raise _api.DatacircleError(f"sort must be score, provider or price, not {sort!r}")
54
+ params = {"api": _text(api), "query": _text(query), "sort": order, "limit": _api.whole("limit", limit, 1, 50),
55
+ "offset": _api.whole("offset", offset, 0)}
56
+ answer = _api.get("/plans", params)
57
+ return {**answer, "plans": [_api.brief(plan) for plan in answer.get("plans") or []]}
58
+
59
+
60
+ def provider(slug: Optional[str] = None) -> Dict[str, Any]:
61
+ """One provider's APIs, its best rank first, with its rank on each and its best plan there: {..., "total", "apis"}.
62
+ A name is made a slug."""
63
+ made = _api.slug(slug)
64
+ if not made:
65
+ raise _api.DatacircleError("Give a provider's slug or name, like 'bright-data' or 'Bright Data'")
66
+ answer = _api.get(f"/providers/{urllib.parse.quote(made)}")
67
+ apis = [{**_api.brief(entry, ["api", "slug", "rank", "bestPage"]), "plans": len(entry.get("plans") or []),
68
+ "best": _best(entry.get("plans") or [])} for entry in answer.get("apis") or []]
69
+ apis.sort(key=lambda entry: entry["rank"] if isinstance(entry.get("rank"), (int, float)) else float("inf"))
70
+ return {**answer, "total": len(apis), "apis": apis}
File without changes
@@ -0,0 +1,135 @@
1
+ Metadata-Version: 2.5
2
+ Name: parlant-datacircle
3
+ Version: 0.1.0
4
+ Summary: Parlant tools for the Datacircle API: find the best GTM APIs
5
+ Project-URL: Homepage, https://datacircle.dev
6
+ Project-URL: Documentation, https://api.datacircle.dev/v1/openapi.json
7
+ Project-URL: Repository, https://github.com/waynehamadi/parlant-datacircle
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Keywords: agents,api,api-pricing,b2b-data,customer-facing-agents,datacircle,gtm,guidelines,parlant,tools
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Topic :: Software Development :: Libraries
14
+ Requires-Python: >=3.10
15
+ Requires-Dist: parlant>=3.0.0
16
+ Description-Content-Type: text/markdown
17
+
18
+ # parlant-datacircle
19
+
20
+ Find the best GTM APIs. We benchmark all the GTM APIs and we put the results on our website.
21
+
22
+ Our website: https://datacircle.dev
23
+
24
+ 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.
25
+
26
+ | Tool | Gives | Call |
27
+ | --- | --- | --- |
28
+ | `datacircle_list_apis` | Every GTM API on Datacircle, with the API's slug, number of plans, number of providers and best plan | `GET /apis` |
29
+ | `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` |
30
+ | `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` |
31
+ | `datacircle_provider` | The APIs a provider sells, and the provider's rank on each API | `GET /providers/{slug}` |
32
+
33
+ ## Install
34
+
35
+ ```bash
36
+ pip install parlant-datacircle
37
+ ```
38
+
39
+ The package works with Parlant 4 and Parlant 3, on Python 3.10 or later.
40
+
41
+ ## Give the tools to an agent
42
+
43
+ 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.
44
+
45
+ ```python
46
+ import asyncio
47
+
48
+ import parlant.sdk as p
49
+ import parlant_datacircle
50
+
51
+
52
+ async def main():
53
+ async with p.Server() as server:
54
+ agent = await server.create_agent(
55
+ name="Gina",
56
+ instructions="You help sales teams choose a data API. Answer in a few lines.",
57
+ )
58
+ await parlant_datacircle.attach(agent)
59
+
60
+
61
+ asyncio.run(main())
62
+ ```
63
+
64
+ 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.
65
+
66
+ To write the policy yourself, list `parlant_datacircle.TOOLS` next to your own tools:
67
+
68
+ ```python
69
+ await agent.create_policy(
70
+ title="Data APIs",
71
+ content="When the customer asks about a data API, look it up with the Datacircle tools.",
72
+ tools=[*parlant_datacircle.TOOLS, check_budget],
73
+ )
74
+ ```
75
+
76
+ To give an agent only some of the tools, name them: `await parlant_datacircle.attach(agent, tools=[parlant_datacircle.datacircle_best_plans])`.
77
+
78
+ ## Parlant 3
79
+
80
+ On Parlant 3, `attach` adds one guideline for the Datacircle tools. Parlant 3 needs `description=` when you create the agent:
81
+
82
+ ```python
83
+ agent = await server.create_agent(name="Gina", description="You help sales teams choose a data API.")
84
+ await parlant_datacircle.attach(agent)
85
+ ```
86
+
87
+ To write the guideline yourself:
88
+
89
+ ```python
90
+ await agent.create_guideline(
91
+ condition="The customer asks about a data API",
92
+ action="Look up the answer with the Datacircle tools",
93
+ tools=parlant_datacircle.TOOLS,
94
+ )
95
+ ```
96
+
97
+ A new install of Parlant 3.0.0 also needs older fastmcp and pydantic packages:
98
+
99
+ ```bash
100
+ pip install parlant-datacircle "parlant==3.0.0" "fastmcp<2.12" "pydantic<2.12"
101
+ ```
102
+
103
+ ## Call a tool yourself
104
+
105
+ The functions `list_apis`, `best_plans`, `search_plans` and `provider` return each tool's output as Python dicts:
106
+
107
+ ```python
108
+ import parlant_datacircle
109
+
110
+ result = parlant_datacircle.best_plans("email-finder", limit=3)
111
+ print(result["plans"][0])
112
+ ```
113
+
114
+ ## Tool output for the model
115
+
116
+ 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.
117
+
118
+ 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.
119
+
120
+ You can give a provider's name in place of a slug. The tool turns `Bright Data` into `bright-data`.
121
+
122
+ 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.
123
+
124
+ ## Network
125
+
126
+ 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.
127
+
128
+ ## Links
129
+
130
+ - Datacircle: https://datacircle.dev
131
+ - The API: https://datacircle.dev/api
132
+ - The API's spec: https://api.datacircle.dev/v1/openapi.json
133
+ - The meaning of each key: https://datacircle.dev/fields
134
+
135
+ MIT license.
@@ -0,0 +1,8 @@
1
+ parlant_datacircle/__init__.py,sha256=IklTPsyFZKX1_aVptGmrbcylUrZ7FVklYWGYCtSGuW0,9157
2
+ parlant_datacircle/_api.py,sha256=5ZrJism1tTBX04ljDA582COJZAe9orH48jn3nj3dt3w,4989
3
+ parlant_datacircle/_plain.py,sha256=4VaAghzMF6NcRPGstjAMdJQqbgw-c6MUHdphHklSfg0,3857
4
+ parlant_datacircle/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ parlant_datacircle-0.1.0.dist-info/METADATA,sha256=mM0KsAMGlw9vYzog7EWxfFDNSivvtQ43HK6j1e4ma4U,5769
6
+ parlant_datacircle-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
7
+ parlant_datacircle-0.1.0.dist-info/licenses/LICENSE,sha256=dpgF7zGxeOd9IpQ9yUGa4a-cTj8fI6ulHnuilZEonCo,1067
8
+ parlant_datacircle-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Datacircle
4
+
5
+ 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:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ 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.