MCPcopy
hub / github.com/TaskingAI/TaskingAI / verify

Method verify

plugin/bundles/serper/bundle.py:10–23  ·  view source on GitHub ↗
(self, credentials: BundleCredentials)

Source from the content-addressed store, hash-verified

8
9class Serper(BundleHandler):
10 async def verify(self, credentials: BundleCredentials):
11 query: str = "TaskingAI"
12 SERPER_API_KEY: str = credentials.credentials.get("SERPER_API_KEY")
13
14 url = "https://google.serper.dev/search"
15
16 headers = {"X-API-KEY": SERPER_API_KEY, "Content-Type": "application/json"}
17
18 payload = json.dumps({"q": query, "num": 20})
19
20 async with ClientSession() as session:
21 async with session.post(url, headers=headers, data=payload, proxy=CONFIG.PROXY) as response:
22 if response.status != 200:
23 raise_credentials_validation_error(await response.text())

Callers

nothing calls this directly

Calls 2

getMethod · 0.45

Tested by

no test coverage detected