From c882b9a04e76eb70274b70bbce24f8bb9fb2b42c Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Fri, 13 Jun 2025 11:17:02 -0700 Subject: [PATCH] sdk: publish --- sdk/package-lock.json | 4 +- sdk/package.json | 2 +- sdk/types/package-lock.json | 4 +- sdk/types/package.json | 2 +- .../scrypted_python/scrypted_sdk/types.py | 30 ++++++++++++- sdk/types/src/types.input.ts | 43 +++++++++++++++++++ 6 files changed, 78 insertions(+), 7 deletions(-) diff --git a/sdk/package-lock.json b/sdk/package-lock.json index f618da36a..f166f3f93 100644 --- a/sdk/package-lock.json +++ b/sdk/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/sdk", - "version": "0.5.12", + "version": "0.5.13", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@scrypted/sdk", - "version": "0.5.12", + "version": "0.5.13", "license": "ISC", "dependencies": { "@babel/preset-typescript": "^7.26.0", diff --git a/sdk/package.json b/sdk/package.json index 577bc7f56..2742d3a3b 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/sdk", - "version": "0.5.12", + "version": "0.5.13", "description": "", "main": "dist/src/index.js", "exports": { diff --git a/sdk/types/package-lock.json b/sdk/types/package-lock.json index a69e7a607..31f565bbd 100644 --- a/sdk/types/package-lock.json +++ b/sdk/types/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/types", - "version": "0.5.12", + "version": "0.5.13", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/types", - "version": "0.5.12", + "version": "0.5.13", "license": "ISC" } } diff --git a/sdk/types/package.json b/sdk/types/package.json index 524c4d26f..5f2a1c3a3 100644 --- a/sdk/types/package.json +++ b/sdk/types/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/types", - "version": "0.5.12", + "version": "0.5.13", "description": "", "main": "dist/index.js", "author": "", diff --git a/sdk/types/scrypted_python/scrypted_sdk/types.py b/sdk/types/scrypted_python/scrypted_sdk/types.py index b200e7af8..ce84a31ba 100644 --- a/sdk/types/scrypted_python/scrypted_sdk/types.py +++ b/sdk/types/scrypted_python/scrypted_sdk/types.py @@ -89,6 +89,7 @@ class ScryptedDeviceType(str, Enum): Internet = "Internet" Irrigation = "Irrigation" Light = "Light" + LLM = "LLM" Lock = "Lock" Network = "Network" Notifier = "Notifier" @@ -147,6 +148,7 @@ class ScryptedInterface(str, Enum): HumiditySetting = "HumiditySetting" Intercom = "Intercom" LauncherApplication = "LauncherApplication" + LLMTools = "LLMTools" Lock = "Lock" LuminanceSensor = "LuminanceSensor" MediaConverter = "MediaConverter" @@ -644,6 +646,13 @@ class LauncherApplicationInfo(TypedDict): icon: str # Supports: mdi-icon, fa-icon, urls. name: str +class LLMToolDefinition(TypedDict): + + description: str # A description of what the function does, used by the model to choose when and how to call the function. + name: str # The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. + parameters: Mapping[str, unknown] # The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting defines a function with an empty parameter list. + strict: bool # Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the field. Only a subset of JSON Schema is supported when is . Learn more about Structured Outputs in the [function calling guide]( ). + class MediaObjectOptions(TypedDict): sourceId: str # The device id of the source of the MediaObject. @@ -995,7 +1004,7 @@ class TamperState(TypedDict): pass -TYPES_VERSION = "0.5.12" +TYPES_VERSION = "0.5.13" class AirPurifier: @@ -1232,6 +1241,15 @@ class LauncherApplication: applicationInfo: LauncherApplicationInfo +class LLMTools: + + async def callLLMTool(self, name: str, parameters: Mapping[str, Any]) -> str: + pass + + async def getLLMTools(self) -> list[LLMToolDefinition]: + pass + + class Lock: """Lock controls devices that can lock or unlock entries. Often works in tandem with PasswordControl.""" @@ -2096,6 +2114,8 @@ class ScryptedInterfaceMethods(str, Enum): generateVideoFrames = "generateVideoFrames" connectStream = "connectStream" getTTYSettings = "getTTYSettings" + callLLMTool = "callLLMTool" + getLLMTools = "getLLMTools" class DeviceState: @@ -3384,6 +3404,14 @@ ScryptedInterfaceDescriptors = { ], "properties": [] }, + "LLMTools": { + "name": "LLMTools", + "methods": [ + "callLLMTool", + "getLLMTools" + ], + "properties": [] + }, "ScryptedSystemDevice": { "name": "ScryptedSystemDevice", "methods": [], diff --git a/sdk/types/src/types.input.ts b/sdk/types/src/types.input.ts index cc39f95b0..a518536b1 100644 --- a/sdk/types/src/types.input.ts +++ b/sdk/types/src/types.input.ts @@ -151,6 +151,7 @@ export enum ScryptedDeviceType { Internet = "Internet", Network = "Network", Bridge = "Bridge", + LLM = "LLM", Unknown = "Unknown", } /** @@ -1062,6 +1063,46 @@ export interface PanTiltZoomCommand { preset?: string; } + +export interface LLMToolDefinition { + /** + * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain + * underscores and dashes, with a maximum length of 64. + */ + name: string; + + /** + * A description of what the function does, used by the model to choose when and + * how to call the function. + */ + description?: string; + + /** + * The parameters the functions accepts, described as a JSON Schema object. See the + * [guide](https://platform.openai.com/docs/guides/function-calling) for examples, + * and the + * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for + * documentation about the format. + * + * Omitting `parameters` defines a function with an empty parameter list. + */ + parameters?: Record; + + /** + * Whether to enable strict schema adherence when generating the function call. If + * set to true, the model will follow the exact schema defined in the `parameters` + * field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn + * more about Structured Outputs in the + * [function calling guide](https://platform.openai.com/docs/guides/function-calling?api-mode=responses). + */ + strict?: boolean | null; +} + +export interface LLMTools { + getLLMTools(): Promise; + callLLMTool(name: string, parameters: Record): Promise; +} + export interface PanTiltZoomCapabilities { pan?: boolean; tilt?: boolean; @@ -2426,6 +2467,8 @@ export enum ScryptedInterface { TTY = 'TTY', TTYSettings = 'TTYSettings', + LLMTools = "LLMTools", + ScryptedSystemDevice = "ScryptedSystemDevice", ScryptedDeviceCreator = "ScryptedDeviceCreator", ScryptedSettings = "ScryptedSettings",