Skip to content
Talk to our solutions team

AI

Model calls, classification, safety, embeddings and vector search. Each function lists its parameters, defaults and return value.

LLM chat and completion functions.

Scope: System

FunctionDescription
llm.chat()LLM chat completion with multi-turn messages
llm.complete()LLM text completion with a single prompt

Perform LLM chat completion with multi-turn message history.

Note: This function requires a pipeline environment with ProxySelector for model routing. Use the YAML interface (chat task with type: chat) for full functionality. The script namespace stub returns an error directing to the YAML interface.

ParameterTypeDefaultDescription
messagesarrayChat messages with role and content fields (required)
selectionmap{}Model selection criteria
temperaturefloat1.0Sampling temperature
maxtokensint200Maximum tokens to generate
FieldTypeDescription
successboolWhether the completion succeeded
errorstringError message (stub always returns error)
// Note: Requires pipeline environment. This stub returns an error.
let result = llm.chat({
messages: [
{ role: "system", content: "You are a helpful assistant." },
{ role: "user", content: "What is machine learning?" }
],
selection: { model: "gpt-4" },
maxtokens: 500
})
// Use the chat YAML task with type: chat instead

Perform LLM text completion with a single prompt.

Note: This function requires a pipeline environment with ProxySelector for model routing. Use the YAML interface (chat task with type: completion) for full functionality. The script namespace stub returns an error directing to the YAML interface.

ParameterTypeDefaultDescription
promptstringPrompt text for completion (required)
selectionmap{}Model selection criteria
temperaturefloat1.0Sampling temperature
maxtokensint200Maximum tokens to generate
FieldTypeDescription
successboolWhether the completion succeeded
errorstringError message (stub always returns error)
// Note: Requires pipeline environment. This stub returns an error.
let result = llm.complete({
prompt: "Summarize the following text: ...",
selection: { accuracy: "high" },
temperature: 0.7,
maxtokens: 300
})
// Use the chat YAML task with type: completion instead

Intent classification functions.

Scope: System

FunctionDescription
intent.classify()Classify the intent of a user prompt

Classify the intent of user prompts by sending them to an intent classification model endpoint.

Note: This function requires a pipeline environment with ProxySelector for model routing. Use the YAML interface (getintent task) for full functionality. The script namespace stub returns an error directing to the YAML interface.

ParameterTypeDefaultDescription
promptstringPrompt to classify (required)
selectionmap{}Model selection criteria
FieldTypeDescription
successboolWhether the classification succeeded
errorstringError message (stub always returns error)
// Note: Requires pipeline environment. This stub returns an error.
let result = intent.classify({
prompt: "I want to book a flight to New York"
})
// Use the getintent YAML task instead

LLM safety classification functions.

Scope: System

FunctionDescription
guard.check()Classify content safety using Llama Guard

Classify user prompts or agent responses against unsafe content categories (S1–S11).

Note: This function requires a pipeline environment with ProxySelector for model routing. Use the YAML interface (pre-guard/post-guard tasks) for full functionality. The script namespace stub returns an error directing to the YAML interface.

ParameterTypeDefaultDescription
promptstringContent to classify (required)
FieldTypeDescription
successboolWhether the classification completed
errorstringError message (stub always returns error)
CategoryDescription
S1Violent Crimes
S2Non-Violent Crimes
S3Sex Crimes
S4Child Exploitation
S5Specialized Advice
S6Privacy
S7Intellectual Property
S8Indiscriminate Weapons
S9Hate
S10Self-Harm
S11Sexual Content
// Note: Requires pipeline environment. This stub returns an error.
let result = guard.check({
prompt: "Is this message safe?"
})
// Use the pre-guard/post-guard YAML tasks instead

Embedding generation and text splitting functions.

Scope: System

FunctionDescription
embed.generate()Generate vector embeddings (requires pipeline)
embed.split()Split text data by delimiter or by length

Generate vector embeddings from text data.

Note: This function requires a pipeline environment with ProxySelector for model routing. Use the YAML interface (embed or embeddata tasks) for full functionality. The script namespace stub returns an error directing to the YAML interface.

ParameterTypeDefaultDescription
dataarrayArray of text strings to embed (required)
FieldTypeDescription
successboolWhether embedding generation succeeded
errorstringError message (stub always returns error)
// Note: Requires pipeline environment. This stub returns an error.
let result = embed.generate({
data: ["Hello world", "Machine learning is great"]
})
// Use the embed or embeddata YAML tasks instead

Split text data into chunks by delimiter or by character length. Works independently without requiring a pipeline environment.

ParameterTypeDefaultDescription
dataarrayArray of text strings to split (required)
delimiterstringDelimiter string to split by
lengthintCharacter length to split into chunks

One of delimiter or length is required.

FieldTypeDescription
successboolWhether the split succeeded
resultarrayArray of arrays — one split-result array per input string
errorstringError message if failed
// Split by delimiter
let result = embed.split({
data: ["Hello world. This is a test.", "Another document here."],
delimiter: ". "
})
// result.result = [["Hello world", "This is a test."], ["Another document here."]]
// Split by character length
let result = embed.split({
data: ["A long text that needs to be split into smaller chunks for embedding"],
length: 20
})
// result.result = [["A long text that nee", "ds to be split into ", "smaller chunks for e", "mbedding"]]
// Split paragraphs for embedding prep
let result = embed.split({
data: [
"First paragraph content.\n\nSecond paragraph content.\n\nThird paragraph.",
"Another document.\n\nWith two paragraphs."
],
delimiter: "\n\n"
})
for (let i = 0; i < result.result.length; i++) {
log("Document " + i + " has " + result.result[i].length + " chunks")
}

AI Knowledge vector store functions.

Scope: System

FunctionDescription
ai-knowledge.embed()Send embeddings to a AI Knowledge vector store REST endpoint

Send embeddings and associated data to a AI Knowledge vector store REST endpoint.

Note: This function requires a pipeline environment with REST service connection. Use the YAML interface (ai-knowledge task) for full functionality. The script namespace stub returns an error directing to the YAML interface.

ParameterTypeDefaultDescription
urlstringAI Knowledge REST endpoint URL (required)
embeddingskeystringEnvironment key for embeddings data (required)
FieldTypeDescription
successboolWhether the operation succeeded
errorstringError message (stub always returns error)
// Note: Requires pipeline environment. This stub returns an error.
let result = ai-knowledge.embed({
url: "https://ai-knowledge.example.com/v1/documents",
embeddingskey: "embeddings"
})
// Use the ai-knowledge YAML task instead

Milvus vector database functions. Provides insert, search, query, list, and delete operations for vector collections with tenant-based database isolation.

Scope: System

FunctionDescription
milvus.insert()Insert vector embeddings into a collection
milvus.search()Vector similarity search in a collection
milvus.query()Query records by field filters
milvus.list()List unique topic names for a user
milvus.delete()Delete records by user/topic/URL

Note: All Milvus functions require a pipeline environment with Milvus client connection and tenant context. Use the YAML interface (topics tasks) for full functionality. The script namespace stubs return errors directing to the YAML interface.

Insert vector embeddings into a Milvus collection.

ParameterTypeDefaultDescription
urlstringMilvus gRPC endpoint URL (required)
collectionstringCollection name (required)
embeddingsstringEnvironment key for embeddings data (required)
useridstringUser ID for inserted records (required)
topicstringTopic name for inserted records (required)
FieldTypeDescription
successboolWhether the insert succeeded
errorstringError message (stub always returns error)
// Note: Requires pipeline environment. This stub returns an error.
let result = milvus.insert({
url: "localhost:19530",
collection: "knowledge_base",
embeddings: "embeddingresult",
userid: "user123",
topic: "machine-learning"
})
// Use the topicsinsert YAML task instead

Perform vector similarity search using L2 distance.

ParameterTypeDefaultDescription
urlstringMilvus gRPC endpoint URL (required)
collectionstringCollection name (required)
embeddingsstringEnvironment key for query embedding (required)
topicstringTopic name to filter by (required)
useridstringUser ID to filter by
limitint3Maximum results (top-k)
FieldTypeDescription
successboolWhether the search succeeded
errorstringError message (stub always returns error)
// Note: Requires pipeline environment. This stub returns an error.
let result = milvus.search({
url: "localhost:19530",
collection: "knowledge_base",
embeddings: "queryembedding",
topic: "machine-learning",
limit: 5
})
// Use the topicssearch YAML task instead

Query records from a collection using field-based filters.

ParameterTypeDefaultDescription
urlstringMilvus gRPC endpoint URL (required)
collectionstringCollection name (required)
topicstringTopic name to query by (required)
useridstringUser ID to filter by
limitint3Maximum results
FieldTypeDescription
successboolWhether the query succeeded
errorstringError message (stub always returns error)
// Note: Requires pipeline environment. This stub returns an error.
let result = milvus.query({
url: "localhost:19530",
collection: "knowledge_base",
topic: "machine-learning",
limit: 10
})
// Use the topicsquery YAML task instead

List unique topic names for a user from a collection.

ParameterTypeDefaultDescription
urlstringMilvus gRPC endpoint URL (required)
collectionstringCollection name (required)
useridstringUser ID to filter by (required)
FieldTypeDescription
successboolWhether the listing succeeded
errorstringError message (stub always returns error)
// Note: Requires pipeline environment. This stub returns an error.
let result = milvus.list({
url: "localhost:19530",
collection: "knowledge_base",
userid: "user123"
})
// Use the topicslist YAML task instead

Delete records from a collection by user, topic, and optional URL.

ParameterTypeDefaultDescription
urlstringMilvus gRPC endpoint URL (required)
collectionstringCollection name (required)
useridstringUser ID to delete by (required)
topicstringTopic name to delete by (required)
FieldTypeDescription
successboolWhether the delete succeeded
errorstringError message (stub always returns error)
// Note: Requires pipeline environment. This stub returns an error.
let result = milvus.delete({
url: "localhost:19530",
collection: "knowledge_base",
userid: "user123",
topic: "old-topic"
})
// Use the topicsdelete YAML task instead

Text transformation functions.

Scope: System

FunctionDescription
text.tosentence()Convert entity YAML to natural language sentences (requires pipeline)
text.split()Split text by delimiter or by length

Convert entity YAML definitions into natural language sentences.

Note: This function requires entity YAML context from the pipeline environment. Use the YAML interface (tosentence task) for full functionality. The script namespace stub returns an error directing to the YAML interface.

ParameterTypeDefaultDescription
entityyamlstringEntity YAML string to convert (required)
FieldTypeDescription
successboolWhether the conversion succeeded
errorstringError message (stub always returns error)
// Note: Requires pipeline environment. This stub returns an error.
let result = text.tosentence({
entityyaml: "name: User\nfields:\n - name: email\n type: string"
})
// Use the tosentence YAML task instead

Split text by a delimiter string or by character length.

ParameterTypeDefaultDescription
textstringText to split (required)
delimiterstringDelimiter string to split by
lengthintCharacter length to split into chunks

One of delimiter or length is required.

FieldTypeDescription
successboolWhether the split succeeded
resultarrayArray of text chunks
errorstringError message if failed
// Split by delimiter
let result = text.split({
text: "hello world. this is a test. another sentence.",
delimiter: ". "
})
// result.result = ["hello world", "this is a test", "another sentence."]
// Split by length
let result = text.split({
text: "The quick brown fox jumps over the lazy dog",
length: 10
})
// result.result = ["The quick ", "brown fox ", "jumps over", " the lazy ", "dog"]
// Split paragraphs
let result = text.split({
text: "First paragraph.\n\nSecond paragraph.\n\nThird paragraph.",
delimiter: "\n\n"
})
for (let part of result.result) {
log("Paragraph: " + part)
}

JSON and YAML schema validation functions.

Scope: System

FunctionDescription
validate.json()Validate a JSON value against a JSON schema
validate.yaml()Validate a YAML value against a JSON schema

Validate a JSON value against a JSON schema using the JSON Schema specification.

ParameterTypeDefaultDescription
schemastringJSON schema string (required)
valuestringJSON value string to validate (required)
FieldTypeDescription
successboolWhether the validation completed
validboolWhether the value matches the schema
errorstringValidation error details if invalid, or error message if failed
// Validate a JSON object
let result = validate.json({
schema: '{"type": "object", "properties": {"name": {"type": "string"}, "age": {"type": "integer"}}, "required": ["name"]}',
value: '{"name": "Alice", "age": 30}'
})
if (result.success && result.valid) {
log("JSON is valid")
}
// Check for validation errors
let result = validate.json({
schema: '{"type": "object", "required": ["email"]}',
value: '{"name": "Bob"}'
})
if (result.success && !result.valid) {
log("Validation error: " + result.error)
}
// Validate an array
let result = validate.json({
schema: '{"type": "array", "items": {"type": "number"}}',
value: '[1, 2, 3]'
})
log("Valid: " + result.valid)

Validate a YAML value against a JSON schema. The YAML is parsed and then validated using the JSON Schema specification.

ParameterTypeDefaultDescription
schemastringJSON schema string (required)
valuestringYAML value string to validate (required)
FieldTypeDescription
successboolWhether the validation completed
validboolWhether the value matches the schema
errorstringValidation error details if invalid, or error message if failed
// Validate a YAML config
let result = validate.yaml({
schema: '{"type": "object", "properties": {"name": {"type": "string"}, "version": {"type": "string"}}, "required": ["name"]}',
value: "name: my-app\nversion: 1.0.0"
})
if (result.success && result.valid) {
log("YAML config is valid")
}
// Validate YAML against a schema
let result = validate.yaml({
schema: '{"type": "object", "properties": {"port": {"type": "integer"}}, "required": ["port"]}',
value: "host: localhost\nport: 8080"
})
log("Valid: " + result.valid)
// Check for missing required fields
let result = validate.yaml({
schema: '{"type": "object", "required": ["name", "email"]}',
value: "name: Alice"
})
if (!result.valid) {
log("Missing fields: " + result.error)
}

Web and document scraping functions.

Scope: System

FunctionDescription
scrape.web()Scrape content from web URLs
scrape.pdf()Scrape text from PDF files
scrape.excel()Scrape content from Excel files
scrape.docx()Scrape text from DOCX files
scrape.pptx()Scrape text from PPTX files

Note: All scrape functions require a pipeline environment with ProxySelector for service routing (except scrape.excel which processes files directly). Use the YAML interface (scrape tasks) for full functionality. The script namespace stubs return errors directing to the YAML interface.

Scrape content from web URLs with configurable crawl depth and page limits.

ParameterTypeDefaultDescription
urlsarrayURLs to scrape (required)
FieldTypeDescription
successboolWhether the scrape succeeded
errorstringError message (stub always returns error)
// Note: Requires pipeline environment. This stub returns an error.
let result = scrape.web({
urls: ["https://docs.example.com/guide"]
})
// Use the scrapedata YAML task instead

Scrape text content from PDF files via a remote scraping service.

ParameterTypeDefaultDescription
urlstringURL of the PDF file (required)
FieldTypeDescription
successboolWhether the scrape succeeded
errorstringError message (stub always returns error)
// Note: Requires pipeline environment. This stub returns an error.
let result = scrape.pdf({
url: "https://example.com/document.pdf"
})
// Use the scrape-pdf YAML task instead

Scrape content from Excel files.

ParameterTypeDefaultDescription
filestringURL of the Excel file (required)
FieldTypeDescription
successboolWhether the scrape succeeded
errorstringError message (stub always returns error)
// Note: Requires pipeline environment. This stub returns an error.
let result = scrape.excel({
file: "https://example.com/data.xlsx"
})
// Use the scrape-excel YAML task instead

Scrape text content from DOCX files via a remote scraping service.

ParameterTypeDefaultDescription
urlstringURL of the DOCX file (required)
FieldTypeDescription
successboolWhether the scrape succeeded
errorstringError message (stub always returns error)
// Note: Requires pipeline environment. This stub returns an error.
let result = scrape.docx({
url: "https://example.com/document.docx"
})
// Use the scrape-docx YAML task instead

Scrape text content from PPTX (PowerPoint) files via a remote scraping service.

ParameterTypeDefaultDescription
urlstringURL of the PPTX file (required)
FieldTypeDescription
successboolWhether the scrape succeeded
errorstringError message (stub always returns error)
// Note: Requires pipeline environment. This stub returns an error.
let result = scrape.pptx({
url: "https://example.com/presentation.pptx"
})
// Use the scrape-pptx YAML task instead

ML pipeline chat, request, and response functions for streaming multi-turn conversations within data pipelines.

Scope: System

FunctionDescription
pipeline.chat()Stream pipeline ML chat with conversation memory
pipeline.request()Stream pipeline request ingestion
pipeline.response()Stream pipeline response delivery

Note: All pipeline functions require a pipeline environment with ProxySelector, pipe, and record context. Use the YAML interface (mlpipeline tasks) for full functionality. The script namespace stubs return errors directing to the YAML interface.

Stream pipeline ML chat. Reads incoming data records, builds chat messages from conversation memory, and delegates to the chat task.

ParameterTypeDefaultDescription
selectionmap{}Model selection criteria
promptkeystringRecord field name containing the user prompt
FieldTypeDescription
successboolWhether the chat succeeded
errorstringError message (stub always returns error)
// Note: Requires pipeline environment. This stub returns an error.
let result = pipeline.chat({
selection: { model: "gpt-4" },
promptkey: "message"
})
// Use the mlpipelinechat/mlpipechat YAML task instead

Stream pipeline request ingestion. Reads incoming data records and forwards them with conversation context.

No additional parameters required beyond pipeline wiring.

FieldTypeDescription
successboolWhether the request was processed
errorstringError message (stub always returns error)
// Note: Requires pipeline environment. This stub returns an error.
let result = pipeline.request({})
// Use the mlpipelinerequest/mlpiperequest YAML task instead

Stream pipeline response delivery. Reads processed records and submits them to an external URL via HTTP POST.

ParameterTypeDefaultDescription
urlstringURL to submit the response to (required)
FieldTypeDescription
successboolWhether the response was delivered
errorstringError message (stub always returns error)
// Note: Requires pipeline environment. This stub returns an error.
let result = pipeline.response({
url: "https://api.example.com/v1/conversation/response"
})
// Use the mlpipelineresponse/mlpiperesponse YAML task instead