new Maxim(Defined in: src/lib/maxim.ts:199 Creates a new Maxim SDK instance.config
):Maxim
Config
Configuration object for the SDK
Maxim
cleanup()
before your application
exits. Failure to do so may result in memory leaks, unflushed data, or
hanging processes. This is especially important in production environments
and long-running applications.
addDatasetEntries(Defined in: src/lib/maxim.ts:1123 This method is used to add entries to a datasetdatasetId
,entries
):Promise
<void
>
string
Dataset id to add entries to
DatasetEntry
[]
Entries to add to the dataset
Promise
<void
>
void
cleanup():Defined in: src/lib/maxim.ts:1260 Cleans up all SDK resources and prepares for application shutdown. This method performs essential cleanup operations including stopping sync intervals, flushing logger data, clearing caches, and destroying HTTP agents. It ensures proper resource deallocation and prevents memory leaks.Promise
<void
>
Promise
<void
>
createTestRun(Defined in: src/lib/maxim.ts:1220 This method is used to create a test runname
,inWorkspaceId
):TestRunBuilder
<undefined
>
string
Name of the test run
string
Workspace Id to create the test run in
TestRunBuilder
<undefined
>
Test run instance
getFolderById(Defined in: src/lib/maxim.ts:1041 This method is used to get a folder by idfolderId
):Promise
<undefined
|Folder
>
string
Folder id to fetch
Promise
<undefined
| Folder
>
a single folder
getFolders(Defined in: src/lib/maxim.ts:1081 This method is used to get all folders that match the query rulerule
):Promise
<undefined
|Folder
[]>
QueryRule
Query rule to match
Promise
<undefined
| Folder
[]>
Array of folders
getPrompt(Defined in: src/lib/maxim.ts:768 Retrieves a specific prompt by ID that matches the given query rule. This method fetches a prompt from the Maxim platform based on deployment rules and query criteria. It supports versioning and rule-based prompt selection.promptId
,rule
):Promise
<undefined
|Prompt
>
string
The unique identifier of the prompt to fetch
QueryRule
Query rule defining deployment variables, tags, and matching criteria
Promise
<undefined
| Prompt
>
The matching prompt with run capabilities, or undefined if not found
getPromptChain(Defined in: src/lib/maxim.ts:919 Retrieves a specific prompt chain by ID that matches the given query rule. This method fetches a prompt chain from the Maxim platform based on deployment rules and query criteria. It supports versioning and rule-based prompt chain selection. Prompt chains allow you to orchestrate multiple prompts in sequence with conditional logic.promptChainId
,rule
):Promise
<undefined
|PromptChain
>
string
The unique identifier of the prompt chain to fetch
QueryRule
Query rule defining deployment variables, tags, and matching criteria
Promise
<undefined
| PromptChain
>
The matching prompt chain with run capabilities, or undefined if not found
getPromptChains(Defined in: src/lib/maxim.ts:990 Retrieves all prompt chains that match the given query rule. This method fetches multiple prompt chains from the Maxim platform based on deployment rules and query criteria. Useful for getting all prompt chains within a specific folder or matching certain deployment variables.rule
):Promise
<undefined
|PromptChain
[]>
QueryRule
Query rule defining deployment variables, tags, and matching criteria
Promise
<undefined
| PromptChain
[]>
Array of matching prompt chains with run capabilities, or undefined if none found
getPrompts(Defined in: src/lib/maxim.ts:839 Retrieves all prompts that match the given query rule. This method fetches multiple prompts from the Maxim platform based on deployment rules and query criteria. Useful for getting all prompts within a specific folder or matching certain deployment variables.rule
):Promise
<undefined
|Prompt
[]>
QueryRule
Query rule defining deployment variables, tags, and matching criteria
Promise
<undefined
| Prompt
[]>
Array of matching prompts with run capabilities, or undefined if none found
logger(Defined in: src/lib/maxim.ts:1173 Creates a logger instance for capturing observability data. The logger provides methods for tracking sessions, traces, generations, and other observability events. It handles buffering, batching, and sending data to the Maxim platform.config
):Promise
<undefined
|MaximLogger
>
LoggerConfig
Configuration for the logger instance
Promise
<undefined
| MaximLogger
>
Logger instance for capturing observability data, or undefined if creation fails