Step options
Library of transformations that can be used in chain steps
Generate text using LLMs
Generate text from a large language model like GPT.
ID: prompt_completion
Input
Property | Type | Description |
---|---|---|
prompt | string | The prompt that is fed to the model. |
model | string | The model to use for completion. Make sure to set an API key. |
history | array | Conversation history to be passed into the prompt. For example, [{role: 'user', message: 'Hello, my name is Bob.'}, {role: 'ai', message: 'Hello Bob, how are you?'}] . |
temperature | number | Temperature of the selected model. Typically, higher temperature means more random output. |
Output
Property | Type | Description |
---|---|---|
answer | string | |
prompt | string |
Make API request
Make an API request based on provided input and return the response.
ID: api_call
Input
Property | Type | Description |
---|---|---|
url | string | The URL to make the request to. |
method | string | The HTTP method to use. |
headers | object | The headers to send with the request. |
body | undefined | The body to send with the request. |
response_type | string | The format of the response. |
Output
Property | Type | Description |
---|---|---|
response_body | undefined | |
status | number |
JS code transformation
Run JavaScript code to transform any inputs
ID: js_code_transformation
Input
Property | Type | Description |
---|---|---|
code | string | The JS code to execute, returning the value to be used as the output of this transformation. |
Output
Property | Type | Description |
---|---|---|
transformed | undefined | |
duration | number |
Vector search for the most relevant content in a dataset.
Easily set up a vector search that returns relevant content
ID: search
Input
Property | Type | Description |
---|---|---|
dataset_id | string | The ID of the dataset to search. |
query | string | The query to search for. |
vector_field | string | The name of the field that contains the vector. |
model | string | |
content_field | string | |
page_size | number | The number of results to return. |
Output
Property | Type | Description |
---|---|---|
results | array |
Vectorize and search provided array
Vectorise an array of strings and rank items by relevance.
ID: search_array
Input
Property | Type | Description |
---|---|---|
array | array | The array of strings to search. |
query | string | The query to search for. |
page_size | number | The number of results to return. |
Output
Property | Type | Description |
---|---|---|
results | array |
Update Documents in a Dataset.
Update documents in a chosen dataset. If a list of strings is used as documents, ids will automatically be chosen from 0 to documents.length.
ID: bulk_update
Input
Property | Type | Description |
---|---|---|
dataset_id | string | The ID of the dataset to search. |
documents | array | |
ingest_in_background | boolean | If set to true, the step will immediately continue, without waiting for documents to be inserted and available. |
Output
Property | Type | Description |
---|---|---|
inserted | number | |
failed_documents | array |
Generate vector embedding
Generate a vector embedding from a given input with a choice of models.
ID: generate_vector_embedding
Input
Property | Type | Description |
---|---|---|
input | string | The input to generate a vector embedding with. |
model | string |
Output
Property | Type | Description |
---|---|---|
vector | array |
Vector search (redis)
Use Redis to retrieve data using vector search
ID: redis_search
Input
Property | Type | Description |
---|---|---|
index | string | The name of the index to search. |
query | string | The query to search for. |
vector_field | string | The name of the field that contains the vector. |
model | string | |
page_size | number | The number of results to return. |
Output
Property | Type | Description |
---|---|---|
results | array |
Insert data into Redis
Insert a JSON object into Redis by key.
ID: redis_insert
Input
Property | Type | Description |
---|---|---|
key | string | The key to reference the object |
document | object | The JSON object to insert |
wait | boolean | Whether to wait for the insert to complete before continuing to next step |
Output
Property | Type | Description |
---|---|---|
inserted | number |
Combine array of strings
Combine an array of strings into a single string.
ID: join_array
Input
Property | Type | Description |
---|---|---|
array | array | The array of strings to join. |
sep | string | The separator to use between each element when joining the array. |
Output
Property | Type | Description |
---|---|---|
text | string |
Convert PDF to text
Extract text from PDF without OCR. Doesn’t support handwritting and scans.
ID: pdf_to_text
Input
Property | Type | Description |
---|---|---|
pdf_url | string | The URL of the PDF to convert to text. |
Output
Property | Type | Description |
---|---|---|
text | string |
Convert Audio to text
Extract text from Audio.
ID: audio_to_text
Input
Property | Type | Description |
---|---|---|
audio_url | string | The URL of the Audio to convert to text. |
Output
Property | Type | Description |
---|---|---|
text | string |
Render Markdown in Notebook
Renders markdown in the notebook. Does not execute any code.
ID: markdown
Input
Property | Type | Description |
---|---|---|
markdown | string |
Output
Property | Type | Description |
---|
Convert string to JSON
Convert a string to a JSON object.
ID: to_json
Input
Property | Type | Description |
---|---|---|
text | string | The string to convert to JSON. |
Output
Property | Type | Description |
---|---|---|
output | undefined |
Export data to a temporary downloadable file.
Export data to a temporary downloadable file. It will be deleted after 1 hour automatically.
ID: export_to_file
Input
Property | Type | Description |
---|---|---|
data | undefined | Data to store in the file. This could be csv, json content etc. |
extension | string | Extension of the file to save to. Defaults to csv |
Output
Property | Type | Description |
---|---|---|
export_url | string |
Filter out keys in JSON object
Given a string or array of strings, filter out all other keys in the JSON object.
ID: object_key_filter
Input
Property | Type | Description |
---|---|---|
needle | array,string | Keys to keep in the JSON object. |
haystack | object | The JSON object to filter. |
Output
Property | Type | Description |
---|---|---|
filtered | undefined |
Regex
Extract data from a string using regex and return match. Empty array is returned if no match found.
ID: regex
Input
Property | Type | Description |
---|---|---|
regex | string | The regex to use for extraction, in JS flavor. |
string | string | The string to search for matches. |
Output
Property | Type | Description |
---|---|---|
match | undefined | |
found | boolean |
Run chain
Executes an existing chain.
ID: run_chain
Input
Property | Type | Description |
---|---|---|
studio_id | string | The ID of the chain to run. |
project | string | The ID of the project the chain belongs to. |
version | string | |
params | undefined | The parameters to pass to the chain. |
Output
Property | Type | Description |
---|---|---|
output | object | |
state | object | |
status | string | |
errors | array | |
executionTime | number |
Start workflow
Executes a workflow. It will not wait for the workflow to finish, instead running it in the background. The workflows job_id can be used to monitor its progress.
ID: trigger_workflow
Input
Property | Type | Description |
---|---|---|
workflow_id | string | The ID of the workflow to run. |
dataset_id | string | The ID of the dataset to run the workflow on. |
params | object | The parameters to pass to the workflow. |
Output
Property | Type | Description |
---|---|---|
job_id | string |
Split text
Split text into an array of strings.
ID: split_text
Input
Property | Type | Description |
---|---|---|
text | string | The text to split. |
method | string | Separator will split the text by the separator. Tokens will split the text into chunks of a given number of tokens. |
num_tokens | number | The number of tokens to split the text into. |
sep | string | The separator to split the text by. |
Output
Property | Type | Description |
---|---|---|
chunks | array |
Combine array
Combine an array of strings into a single array.
ID: combine_array
Input
Property | Type | Description |
---|---|---|
array | array | |
method | string |
Output
Property | Type | Description |
---|---|---|
combined | undefined |
Upload temporary file
Upload to a temporary file in S3.
ID: upload_file_s3
Input
Property | Type | Description |
---|---|---|
blob | undefined | |
extension | string |
Output
Property | Type | Description |
---|---|---|
url | string |
Analyse image
Analyse an image using a prompt.
ID: analyse_image
Input
Property | Type | Description |
---|---|---|
image_url | string | URL of the image to analyse. JPEG/JPG, PNG and WebP are supported. |
prompt | string | The question(s) to answer about the image. |
Output
Property | Type | Description |
---|---|---|
output | string |
Truncate text
Truncate text based on token count
ID: truncate_text
Input
Property | Type | Description |
---|---|---|
text | undefined | The text to truncate. |
num_tokens | number | The number of tokens to truncate the text or array by. |
Output
Property | Type | Description |
---|---|---|
chunks | undefined |
Was this page helpful?