Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RedisAI

Hierarchy

  • Module
    • RedisAI

Index

Constructors

  • new RedisAI(clusterNodes: ClusterNode[], moduleOptions?: RedisModuleOptions, clusterOptions?: ClusterOptions): RedisAI
  • new RedisAI(redisOptions: RedisOptions, moduleOptions?: RedisModuleOptions): RedisAI
  • Initializing the module object

    Parameters

    • clusterNodes: ClusterNode[]

      The nodes of the cluster

    • Optional moduleOptions: RedisModuleOptions

      The additional module options

    • Optional clusterOptions: ClusterOptions

      The options of the clusters

    Returns RedisAI

  • Initializing the module object

    Parameters

    • redisOptions: RedisOptions

      The options of the redis database

    • Optional moduleOptions: RedisModuleOptions

      The additional module options

    Returns RedisAI

Properties

aiCommander: RedisAICommander = ...
cluster: Cluster
clusterNodes: ClusterNode[]
clusterOptions: ClusterOptions
isHandleError: boolean
name: string
redis: Redis
redisOptions: RedisOptions
returnRawResponse: boolean
showDebugLogs: boolean

Methods

  • config(path: string, backend?: AIBackend): Promise<"OK">
  • Restrieving configuration

    Parameters

    • path: string

      Specifies the default base backends path to path . The backends path is used when dynamically loading a backend (default: '{module_path}/backends', where module_path is the module's path).

    • Optional backend: AIBackend

      Loads the DL/ML backend specified by the backend identifier from path . If path is relative, it is resolved by prefixing the BACKENDSPATH to it. If path is absolute then it is used as is.

    Returns Promise<"OK">

  • connect(): Promise<void>
  • Connecting to the Redis database with the module

    Returns Promise<void>

  • Running a readonly DAG

    Parameters

    • parameters: AIDagExecuteParameters

      Additional parameters required for the 'AI.DAGEXECUTE_RO' command

    • commands: string[]

      The commands sent to the 'AI.DAGEXECUTE_RO' command

    Returns Promise<string[]>

  • disconnect(): Promise<void>
  • Disconnecting from the Redis database with the module

    Returns Promise<void>

  • handleError(error: string): any
  • Handling a error

    Parameters

    • error: string

      The message of the error

    Returns any

  • handleResponse(response: any): any
  • Simpilizing the response of the Module command

    Parameters

    • response: any

      The array response from the module

    Returns any

  • info(key: string, RESETSTAT?: boolean): Promise<string | string[] | AIScriptInfo>
  • Retrieving script/model info

    Parameters

    • key: string

      The key name of a model or script

    • Optional RESETSTAT: boolean

      Resets all statistics associated with the key

    Returns Promise<string | string[] | AIScriptInfo>

  • isOnlyTwoDimensionalArray(array: any[]): boolean
  • Check if array is fully two dimensional. Only items in the array are arrays.

    Parameters

    • array: any[]

      The potential two dimensional array

    Returns boolean

  • modeldel(key: string): Promise<"OK">
  • modelget(key: string, meta?: boolean, blob?: boolean): Promise<string | string[] | AIModel>
  • Retrieving a model

    Parameters

    • key: string

      The model's key name

    • Optional meta: boolean

      Will return the model's meta information on backend, device and tag

    • Optional blob: boolean

      Will return the model's blob containing the serialized model

    Returns Promise<string | string[] | AIModel>

  • modelscan(): Promise<string[][]>
  • Setting a model

    Parameters

    • key: string

      The model's key name

    • backend: AIBackend

      The backend of the model

    • device: string

      The devide of the model

    • model: Buffer

      The Protobuf-serialized model. Since Redis supports strings up to 512MB, blobs for very large

    • Optional options: AIModelSetParameters

      Additional optional parameters

    Returns Promise<"OK">

  • paramToString(paramValue: string): string
  • Formatting given param value to string

    Parameters

    • paramValue: string

      The given param value

    Returns string

    A param value converted to string

  • reduceArrayDimension(array: any[][]): any[]
  • Reducing an array by one level. i.e. from two dimensional to 1 dimensional.

    Parameters

    • array: any[][]

      The potentional two dimensional array

    Returns any[]

  • scriptdel(key: string): Promise<"OK">
  • scriptget(key: string, meta?: boolean, source?: boolean): Promise<string | string[] | AIScript>
  • Retrieving a script

    Parameters

    • key: string

      The script's key name

    • Optional meta: boolean

      The script's device as a String

    • Optional source: boolean

      The script's source code as a String

    Returns Promise<string | string[] | AIScript>

  • scriptscan(): Promise<string[][]>
  • sendCommand(data: CommandData): Promise<any>
  • Running a Redis command

    Parameters

    • data: CommandData

      The command data of a command to send. Consists of command and args.

    Returns Promise<any>

  • tensorget(key: string, format?: "BLOB" | "VALUES", meta?: boolean): Promise<string | AITensorInfo | string[]>
  • Retrieving a tensor

    Parameters

    • key: string

      The tensor's key name

    • Optional format: "BLOB" | "VALUES"

      The tensor's reply format can be one of the following (BLOB/VALUES)

    • Optional meta: boolean

      Returns the tensor's metadata

    Returns Promise<string | AITensorInfo | string[]>

  • tensorset(key: string, type: TensorType, shapes: number[], data?: number[] | Buffer[]): Promise<"OK">
  • Setting a tensor

    Parameters

    • key: string

      The tensor's key name

    • type: TensorType

      The tensor's data type can be one of: FLOAT , DOUBLE , INT8 , INT16 , INT32 , INT64 , UINT8 or UINT16

    • shapes: number[]
    • Optional data: number[] | Buffer[]

      The tensor's data (binary/numberic)

    Returns Promise<"OK">

Generated using TypeDoc