llm.embed.promise(options)

Note:

The content in this help topic pertains to SuiteScript 2.1.

Method Description

Asynchronously returns the embeddings from the LLM for a given input.

Note:

The parameters and errors thrown for this method are the same as those for llm.embed(options). For more information about promises, see Promise Object.

Returns

Promise Object

Synchronous Version

llm.embed(options)

Supported Script Types

Server scripts

For more information, see SuiteScript 2.x Script Types.

Governance

50

Module

N/llm Module

Since

2025.1

Syntax

Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/llm Module Script Samples.

            // Add additional code
...

llm.embed.promise({
    inputs: ["Hello World"],
    embedModelFamily: llm.EmbedModelFamily.COHERE_EMBED_ENGLISH,
    timeout: 10000,
    truncate: llm.Truncate.START
}).then(function(result) {
       log.debug(result)
   }).catch(function(reason) {
       log.debug(reason)
   })

...
// Add additional code 

          

Related Topics

General Notices