Functions and procedures

ai.text.completion()

Syntax

ai.text.completion(prompt, provider, configuration) :: STRING

Description

Function to return generated text output based on the provided prompt.

Input arguments

Name

Type

Description

prompt

STRING

Textual prompt.

provider

STRING

Name of the third party AI provider, see Generate text → Providers.

configuration

MAP

Provider specific configuration, see Generate text → Providers.

Returns

Generated text based on the provided prompt.

ai.text.completion.providers()

Syntax

ai.text.completion.providers() :: (index, completion)

Description

Returns text completion providers and their configuration options.

Return arguments

Name

Type

Description

name

STRING

Provider name.

requiredConfigType

STRING

The signature of the required configuration options.

optionalConfigType

STRING

The signature of the optional configuration options.

defaultConfig

MAP

Default configuration option values.

ai.text.embed()

Syntax

ai.text.embed(resource, provider, configuration = {}) :: VECTOR

Description

Encode a given resource as a vector using the named provider.

Input arguments

Name

Type

Description

resources

LIST<STRING>

The object to transform into an embedding.

provider

STRING

The identifier of the provider: ("VertexAI", "OpenAI", "AzureOpenAI", "Bedrock-Titan").

configuration

MAP

The provider specific settings.

Returns

VECTOR

ai.text.embedBatch()

Syntax

ai.text.embedBatch(resource, provider, configuration = {}) :: (index, resource, vector)

Description

Encode a given resource as a vector using the named provider.

Input arguments

Name

Type

Description

resources

LIST<STRING>

The object to transform into an embedding.

provider

STRING

The identifier of the provider: ("VertexAI", "OpenAI", "AzureOpenAI", "Bedrock-Titan").

configuration

MAP

The provider specific settings.

Return arguments

Name

Type

Description

index

INTEGER

The index of the corresponding element in the input list.

resource

STRING

The given input resource.

vector

VECTOR

The generated vector embedding for the resource.

ai.text.embed.providers()

Syntax

ai.text.embed.providers() :: (name, requiredConfigType, optionalConfigType, defaultConfig)

Description

Lists the available vector embedding providers.

Return arguments

Name

Type

Description

name

STRING

The name of the GenAI provider.

requiredConfigType

STRING

The signature of the required config map.

optionalConfigType

STRING

The signature of the optional config map.

defaultConfig

MAP

The default values for the GenAI provider.

genai.vector.encode()

Syntax

genai.vector.encode(resource, provider, configuration = {}) :: ANY

Description

Encode a given resource as a vector using the named provider.

Input arguments

Name

Type

Description

resources

LIST<STRING>

The object to transform into an embedding.

provider

STRING

The identifier of the provider: ("VertexAI", "OpenAI", "AzureOpenAI", "Bedrock").

configuration

MAP

The provider specific settings.

Returns

ANY

genai.vector.encodeBatch()

Syntax

genai.vector.encodeBatch(resources, provider, configuration = {}) :: (index, resource, vector)

Description

Encode a given batch of resources as vectors using the named provider.

Input arguments

Name

Type

Description

resources

LIST<STRING>

The object to transform into an embedding.

provider

STRING

An optional list of selectors to filter out changes.

configuration

MAP

The provider specific settings.

Return arguments

Name

Type

Description

index

INTEGER

The index of the corresponding element in the input list.

resource

STRING

The given input resource.

vector

ANY

The generated vector embedding for the resource.

genai.vector.listEncodingProviders()

Syntax

genai.vector.listEncodingProviders() :: (name, requiredConfigType, optionalConfigType, defaultConfig)

Description

Lists the available vector embedding providers.

Return arguments

Name

Type

Description

name

STRING

The name of the GenAI provider.

requiredConfigType

STRING

The signature of the required config map.

optionalConfigType

STRING

"The signature of the optional config map.

defaultConfig

MAP

The default values for the GenAI provider.