View module source on GitHub

AgentCost

class AgentCost(TypedDict)

Type definition for agent execution costs.

Attributes:

NameDescription
inputCost for input tokens
outputCost for output tokens
totalTotal execution cost

AgentUsage

class AgentUsage(TypedDict)

Type definition for agent token usage statistics.

Attributes:

NameDescription
prompt_tokensNumber of tokens used in the prompt
completion_tokensNumber of tokens used in the completion
total_tokensTotal number of tokens used

AgentResponseMeta

class AgentResponseMeta(TypedDict)

Type definition for agent response metadata.

Attributes:

NameDescription
costCost breakdown for the response
usageToken usage statistics
bound_variable_responsesOptional dictionary of bound variable values
retrieved_contextOptional retrieved context string

AgentResponse

@dataclass
class AgentResponse()

Represents a complete agent response with metadata.

This class encapsulates both the actual response content and associated metadata including cost, usage statistics, and contextual information.

Attributes:

NameDescription
responseThe actual response text from the agent
metaMetadata about the response including costs and usage

from_dict

@staticmethod
def from_dict(data: Dict[str, Any]) -> "AgentResponse"

Create an AgentResponse instance from a dictionary.

Arguments:

NameDescription
dataDictionary containing response and meta fields

Returns:

NameDescription
[AgentResponse](/sdk/python/references/models/prompt_chain)New instance created from the dictionary data

PromptNode

@dataclass
class PromptNode()

Node containing a prompt in a prompt chain.

This node type wraps a Prompt object and represents a step in the chain that executes a prompt.

Attributes:

NameDescription
promptThe Prompt object to be executed

CodeBlockNode

@dataclass
class CodeBlockNode()

Node containing executable code in a prompt chain.

This node type contains code that can be executed as part of the prompt chain workflow.

Attributes:

NameDescription
codeThe code string to be executed

ApiParams

@dataclass
class ApiParams()

Parameters for API node configuration.

Attributes:

NameDescription
idUnique identifier for the parameter
keyParameter key name
valueParameter value

ApiNode

@dataclass
class ApiNode()

Node containing API configuration in a prompt chain.

This node type wraps API configuration and represents a step in the chain that makes an API call.

Attributes:

NameDescription
apiDictionary containing API configuration

Node

@dataclass
class Node()

Generic node in a prompt chain.

A Node represents a single step in a prompt chain and can contain different types of content (prompt, code, or API configuration).

Attributes:

NameDescription
orderExecution order of this node in the chain
contentThe actual content (PromptNode, CodeBlockNode, or ApiNode)

from_dict

@staticmethod
def from_dict(data: Dict[str, Any]) -> "Node"

Create a Node instance from a dictionary.

Arguments:

NameDescription
dataDictionary containing order and content type fields

Returns:

NameDescription
[Node](/sdk/python/references/models/prompt_chain)New instance created from the dictionary data

PromptChain

@dataclass
class PromptChain()

Complete prompt chain with versioning information.

A PromptChain represents a complete workflow consisting of multiple nodes that are executed in sequence. Each chain has versioning information for tracking changes over time.

Attributes:

NameDescription
prompt_chain_idUnique identifier for the prompt chain
versionVersion number of this chain
version_idUnique identifier for this specific version
nodesList of nodes that make up the chain

from_dict

@staticmethod
def from_dict(data: Dict[str, Any]) -> "PromptChain"

Create a PromptChain instance from a dictionary.

Arguments:

NameDescription
dataDictionary containing prompt chain data

Returns:

NameDescription
[PromptChain](/sdk/python/references/models/prompt_chain)New instance created from the dictionary data

PromptChainVersionConfig

@dataclass
class PromptChainVersionConfig()

Configuration for a specific prompt chain version.

Contains the actual configuration data (nodes) for a particular version of a prompt chain.

Attributes:

NameDescription
nodesList of nodes in this version configuration

from_dict

@staticmethod
def from_dict(data: Dict[str, Any]) -> "PromptChainVersionConfig"

Create a PromptChainVersionConfig instance from a dictionary.

Arguments:

NameDescription
dataDictionary containing version configuration data

Returns:

NameDescription
[PromptChainVersionConfig](/sdk/python/references/models/prompt_chain)New instance created from the dictionary data

PromptChainVersion

@dataclass
class PromptChainVersion()

Specific version of a prompt chain with metadata.

Represents a particular version of a prompt chain including its configuration, description, and timestamps.

Attributes:

NameDescription
idUnique identifier for this version
versionVersion number
promptChainIdID of the parent prompt chain
descriptionOptional description of this version
configOptional configuration for this version
createdAtTimestamp when this version was created
updatedAtTimestamp when this version was last updated

from_dict

@staticmethod
def from_dict(data: Dict[str, Any]) -> "PromptChainVersion"

Create a PromptChainVersion instance from a dictionary.

Arguments:

NameDescription
dataDictionary containing version data

Returns:

NameDescription
[PromptChainVersion](/sdk/python/references/models/prompt_chain)New instance created from the dictionary data

PromptChainRuleType

@dataclass
class PromptChainRuleType()

Individual rule for prompt chain deployment logic.

Defines a single rule that can be used to determine which version of a prompt chain should be deployed based on various conditions.

Attributes:

NameDescription
fieldThe field to evaluate in the rule
valueThe value to compare against (can be various types including None)
operatorThe comparison operator to use
valueSourceOptional source of the value
exactMatchOptional flag for exact matching

value

adding None here

from_dict

@staticmethod
def from_dict(obj: Dict[str, Any])

Create a PromptChainRuleType instance from a dictionary.

Arguments:

NameDescription
objDictionary containing rule data

Returns:

NameDescription
[PromptChainRuleType](/sdk/python/references/models/prompt_chain)New instance created from the dictionary data

PromptChainRuleGroupType

@dataclass
class PromptChainRuleGroupType()

Group of rules with a combinator for prompt chain deployment logic.

Allows grouping multiple rules together with logical operators (AND/OR) to create complex deployment conditions.

Attributes:

NameDescription
rulesList of rules or nested rule groups
combinatorLogical operator to combine rules (“and” or “or”)

from_dict

@staticmethod
def from_dict(obj: Dict[str, Any])

Create a PromptChainRuleGroupType instance from a dictionary.

Arguments:

NameDescription
objDictionary containing rule group data

Returns:

NameDescription
[PromptChainRuleGroupType](/sdk/python/references/models/prompt_chain)New instance created from the dictionary data

PromptChainDeploymentRules

@dataclass
class PromptChainDeploymentRules()

Deployment rules for a specific prompt chain version.

Defines the conditions under which a particular version of a prompt chain should be deployed or used.

Attributes:

NameDescription
versionThe version number these rules apply to
queryOptional rule group that defines the deployment conditions

from_dict

@staticmethod
def from_dict(obj: Dict[str, Any])

Create a PromptChainDeploymentRules instance from a dictionary.

Arguments:

NameDescription
objDictionary containing deployment rules data

Returns:

NameDescription
[PromptChainDeploymentRules](/sdk/python/references/models/prompt_chain)New instance created from the dictionary data

VersionSpecificDeploymentConfig

@dataclass
class VersionSpecificDeploymentConfig()

Configuration for deploying a specific version.

Contains deployment configuration including rules, timestamps, and fallback information for a particular version.

Attributes:

NameDescription
idUnique identifier for this deployment configuration
timestampWhen this configuration was created
rulesThe deployment rules for this configuration
isFallbackWhether this is a fallback configuration

from_dict

@staticmethod
def from_dict(obj: Dict[str, Any])

Create a VersionSpecificDeploymentConfig instance from a dictionary.

Arguments:

NameDescription
objDictionary containing deployment configuration data

Returns:

NameDescription
[VersionSpecificDeploymentConfig](/sdk/python/references/models/prompt)New instance created from the dictionary data

PromptChainVersionsAndRules

@dataclass
class PromptChainVersionsAndRules()

Container for prompt chain versions and their deployment rules.

Aggregates all versions of a prompt chain along with their associated deployment rules and folder organization.

Attributes:

NameDescription
folderIdID of the folder containing this prompt chain
rulesDictionary mapping rule IDs to lists of deployment configurations
versionsList of all available versions
fallbackVersionOptional fallback version to use when rules don’t match

from_dict

@staticmethod
def from_dict(obj: Dict[str, Any])

Create a PromptChainVersionsAndRules instance from a dictionary.

Arguments:

NameDescription
objDictionary containing versions and rules data

Returns:

NameDescription
[PromptChainVersionsAndRules](/sdk/python/references/models/prompt_chain)New instance created from the dictionary data

VersionAndRulesWithPromptChainId

@dataclass
class VersionAndRulesWithPromptChainId(PromptChainVersionsAndRules)

Extension of PromptChainVersionsAndRules that includes the prompt chain ID.

Provides the same functionality as PromptChainVersionsAndRules but also includes the prompt chain identifier for complete context.

Attributes:

NameDescription
promptChainIdUnique identifier of the prompt chain

Inherits all attributes from PromptChainVersionsAndRules

from_dict

@staticmethod
def from_dict(obj: Dict[str, Any])

Create a VersionAndRulesWithPromptChainId instance from a dictionary.

Arguments:

NameDescription
objDictionary containing versions, rules, and prompt chain ID data

Returns:

NameDescription
[VersionAndRulesWithPromptChainId](/sdk/python/references/models/prompt_chain)New instance created from the dictionary data

MaximApiPromptChainResponse

@dataclass
class MaximApiPromptChainResponse()

Response wrapper for single prompt chain API calls.

Encapsulates the response from API calls that return information about a single prompt chain, including error handling.

Attributes:

NameDescription
dataThe prompt chain versions and rules data
errorOptional error information if the API call failed

from_dict

@staticmethod
def from_dict(data: Dict[str, Any]) -> "MaximApiPromptChainResponse"

Create a MaximApiPromptChainResponse instance from a dictionary.

Arguments:

NameDescription
dataDictionary containing API response data

Returns:

NameDescription
[MaximApiPromptChainResponse](/sdk/python/references/models/prompt_chain)New instance created from the dictionary data

PromptChainWithId

@dataclass
class PromptChainWithId(PromptChainVersionsAndRules)

Prompt chain versions and rules with associated prompt chain ID.

Similar to VersionAndRulesWithPromptChainId but used in different contexts. Contains all version and rule information along with the prompt chain identifier.

Attributes:

NameDescription
promptChainIdUnique identifier of the prompt chain

Inherits all attributes from PromptChainVersionsAndRules

from_dict

@staticmethod
def from_dict(obj: Dict[str, Any])

Create a PromptChainWithId instance from a dictionary.

Arguments:

NameDescription
objDictionary containing prompt chain data with ID

Returns:

NameDescription
[PromptChainWithId](/sdk/python/references/models/prompt_chain)New instance created from the dictionary data

VersionAndRulesWithPromptChainIdEncoder

class VersionAndRulesWithPromptChainIdEncoder(json.JSONEncoder)

Custom JSON encoder for VersionAndRulesWithPromptChainId objects.

Provides serialization support for VersionAndRulesWithPromptChainId instances by converting them to dictionaries.

default

def default(o)

Convert VersionAndRulesWithPromptChainId objects to dictionaries.

Arguments:

NameDescription
oObject to encode

Returns:

NameDescription
dictDictionary representation of the object, or calls parent default

MaximApiPromptChainsResponse

@dataclass
class MaximApiPromptChainsResponse()

Response wrapper for multiple prompt chains API calls.

Encapsulates the response from API calls that return information about multiple prompt chains, including error handling.

Attributes:

NameDescription
dataList of prompt chains with their versions and rules
errorOptional error information if the API call failed

from_dict

@staticmethod
def from_dict(incoming_data: Dict[str, Any]) -> "MaximApiPromptChainsResponse"

Create a MaximApiPromptChainsResponse instance from a dictionary.

Arguments:

NameDescription
incoming_dataDictionary containing API response data for multiple chains

Returns:

NameDescription
[MaximApiPromptChainsResponse](/sdk/python/references/models/prompt_chain)New instance created from the dictionary data