Upload SpecStream tool
Browse files- README.md +1 -1
- index.html +1 -1
- tool.py +3 -3
README.md
CHANGED
|
@@ -7,6 +7,6 @@ tags:
|
|
| 7 |
- tool
|
| 8 |
---
|
| 9 |
|
| 10 |
-
SpecStream
|
| 11 |
|
| 12 |
Load it with `Tool.from_hub("SpecStreamAI/specstream-find-web-data", trust_remote_code=True)`.
|
|
|
|
| 7 |
- tool
|
| 8 |
---
|
| 9 |
|
| 10 |
+
SpecStream is the live web data engine for teams and agents. One platform to build, search, extract, enrich, map, and monitor data across the entire web. Tool one shows how SpecStream read the request and the maximum price, and runs only after the person approves that maximum. Tool two reads the rows. Source URL and read time on every value. Set SPECSTREAM_API_KEY. Start at https://specstream.ai/?utm_source=smolagents
|
| 11 |
|
| 12 |
Load it with `Tool.from_hub("SpecStreamAI/specstream-find-web-data", trust_remote_code=True)`.
|
index.html
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
<!doctype html><html><head><meta charset="utf-8"><title>SpecStream find web data</title></head><body style="font-family:system-ui;max-width:40rem;margin:3rem auto;padding:0 1rem"><h1>SpecStream find web data</h1><p>SpecStream
|
|
|
|
| 1 |
+
<!doctype html><html><head><meta charset="utf-8"><title>SpecStream find web data</title></head><body style="font-family:system-ui;max-width:40rem;margin:3rem auto;padding:0 1rem"><h1>SpecStream find web data</h1><p>SpecStream is the live web data engine for teams and agents. One platform to build, search, extract, enrich, map, and monitor data across the entire web. Tool one shows how SpecStream read the request and the maximum price, and runs only after the person approves that maximum. Tool two reads the rows. Source URL and read time on every value. Set SPECSTREAM_API_KEY. Start at https://specstream.ai/?utm_source=smolagents</p><p><code>Tool.from_hub("SpecStreamAI/specstream-find-web-data", trust_remote_code=True)</code></p></body></html>
|
tool.py
CHANGED
|
@@ -1,13 +1,13 @@
|
|
| 1 |
from typing import Any, Optional
|
| 2 |
from smolagents.tools import Tool
|
| 3 |
-
import json
|
| 4 |
-
import urllib
|
| 5 |
import os
|
|
|
|
|
|
|
| 6 |
|
| 7 |
class SpecStreamFindWebData(Tool):
|
| 8 |
name = "specstream_find_web_data"
|
| 9 |
description = "Reads a request for web data and returns how SpecStream understood it, plus the maximum price. Nothing runs and nothing is charged until the person approves that maximum. Step 1: call with request only, show the reading and the price to the person. Step 2: only after the person says yes, call again with quote_id and confirm_max_cents set to the quoted maximum in cents. That starts the work and returns a find_id; read the rows with the specstream_get_rows tool. Needs SPECSTREAM_API_KEY."
|
| 10 |
-
inputs = {'request': {'type': 'string', 'description': 'The data wanted, in plain words
|
| 11 |
output_type = "string"
|
| 12 |
|
| 13 |
def _call(self, method: str, path: str, body: dict | None = None) -> dict:
|
|
|
|
| 1 |
from typing import Any, Optional
|
| 2 |
from smolagents.tools import Tool
|
|
|
|
|
|
|
| 3 |
import os
|
| 4 |
+
import urllib
|
| 5 |
+
import json
|
| 6 |
|
| 7 |
class SpecStreamFindWebData(Tool):
|
| 8 |
name = "specstream_find_web_data"
|
| 9 |
description = "Reads a request for web data and returns how SpecStream understood it, plus the maximum price. Nothing runs and nothing is charged until the person approves that maximum. Step 1: call with request only, show the reading and the price to the person. Step 2: only after the person says yes, call again with quote_id and confirm_max_cents set to the quoted maximum in cents. That starts the work and returns a find_id; read the rows with the specstream_get_rows tool. Needs SPECSTREAM_API_KEY."
|
| 10 |
+
inputs = {'request': {'type': 'string', 'description': 'The data wanted, in plain words.'}, 'count': {'type': 'integer', 'description': 'How many results to price, 1 to 500. Leave empty for the default.', 'nullable': True}, 'quote_id': {'type': 'string', 'description': 'The quote_id from step 1. Only with confirm_max_cents, after the person approved.', 'nullable': True}, 'confirm_max_cents': {'type': 'integer', 'description': 'The maximum in cents from step 1, exactly as quoted. Set only after the person approved it.', 'nullable': True}}
|
| 11 |
output_type = "string"
|
| 12 |
|
| 13 |
def _call(self, method: str, path: str, body: dict | None = None) -> dict:
|