mirror of
https://github.com/koush/scrypted.git
synced 2026-06-27 11:50:24 +01:00
sdk: publish
This commit is contained in:
4
sdk/package-lock.json
generated
4
sdk/package-lock.json
generated
@@ -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",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@scrypted/sdk",
|
||||
"version": "0.5.12",
|
||||
"version": "0.5.13",
|
||||
"description": "",
|
||||
"main": "dist/src/index.js",
|
||||
"exports": {
|
||||
|
||||
4
sdk/types/package-lock.json
generated
4
sdk/types/package-lock.json
generated
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@scrypted/types",
|
||||
"version": "0.5.12",
|
||||
"version": "0.5.13",
|
||||
"description": "",
|
||||
"main": "dist/index.js",
|
||||
"author": "",
|
||||
|
||||
@@ -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": [],
|
||||
|
||||
@@ -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<string, unknown>;
|
||||
|
||||
/**
|
||||
* 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<LLMToolDefinition[]>;
|
||||
callLLMTool(name: string, parameters: Record<string, any>): Promise<string>;
|
||||
}
|
||||
|
||||
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",
|
||||
|
||||
Reference in New Issue
Block a user