llm.DocumentRank
The content in this help topic pertains to SuiteScript 2.1.
|
Object Description |
A ranked document in the Use the DocumentRank.index property to retrieve the original document string. This object does not include that string. |
|
Supported Script Types |
Server scripts For more information, see SuiteScript 2.1 Script Types. |
|
Module |
|
|
Methods and Properties |
|
|
Since |
2026.2 |
Syntax
The following code sample shows the syntax for this member. It isn't a functional example. For a complete script example, see N/llm Module Script Samples.
// Add additional code
...
const documents = ["Shipping information", "Return information"];
const response = llm.reRank({
documents: documents,
prompt: "How do I return an item?"
});
const rank = response.documentRanks[0];
const mostRelevantdocument = documents[rank.index];
const relevance = rank.relevance;
...
// Add additional code