Skip to main content
View module source on GitHub

ConnectionPool

Manages HTTP session pooling for efficient network requests. This class provides a reusable session with retry logic for handling transient network errors.

__init__

Initialize a new session with retry configuration.

get_session

Context manager that yields the session and ensures it’s closed after use. Yields:
  • requests.Session - The HTTP session object

MaximAPI

Client for interacting with the Maxim API. This class provides methods for all available Maxim API endpoints, handling authentication, request formatting, and error handling.

__init__

Initialize a new Maxim API client. Arguments:

get_prompt

Get a prompt by ID. Arguments: Returns: Raises:
  • Exception - If the request fails

get_prompts

Get all prompts. Returns: Raises:
  • Exception - If the request fails

getPromptChain

Get a prompt chain by ID. Arguments: Returns: Raises:
  • Exception - If the request fails

get_prompt_chains

Get all prompt chains. Returns: Raises:
  • Exception - If the request fails

run_prompt

Run a custom prompt with the specified model and messages. Arguments: Returns: Raises:
  • Exception - If the request fails

run_prompt_version

Run a specific prompt version with the given input. Arguments: Returns: Raises:
  • Exception - If the request fails

run_prompt_chain_version

Run a specific prompt chain version with the given input. Arguments: Returns: Raises:
  • Exception - If the request fails

get_folder

Get a folder by ID. Arguments: Returns: Raises:
  • Exception - If the request fails

get_folders

Get all folders. Returns: Raises:
  • Exception - If the request fails

add_dataset_entries

Add entries to a dataset. Arguments: Returns: dict[str, Any]: Response from the API Raises:
  • Exception - If the request fails

get_dataset_total_rows

Get the total number of rows in a dataset. Arguments: Returns: Raises:
  • Exception - If the request fails

get_dataset_row

Get a specific row from a dataset. Arguments: Returns: Raises:
  • Exception - If the request fails

get_dataset_structure

Get the structure of a dataset. Arguments: Returns: Dict[str, str]: The dataset structure Raises:
  • Exception - If the request fails

does_log_repository_exist

Check if a log repository exists. Arguments: Returns:

push_logs

Push logs to a repository. Arguments: Raises:
  • Exception - If the request fails

fetch_platform_evaluator

Fetch a platform evaluator by name. Arguments: Returns: Raises:
  • Exception - If the request fails

create_test_run

Create a new test run. Arguments: Returns: Raises:
  • Exception - If the request fails

attach_dataset_to_test_run

Attach a dataset to a test run. Arguments: Raises:
  • Exception - If the request fails

push_test_run_entry

Push an entry to a test run. Arguments: Raises:
  • Exception - If the request fails

mark_test_run_processed

Mark a test run as processed. Arguments: Raises:
  • Exception - If the request fails

mark_test_run_failed

Mark a test run as failed. Arguments: Raises:
  • Exception - If the request fails

get_test_run_status

Get the status of a test run. Arguments: Returns: Raises:
  • Exception - If the request fails

get_test_run_final_result

Get the final result of a test run. Arguments: Returns: Raises:
  • Exception - If the request fails

get_upload_url

Get a signed URL for uploading a file. Arguments: Returns: Raises:
  • Exception - If the request fails

upload_to_signed_url

Upload data to a signed URL using multipart form data with retry logic. Arguments: Returns: