Easy Heading Free | ||||||
---|---|---|---|---|---|---|
|
Name in script | Description | Aspire type | Init script | Process script |
---|---|---|---|---|
doc | Crawled document | AspireObject | false | true |
component | Aspire workflow component running Groovy scripts | ComponentImpl | true | true |
connection.client | REST client component for making AI calls | GenAIRestRequester | true | true |
utilities.azure.embeddings utilities.google.embeddings | Methods related to "embeddings" processing | Embeddings | true | true |
job | Job containing the crawled document | Job | false | true |
secrets | Map of secrets provided in UI | Map<String,String> | true | true |
template | Map of selected script template variables | Map<String,String> | true | true |
utilities.azure.prompts utilities.google.prompts | Methods related to "prompts" processing | Prompts | true | true |
utilities.textSplitter | Method related to text splitting | TextSplitterComponent | true | true |
variables | Map of variables provided in initialize script | Map<String,Object> | true | false |
utilities | Various helper methods | Utils | true | true |
Text splitter | utilities.textSplitter |
---|
Method | Description | Syntax | Init script | Process script | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Initialize | void utilities.textSplitter.initialize(AspireObject config) | true | false | ||||||||||||||||
config:
| |||||||||||||||||||
Process | List<String> utilities.textSplitter.process(AspireObject doc) List<String>: TODO doc: TODO | false | true |
Example init script:
Code Block | ||
---|---|---|
| ||
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 | ||
---|---|---|
| ||
def sentences = utilities.textSplitter.process(doc); |