Natively Supported Helper Functions
This client provides an interface to interact with the Relevance API. It includes functions to run various steps, insert and retrieve data, and upload temporary files.
Inserts data into a Relevance dataset.
Arguments
dataset_id
: The ID of the dataset to insert into.data
: A list of dictionaries containing the data to insert.Returns
Retrieves data from a Relevance dataset.
Arguments
dataset_id
: The ID of the dataset to retrieve from.page_size
: The number of results to return per page (optional).include_fields
: A list of fields to include in the response (optional).Returns
Retrieves all data from a Relevance dataset, paginated to handle large datasets.
Arguments
dataset_id
: The ID of the dataset to retrieve from.page_size
: The number of results to return per page. Defaults to 1000 (optional).include_fields
: A list of fields to include in the response. Defaults to None (optional).Returns
Example
Uploads a temporary file to Relevance.
Arguments
file_path_or_bytes
: The path to the file or the file contents as bytes.ext
: The file extension (optional).Returns
Runs the prompt_completion
step with the given prompt and model.
Arguments
prompt
: The prompt to complete.model
: The model to use for completion (optional).Returns
Runs a Relevance step with the given name and parameters.
Arguments
step_name
: The name of the step to run.params
: A dictionary of parameters to pass to the step.Returns
Note: Make sure to replace the region
variable with your actual region.