llm.createDocument(options)
The content in this help topic pertains to SuiteScript 2.1.
Method Description |
Creates a document with the specified ID and content. A document represents source content that you can provide as additional context to the LLM when you call llm.generateText(options) or llm.generateText.promise(options). The LLM uses information in the provided documents to augment its response using retrieval-augmented generation (RAG). For more information about RAG, see What Is Retrieval-Augmented Generation (RAG)? You do not need to use this method to create a document before providing the document to llm.generateText(options) or llm.generateText.promise(options). You can also provide a plain JavaScript object that uses the
|
Returns |
|
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Since |
2025.1 |
Parameters
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
string |
required |
The content of the document. |
2025.1 |
|
string |
required |
The ID of the document. |
2025.1 |
Syntax
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
...
const doc1 = llm.createDocument({
id: "doc1",
data: "My document data"
});
...
// Add additional code