mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 02:44:02 +00:00
feat: add public camera and radio tools
Add find_cctv_cameras, get_cctv_snapshot and find_radio_stations. A snapshot returns the camera's current frame as image content with its credit. Tool results may now carry base64 images, which the MCP adapter sends as image content.
This commit is contained in:
1 parent
d65402eae3
commit
85fee59da1
10 files changed
+468
-4
No files matched your search
+12
-1
@@ -61,7 +61,8 @@ export function fromSourceError(error) {
|
||||
* Validate and freeze a tool definition.
|
||||
*
|
||||
* `run(args, { services, signal })` resolves to `{ summary, data }`: a short
|
||||
* sentence for people and a structured object for programs.
|
||||
* sentence for people and a structured object for programs. It may add
|
||||
* `images`, each `{ mimeType, data }` with base64 data.
|
||||
*/
|
||||
export function defineTool({
|
||||
name,
|
||||
@@ -146,6 +147,16 @@ export function composeCatalog({
|
||||
}
|
||||
if (!result || typeof result.summary !== 'string' || !result.data)
|
||||
throw new TypeError(`${tool.name} returned no summary or data`);
|
||||
if (
|
||||
result.images !== undefined &&
|
||||
(!Array.isArray(result.images) ||
|
||||
!result.images.every(
|
||||
(item) =>
|
||||
typeof item?.mimeType === 'string' &&
|
||||
typeof item?.data === 'string',
|
||||
))
|
||||
)
|
||||
throw new TypeError(`${tool.name} returned malformed images`);
|
||||
return result;
|
||||
};
|
||||
const chain = interceptors.reduceRight(
|
||||
|
||||
Reference in new issue
Block a user