Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Easy Heading Free
navigationTitleOn this Page
wrapNavigationTexttrue
navigationExpandOptionexpand-all-by-default

Binding variables


Name in scriptDescriptionAspire typeInit scriptProcess script
docCrawled documentAspireObjectfalsetrue
componentAspire workflow component running Groovy scriptsComponentImpltruetrue
connection.clientREST client component for making AI callsGenAIRestRequestertruetrue

utilities.azure.embeddings

utilities.google.embeddings

Methods related to "embeddings" processingEmbeddingstruetrue

job

Job containing the crawled documentJobfalsetrue

secrets

Map of secrets provided in UIMap<String,String>truetrue

template

Map of selected script template variablesMap<String,String>truetrue

utilities.azure.prompts

utilities.google.prompts

Methods related to "prompts" processingPromptstruetrue

utilities.textSplitter

Method related to text splittingTextSplitterComponenttruetrue

variables

Map of variables provided in initialize scriptMap<String,Object>truefalse

utilities

Various helper methodsUtilstruetrue

Document

Component

Connection

Embeddings

Job

Secrets

Template

Prompts

Text Splitter

Text splitterutilities.textSplitter
MethodDescriptionSyntaxInit scriptProcess script
Initialize
void utilities.textSplitter.initialize(AspireObject config)truefalse


config:

NameDescriptionDefault
splitType

fieldsToSplit

customSplitRegex

characterThreshold



Process


List<String> utilities.textSplitter.process(AspireObject doc)

List<String>:

TODO

doc:

TODO

falsetrue

Example init script:

Code Block
languagegroovy
import com.accenture.aspire.services.AspireObject;

utilities.textSplitter.initialize(getTextSplitterConfig("sentence"))

def getTextSplitterConfig(String splitType) {
    AspireObject returnValue = new AspireObject("config");
    returnValue.add("splitType", splitType);
    returnValue.add("fieldsToSplit", "content");
    returnValue.add("customSplitRegex", "\\|+");
    returnValue.add("characterThreshold", 4);
    return returnValue;
}

Example script:

Code Block
languagegroovy
def sentences = utilities.textSplitter.process(doc);


Variables

Utilities

REST connection 


Authentication

Request

Response

Throttling, 429 Policy