Generate text using LLMs

Generate text from a large language model like GPT.

ID: prompt_completion

Input

PropertyTypeDescription
promptstringThe prompt that is fed to the model.
modelstringThe model to use for completion. Make sure to set an API key.
historyarrayConversation 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?'}].
temperaturenumberTemperature of the selected model. Typically, higher temperature means more random output.

Output

PropertyTypeDescription
answerstring
promptstring

Make API request

Make an API request based on provided input and return the response.

ID: api_call

Input

PropertyTypeDescription
urlstringThe URL to make the request to.
methodstringThe HTTP method to use.
headersobjectThe headers to send with the request.
bodyundefinedThe body to send with the request.
response_typestringThe format of the response.

Output

PropertyTypeDescription
response_bodyundefined
statusnumber

JS code transformation

Run JavaScript code to transform any inputs

ID: js_code_transformation

Input

PropertyTypeDescription
codestringThe JS code to execute, returning the value to be used as the output of this transformation.

Output

PropertyTypeDescription
transformedundefined
durationnumber

Vector search for the most relevant content in a dataset.

Easily set up a vector search that returns relevant content

ID: search

Input

PropertyTypeDescription
dataset_idstringThe ID of the dataset to search.
querystringThe query to search for.
vector_fieldstringThe name of the field that contains the vector.
modelstring
content_fieldstring
page_sizenumberThe number of results to return.

Output

PropertyTypeDescription
resultsarray

Vectorize and search provided array

Vectorise an array of strings and rank items by relevance.

ID: search_array

Input

PropertyTypeDescription
arrayarrayThe array of strings to search.
querystringThe query to search for.
page_sizenumberThe number of results to return.

Output

PropertyTypeDescription
resultsarray

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

PropertyTypeDescription
dataset_idstringThe ID of the dataset to search.
documentsarray
ingest_in_backgroundbooleanIf set to true, the step will immediately continue, without waiting for documents to be inserted and available.

Output

PropertyTypeDescription
insertednumber
failed_documentsarray

Generate vector embedding

Generate a vector embedding from a given input with a choice of models.

ID: generate_vector_embedding

Input

PropertyTypeDescription
inputstringThe input to generate a vector embedding with.
modelstring

Output

PropertyTypeDescription
vectorarray

Vector search (redis)

Use Redis to retrieve data using vector search

ID: redis_search

Input

PropertyTypeDescription
indexstringThe name of the index to search.
querystringThe query to search for.
vector_fieldstringThe name of the field that contains the vector.
modelstring
page_sizenumberThe number of results to return.

Output

PropertyTypeDescription
resultsarray

Insert data into Redis

Insert a JSON object into Redis by key.

ID: redis_insert

Input

PropertyTypeDescription
keystringThe key to reference the object
documentobjectThe JSON object to insert
waitbooleanWhether to wait for the insert to complete before continuing to next step

Output

PropertyTypeDescription
insertednumber

Combine array of strings

Combine an array of strings into a single string.

ID: join_array

Input

PropertyTypeDescription
arrayarrayThe array of strings to join.
sepstringThe separator to use between each element when joining the array.

Output

PropertyTypeDescription
textstring

Convert PDF to text

Extract text from PDF without OCR. Doesn’t support handwritting and scans.

ID: pdf_to_text

Input

PropertyTypeDescription
pdf_urlstringThe URL of the PDF to convert to text.

Output

PropertyTypeDescription
textstring

Convert Audio to text

Extract text from Audio.

ID: audio_to_text

Input

PropertyTypeDescription
audio_urlstringThe URL of the Audio to convert to text.

Output

PropertyTypeDescription
textstring

Render Markdown in Notebook

Renders markdown in the notebook. Does not execute any code.

ID: markdown

Input

PropertyTypeDescription
markdownstring

Output

PropertyTypeDescription

Convert string to JSON

Convert a string to a JSON object.

ID: to_json

Input

PropertyTypeDescription
textstringThe string to convert to JSON.

Output

PropertyTypeDescription
outputundefined

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

PropertyTypeDescription
dataundefinedData to store in the file. This could be csv, json content etc.
extensionstringExtension of the file to save to. Defaults to csv

Output

PropertyTypeDescription
export_urlstring

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

PropertyTypeDescription
needlearray,stringKeys to keep in the JSON object.
haystackobjectThe JSON object to filter.

Output

PropertyTypeDescription
filteredundefined

Regex

Extract data from a string using regex and return match. Empty array is returned if no match found.

ID: regex

Input

PropertyTypeDescription
regexstringThe regex to use for extraction, in JS flavor.
stringstringThe string to search for matches.

Output

PropertyTypeDescription
matchundefined
foundboolean

Run chain

Executes an existing chain.

ID: run_chain

Input

PropertyTypeDescription
studio_idstringThe ID of the chain to run.
projectstringThe ID of the project the chain belongs to.
versionstring
paramsundefinedThe parameters to pass to the chain.

Output

PropertyTypeDescription
outputobject
stateobject
statusstring
errorsarray
executionTimenumber

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

PropertyTypeDescription
workflow_idstringThe ID of the workflow to run.
dataset_idstringThe ID of the dataset to run the workflow on.
paramsobjectThe parameters to pass to the workflow.

Output

PropertyTypeDescription
job_idstring

Split text

Split text into an array of strings.

ID: split_text

Input

PropertyTypeDescription
textstringThe text to split.
methodstringSeparator will split the text by the separator. Tokens will split the text into chunks of a given number of tokens.
num_tokensnumberThe number of tokens to split the text into.
sepstringThe separator to split the text by.

Output

PropertyTypeDescription
chunksarray

Combine array

Combine an array of strings into a single array.

ID: combine_array

Input

PropertyTypeDescription
arrayarray
methodstring

Output

PropertyTypeDescription
combinedundefined

Upload temporary file

Upload to a temporary file in S3.

ID: upload_file_s3

Input

PropertyTypeDescription
blobundefined
extensionstring

Output

PropertyTypeDescription
urlstring

Analyse image

Analyse an image using a prompt.

ID: analyse_image

Input

PropertyTypeDescription
image_urlstringURL of the image to analyse. JPEG/JPG, PNG and WebP are supported.
promptstringThe question(s) to answer about the image.

Output

PropertyTypeDescription
outputstring

Truncate text

Truncate text based on token count

ID: truncate_text

Input

PropertyTypeDescription
textundefinedThe text to truncate.
num_tokensnumberThe number of tokens to truncate the text or array by.

Output

PropertyTypeDescription
chunksundefined