langchain-helve 0.1.0__tar.gz

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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 NG Tech LLC (Helve)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,83 @@
1
+ Metadata-Version: 2.4
2
+ Name: langchain-helve
3
+ Version: 0.1.0
4
+ Summary: LangChain toolkit for Helve — pay-per-call AI tool gateway (313 tools, 255 providers) with spend_limit_usd caps and zero-cost failed-call escrow.
5
+ Author-email: Helve <daniel.foster@helve.dev>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://helve.dev
8
+ Project-URL: Documentation, https://docs.helve.dev
9
+ Project-URL: llms.txt, https://helve.dev/llms.txt
10
+ Project-URL: Repository, https://github.com/helve-dev/helve-mcp
11
+ Keywords: langchain,langgraph,helve,ai-agents,tools,mcp,api-gateway
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Requires-Python: >=3.9
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: langchain-core>=0.3.0
24
+ Requires-Dist: httpx>=0.27.0
25
+ Requires-Dist: pydantic>=2.0.0
26
+ Dynamic: license-file
27
+
28
+ # langchain-helve
29
+
30
+ LangChain and LangGraph toolkit for [Helve](https://helve.dev) — one API key and one prepaid balance for 313 tools across 255 providers (web search, crawling/extraction, LLMs, audio transcription, PDFs, email, browser automation, finance, and free public utilities).
31
+
32
+ - **No monthly subscriptions:** start with prepaid credit packs (10 / 25 / 100 USD, never expire).
33
+ - **Deterministic spend caps:** per-key `spend_limit_usd` enforcement (`402 spend_limit_exceeded`).
34
+ - **Failed-call escrow:** upstream 5xx errors and timeouts automatically refund to 0 USD.
35
+ - **Free tool discovery:** `helve_search_tools` works without authentication so agents can discover `tool_id`, `input_schema`, and pricing before calling.
36
+
37
+ ## Installation
38
+
39
+ ```bash
40
+ pip install langchain-helve
41
+ ```
42
+
43
+ ## Quickstart
44
+
45
+ ```python
46
+ import os
47
+ from langchain_helve import HelveToolkit
48
+
49
+ toolkit = HelveToolkit(api_key=os.environ.get("HELVE_API_KEY"))
50
+ tools = toolkit.get_tools()
51
+ # [HelveSearchTools, HelveCallTool, HelveRequestTool]
52
+
53
+ # 1. Discover tools dynamically (no auth required)
54
+ search_tool = tools[0]
55
+ print(search_tool.invoke({"query": "web extraction", "limit": 3}))
56
+
57
+ # 2. Bind to any LangChain / LangGraph agent
58
+ # agent = create_react_agent(model, tools)
59
+ ```
60
+
61
+ ## Direct Client Usage
62
+
63
+ ```python
64
+ from langchain_helve import HelveGatewayClient
65
+
66
+ client = HelveGatewayClient(api_key="sk_live_...")
67
+
68
+ # Search available tools
69
+ matches = client.search_tools("web extraction", limit=5)
70
+
71
+ # Execute any discovered tool_id with its native arguments
72
+ result = client.call_tool(
73
+ "helve.web_extract",
74
+ {"urls": ["https://docs.helve.dev"], "content": {"max_chars": 4000}},
75
+ )
76
+ ```
77
+
78
+ ## Links
79
+
80
+ - Website: https://helve.dev
81
+ - Documentation: https://docs.helve.dev
82
+ - MCP Server & Skills: https://github.com/helve-dev/helve-mcp
83
+ - OpenAPI 3.1 Spec: https://helve.dev/openapi.json
@@ -0,0 +1,56 @@
1
+ # langchain-helve
2
+
3
+ LangChain and LangGraph toolkit for [Helve](https://helve.dev) — one API key and one prepaid balance for 313 tools across 255 providers (web search, crawling/extraction, LLMs, audio transcription, PDFs, email, browser automation, finance, and free public utilities).
4
+
5
+ - **No monthly subscriptions:** start with prepaid credit packs (10 / 25 / 100 USD, never expire).
6
+ - **Deterministic spend caps:** per-key `spend_limit_usd` enforcement (`402 spend_limit_exceeded`).
7
+ - **Failed-call escrow:** upstream 5xx errors and timeouts automatically refund to 0 USD.
8
+ - **Free tool discovery:** `helve_search_tools` works without authentication so agents can discover `tool_id`, `input_schema`, and pricing before calling.
9
+
10
+ ## Installation
11
+
12
+ ```bash
13
+ pip install langchain-helve
14
+ ```
15
+
16
+ ## Quickstart
17
+
18
+ ```python
19
+ import os
20
+ from langchain_helve import HelveToolkit
21
+
22
+ toolkit = HelveToolkit(api_key=os.environ.get("HELVE_API_KEY"))
23
+ tools = toolkit.get_tools()
24
+ # [HelveSearchTools, HelveCallTool, HelveRequestTool]
25
+
26
+ # 1. Discover tools dynamically (no auth required)
27
+ search_tool = tools[0]
28
+ print(search_tool.invoke({"query": "web extraction", "limit": 3}))
29
+
30
+ # 2. Bind to any LangChain / LangGraph agent
31
+ # agent = create_react_agent(model, tools)
32
+ ```
33
+
34
+ ## Direct Client Usage
35
+
36
+ ```python
37
+ from langchain_helve import HelveGatewayClient
38
+
39
+ client = HelveGatewayClient(api_key="sk_live_...")
40
+
41
+ # Search available tools
42
+ matches = client.search_tools("web extraction", limit=5)
43
+
44
+ # Execute any discovered tool_id with its native arguments
45
+ result = client.call_tool(
46
+ "helve.web_extract",
47
+ {"urls": ["https://docs.helve.dev"], "content": {"max_chars": 4000}},
48
+ )
49
+ ```
50
+
51
+ ## Links
52
+
53
+ - Website: https://helve.dev
54
+ - Documentation: https://docs.helve.dev
55
+ - MCP Server & Skills: https://github.com/helve-dev/helve-mcp
56
+ - OpenAPI 3.1 Spec: https://helve.dev/openapi.json
@@ -0,0 +1,15 @@
1
+ from .tools import (
2
+ HelveGatewayClient,
3
+ HelveSearchTools,
4
+ HelveCallTool,
5
+ HelveRequestTool,
6
+ HelveToolkit,
7
+ )
8
+
9
+ __all__ = [
10
+ "HelveGatewayClient",
11
+ "HelveSearchTools",
12
+ "HelveCallTool",
13
+ "HelveRequestTool",
14
+ "HelveToolkit",
15
+ ]
@@ -0,0 +1,188 @@
1
+ from __future__ import annotations
2
+
3
+ import json
4
+ import os
5
+ from typing import Any, Callable, Dict, List, Optional, Type
6
+
7
+ try:
8
+ from langchain_core.tools import BaseTool, BaseToolkit
9
+ except ImportError:
10
+ class BaseTool: # type: ignore
11
+ name: str = ""
12
+ description: str = ""
13
+ def __init__(self, **kwargs: Any) -> None:
14
+ for k, v in kwargs.items():
15
+ setattr(self, k, v)
16
+ def invoke(self, input_data: Dict[str, Any]) -> Any:
17
+ return self._run(**input_data)
18
+
19
+ class BaseToolkit: # type: ignore
20
+ def __init__(self, **kwargs: Any) -> None:
21
+ for k, v in kwargs.items():
22
+ setattr(self, k, v)
23
+
24
+ try:
25
+ from pydantic import BaseModel, ConfigDict, Field
26
+ except ImportError:
27
+ class BaseModel: # type: ignore
28
+ pass
29
+ def ConfigDict(**kwargs: Any) -> Dict[str, Any]: # type: ignore
30
+ return kwargs
31
+ def Field(*args: Any, **kwargs: Any) -> Any: # type: ignore
32
+ return None
33
+
34
+
35
+ class HelveGatewayClient:
36
+ """HTTP client targeting Helve v2 gateway endpoints (/v1/tools, /search, /call, /request)."""
37
+
38
+ def __init__(
39
+ self,
40
+ api_key: Optional[str] = None,
41
+ base_url: str = "https://helve.dev",
42
+ transport: Optional[Callable[[str, str, Optional[Dict[str, Any]], Dict[str, str]], Dict[str, Any]]] = None,
43
+ ) -> None:
44
+ self.api_key = api_key or os.environ.get("HELVE_API_KEY", "")
45
+ self.base_url = base_url.rstrip("/")
46
+ self._transport = transport
47
+
48
+ def _request(self, method: str, path: str, payload: Optional[Dict[str, Any]] = None, require_auth: bool = True) -> Dict[str, Any]:
49
+ if require_auth and not self.api_key:
50
+ raise ValueError("Helve API key is required (pass api_key or set HELVE_API_KEY).")
51
+ headers = {"Content-Type": "application/json"}
52
+ if self.api_key:
53
+ headers["Authorization"] = f"Bearer {self.api_key}"
54
+ url = f"{self.base_url}{path}"
55
+ if self._transport is not None:
56
+ return self._transport(method, url, payload, headers)
57
+ import httpx
58
+ with httpx.Client(timeout=60.0) as client:
59
+ resp = client.request(method, url, json=payload, headers=headers)
60
+ resp.raise_for_status()
61
+ return resp.json()
62
+
63
+ def list_tools(self, category: Optional[str] = None, include_unavailable: bool = False) -> Dict[str, Any]:
64
+ params = []
65
+ if category:
66
+ params.append(f"category={category}")
67
+ if include_unavailable:
68
+ params.append("include_unavailable=true")
69
+ suffix = f"?{'&'.join(params)}" if params else ""
70
+ return self._request("GET", f"/v1/tools{suffix}", require_auth=False)
71
+
72
+ def search_tools(self, query: str, category: Optional[str] = None, limit: int = 10, include_unavailable: bool = False) -> Dict[str, Any]:
73
+ body: Dict[str, Any] = {"query": query, "limit": limit}
74
+ if category is not None:
75
+ body["category"] = category
76
+ if include_unavailable:
77
+ body["include_unavailable"] = True
78
+ return self._request("POST", "/v1/tools/search", body, require_auth=False)
79
+
80
+ def call_tool(self, tool_id: str, arguments: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
81
+ body: Dict[str, Any] = {"tool_id": tool_id, "arguments": arguments or {}}
82
+ return self._request("POST", "/v1/tools/call", body, require_auth=True)
83
+
84
+ def request_tool(
85
+ self,
86
+ tool_name: str,
87
+ use_case: str,
88
+ provider: Optional[str] = None,
89
+ category: Optional[str] = None,
90
+ docs_url: Optional[str] = None,
91
+ ) -> Dict[str, Any]:
92
+ body: Dict[str, Any] = {"tool_name": tool_name, "use_case": use_case}
93
+ if provider is not None:
94
+ body["provider"] = provider
95
+ if category is not None:
96
+ body["category"] = category
97
+ if docs_url is not None:
98
+ body["docs_url"] = docs_url
99
+ return self._request("POST", "/v1/tools/request", body, require_auth=False)
100
+
101
+
102
+ class _SearchToolsInput(BaseModel):
103
+ query: str = Field(..., description="Capability, API, or task description to search on Helve.")
104
+ category: Optional[str] = Field(default=None, description="Optional category filter.")
105
+ limit: int = Field(default=10, description="Maximum number of matching tools to return (1-30).")
106
+
107
+
108
+ class _CallToolInput(BaseModel):
109
+ tool_id: str = Field(..., description="Exact tool_id returned by helve_search_tools.")
110
+ arguments: Dict[str, Any] = Field(default_factory=dict, description="Native JSON arguments for the tool.")
111
+
112
+
113
+ class _RequestToolInput(BaseModel):
114
+ tool_name: str = Field(..., description="Missing API or tool name.")
115
+ use_case: str = Field(..., description="Concrete description of what the agent needs to accomplish.")
116
+ provider: Optional[str] = Field(default=None, description="Optional upstream provider name.")
117
+ category: Optional[str] = Field(default=None, description="Optional tool category.")
118
+ docs_url: Optional[str] = Field(default=None, description="Optional link to provider API docs.")
119
+
120
+
121
+ class HelveSearchTools(BaseTool):
122
+ model_config = ConfigDict(arbitrary_types_allowed=True)
123
+ name: str = "helve_search_tools"
124
+ description: str = (
125
+ "Search Helve's pay-per-call AI tool gateway for available third-party APIs and free public utilities, "
126
+ "returning tool_id, native input_schema, example, and pricing_hint."
127
+ )
128
+ args_schema: Type[BaseModel] = _SearchToolsInput
129
+ client: Any = None
130
+
131
+ def _run(self, query: str, category: Optional[str] = None, limit: int = 10) -> str:
132
+ return json.dumps(self.client.search_tools(query=query, category=category, limit=limit))
133
+
134
+
135
+ class HelveCallTool(BaseTool):
136
+ model_config = ConfigDict(arbitrary_types_allowed=True)
137
+ name: str = "helve_call_tool"
138
+ description: str = (
139
+ "Execute any tool_id discovered via helve_search_tools on Helve's metered gateway. "
140
+ "Upstream cost + 15% Helve fee; zero charge on free public tools and failed upstream calls."
141
+ )
142
+ args_schema: Type[BaseModel] = _CallToolInput
143
+ client: Any = None
144
+
145
+ def _run(self, tool_id: str, arguments: Optional[Dict[str, Any]] = None) -> str:
146
+ return json.dumps(self.client.call_tool(tool_id=tool_id, arguments=arguments or {}))
147
+
148
+
149
+ class HelveRequestTool(BaseTool):
150
+ model_config = ConfigDict(arbitrary_types_allowed=True)
151
+ name: str = "helve_request_tool"
152
+ description: str = "Log a missing API or capability on Helve when helve_search_tools returns no match."
153
+ args_schema: Type[BaseModel] = _RequestToolInput
154
+ client: Any = None
155
+
156
+ def _run(
157
+ self,
158
+ tool_name: str,
159
+ use_case: str,
160
+ provider: Optional[str] = None,
161
+ category: Optional[str] = None,
162
+ docs_url: Optional[str] = None,
163
+ ) -> str:
164
+ return json.dumps(
165
+ self.client.request_tool(
166
+ tool_name=tool_name,
167
+ use_case=use_case,
168
+ provider=provider,
169
+ category=category,
170
+ docs_url=docs_url,
171
+ )
172
+ )
173
+
174
+
175
+ class HelveToolkit(BaseToolkit):
176
+ model_config = ConfigDict(arbitrary_types_allowed=True)
177
+ client: HelveGatewayClient
178
+
179
+ def __init__(self, api_key: Optional[str] = None, base_url: str = "https://helve.dev", client: Optional[HelveGatewayClient] = None) -> None:
180
+ resolved_client = client or HelveGatewayClient(api_key=api_key, base_url=base_url)
181
+ super().__init__(client=resolved_client)
182
+
183
+ def get_tools(self) -> List[BaseTool]:
184
+ return [
185
+ HelveSearchTools(client=self.client),
186
+ HelveCallTool(client=self.client),
187
+ HelveRequestTool(client=self.client),
188
+ ]
@@ -0,0 +1,83 @@
1
+ Metadata-Version: 2.4
2
+ Name: langchain-helve
3
+ Version: 0.1.0
4
+ Summary: LangChain toolkit for Helve — pay-per-call AI tool gateway (313 tools, 255 providers) with spend_limit_usd caps and zero-cost failed-call escrow.
5
+ Author-email: Helve <daniel.foster@helve.dev>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://helve.dev
8
+ Project-URL: Documentation, https://docs.helve.dev
9
+ Project-URL: llms.txt, https://helve.dev/llms.txt
10
+ Project-URL: Repository, https://github.com/helve-dev/helve-mcp
11
+ Keywords: langchain,langgraph,helve,ai-agents,tools,mcp,api-gateway
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Requires-Python: >=3.9
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: langchain-core>=0.3.0
24
+ Requires-Dist: httpx>=0.27.0
25
+ Requires-Dist: pydantic>=2.0.0
26
+ Dynamic: license-file
27
+
28
+ # langchain-helve
29
+
30
+ LangChain and LangGraph toolkit for [Helve](https://helve.dev) — one API key and one prepaid balance for 313 tools across 255 providers (web search, crawling/extraction, LLMs, audio transcription, PDFs, email, browser automation, finance, and free public utilities).
31
+
32
+ - **No monthly subscriptions:** start with prepaid credit packs (10 / 25 / 100 USD, never expire).
33
+ - **Deterministic spend caps:** per-key `spend_limit_usd` enforcement (`402 spend_limit_exceeded`).
34
+ - **Failed-call escrow:** upstream 5xx errors and timeouts automatically refund to 0 USD.
35
+ - **Free tool discovery:** `helve_search_tools` works without authentication so agents can discover `tool_id`, `input_schema`, and pricing before calling.
36
+
37
+ ## Installation
38
+
39
+ ```bash
40
+ pip install langchain-helve
41
+ ```
42
+
43
+ ## Quickstart
44
+
45
+ ```python
46
+ import os
47
+ from langchain_helve import HelveToolkit
48
+
49
+ toolkit = HelveToolkit(api_key=os.environ.get("HELVE_API_KEY"))
50
+ tools = toolkit.get_tools()
51
+ # [HelveSearchTools, HelveCallTool, HelveRequestTool]
52
+
53
+ # 1. Discover tools dynamically (no auth required)
54
+ search_tool = tools[0]
55
+ print(search_tool.invoke({"query": "web extraction", "limit": 3}))
56
+
57
+ # 2. Bind to any LangChain / LangGraph agent
58
+ # agent = create_react_agent(model, tools)
59
+ ```
60
+
61
+ ## Direct Client Usage
62
+
63
+ ```python
64
+ from langchain_helve import HelveGatewayClient
65
+
66
+ client = HelveGatewayClient(api_key="sk_live_...")
67
+
68
+ # Search available tools
69
+ matches = client.search_tools("web extraction", limit=5)
70
+
71
+ # Execute any discovered tool_id with its native arguments
72
+ result = client.call_tool(
73
+ "helve.web_extract",
74
+ {"urls": ["https://docs.helve.dev"], "content": {"max_chars": 4000}},
75
+ )
76
+ ```
77
+
78
+ ## Links
79
+
80
+ - Website: https://helve.dev
81
+ - Documentation: https://docs.helve.dev
82
+ - MCP Server & Skills: https://github.com/helve-dev/helve-mcp
83
+ - OpenAPI 3.1 Spec: https://helve.dev/openapi.json
@@ -0,0 +1,11 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ langchain_helve/__init__.py
5
+ langchain_helve/tools.py
6
+ langchain_helve.egg-info/PKG-INFO
7
+ langchain_helve.egg-info/SOURCES.txt
8
+ langchain_helve.egg-info/dependency_links.txt
9
+ langchain_helve.egg-info/requires.txt
10
+ langchain_helve.egg-info/top_level.txt
11
+ tests/test_tools.py
@@ -0,0 +1,3 @@
1
+ langchain-core>=0.3.0
2
+ httpx>=0.27.0
3
+ pydantic>=2.0.0
@@ -0,0 +1 @@
1
+ langchain_helve
@@ -0,0 +1,36 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "langchain-helve"
7
+ version = "0.1.0"
8
+ description = "LangChain toolkit for Helve — pay-per-call AI tool gateway (313 tools, 255 providers) with spend_limit_usd caps and zero-cost failed-call escrow."
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = "MIT"
12
+ authors = [
13
+ { name = "Helve", email = "daniel.foster@helve.dev" }
14
+ ]
15
+ keywords = ["langchain", "langgraph", "helve", "ai-agents", "tools", "mcp", "api-gateway"]
16
+ classifiers = [
17
+ "Development Status :: 4 - Beta",
18
+ "Intended Audience :: Developers",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.9",
21
+ "Programming Language :: Python :: 3.10",
22
+ "Programming Language :: Python :: 3.11",
23
+ "Programming Language :: Python :: 3.12",
24
+ "Topic :: Software Development :: Libraries :: Python Modules",
25
+ ]
26
+ dependencies = [
27
+ "langchain-core>=0.3.0",
28
+ "httpx>=0.27.0",
29
+ "pydantic>=2.0.0",
30
+ ]
31
+
32
+ [project.urls]
33
+ Homepage = "https://helve.dev"
34
+ Documentation = "https://docs.helve.dev"
35
+ "llms.txt" = "https://helve.dev/llms.txt"
36
+ Repository = "https://github.com/helve-dev/helve-mcp"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,35 @@
1
+ import json
2
+ import unittest
3
+ from langchain_helve import HelveGatewayClient, HelveToolkit
4
+
5
+
6
+ class TestLangChainHelve(unittest.TestCase):
7
+ def test_toolkit_routing(self):
8
+ recorded = []
9
+
10
+ def fake_transport(method, url, payload, headers):
11
+ recorded.append((method, url, payload, headers))
12
+ return {"ok": True, "url": url}
13
+
14
+ client = HelveGatewayClient(api_key="sk_live_test", transport=fake_transport)
15
+ toolkit = HelveToolkit(client=client)
16
+ tools = {t.name: t for t in toolkit.get_tools()}
17
+
18
+ self.assertEqual(set(tools.keys()), {"helve_search_tools", "helve_call_tool", "helve_request_tool"})
19
+
20
+ res1 = json.loads(tools["helve_search_tools"]._run(query="enrichment", limit=3))
21
+ res2 = json.loads(tools["helve_call_tool"]._run(tool_id="exa.answer", arguments={"query": "helve", "text": True}))
22
+ res3 = json.loads(tools["helve_request_tool"]._run(tool_name="lob.postcards", use_case="Send direct mail to leads", provider="lob"))
23
+
24
+ self.assertTrue(res1["ok"])
25
+ self.assertTrue(res2["ok"])
26
+ self.assertTrue(res3["ok"])
27
+ self.assertEqual(recorded[0][1], "https://helve.dev/v1/tools/search")
28
+ self.assertEqual(recorded[1][1], "https://helve.dev/v1/tools/call")
29
+ self.assertEqual(recorded[1][2], {"tool_id": "exa.answer", "arguments": {"query": "helve", "text": True}})
30
+ self.assertEqual(recorded[2][1], "https://helve.dev/v1/tools/request")
31
+ self.assertEqual(recorded[2][2], {"tool_name": "lob.postcards", "use_case": "Send direct mail to leads", "provider": "lob"})
32
+
33
+
34
+ if __name__ == "__main__":
35
+ unittest.main()