Documentation Index
Fetch the complete documentation index at: https://www.getmaxim.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
View module source on GitHub
Represents an incoming query with its components.
Attributes:
| Name | Type | Description |
|---|
query | str | The query string. |
operator | str | The operator used in the query. |
exactMatch | bool | Indicates whether the query requires an exact match. |
__init__
def __init__(query: str, operator: str, exactMatch: bool)
Initialize an IncomingQuery object.
Arguments:
| Name | Type | Description |
|---|
query | str | The query string. |
operator | str | The operator used in the query. |
exactMatch | bool | Indicates whether the query requires an exact match. |
Represents a query object with its components.
Attributes:
| Name | Type | Description |
|---|
id | str | The ID of the query object. |
query | RuleGroupType | The query object. |
parse_incoming_query
def parse_incoming_query(incoming_query: str) -> List[RuleType]
Parses an incoming query string into a list of RuleType objects.
Arguments:
| Name | Type | Description |
|---|
incomingQuery | str | The incoming query string. |
Returns:
| Name | Description |
|---|
List[[RuleType](/sdk/python/references/models/prompt)] | A list of RuleType objects. |
evaluate_rule_group
def evaluate_rule_group(rule_group: RuleGroupType,
incoming_query_rules: List[RuleType]) -> bool
Evaluates a rule group against incoming query rules.
Arguments:
| Name | Type | Description |
|---|
ruleGroup | RuleGroupType | The rule group to evaluate. |
incomingQueryRules | List[RuleType] | The incoming query rules. |
Returns:
| Name | Description |
|---|
bool | True if the rule group matches, False otherwise. |
check_operator_match
def check_operator_match(field_rule: RuleType,
field_incoming_rule: RuleType) -> bool
Checks if the operator between two rules matches.
Arguments:
| Name | Type | Description |
|---|
fieldRule | RuleType | The rule with the operator. |
fieldIncomingRule | RuleType | The incoming rule. |
Returns:
| Name | Description |
|---|
bool | True if the operator matches, False otherwise. |
condition_met
def condition_met(field_rule: RuleType, field_incoming_rule: RuleType) -> bool
Checks if the condition between two rules is met.
Arguments:
| Name | Type | Description |
|---|
fieldRule | RuleType | The rule with the condition. |
fieldIncomingRule | RuleType | The incoming rule. |
Returns:
| Name | Description |
|---|
bool | True if the condition is met, False otherwise. |
find_best_match
def find_best_match(objects: List[QueryObject],
incoming_query: IncomingQuery) -> Optional[QueryObject]
Finds the best match for the incoming query among the list of objects.
Arguments:
| Name | Type | Description |
|---|
objects | List[QueryObject] | The list of objects to search through. |
incomingQuery | IncomingQuery | The incoming query to match against. |
Returns:
| Name | Description |
|---|
Optional[[QueryObject](/sdk/python/references/filter_objects)] | The best match for the incoming query, or None if no match is found. |
find_all_matches
def find_all_matches(objects: List[QueryObject],
incoming_query: IncomingQuery) -> List[QueryObject]
Finds all matches for the incoming query among the list of objects.
Arguments:
| Name | Type | Description |
|---|
objects | List[QueryObject] | The list of objects to search through. |
incoming_query | IncomingQuery | The incoming query to match against. |
Returns:
| Name | Description |
|---|
List[[QueryObject](/sdk/python/references/filter_objects)] | A list of all matches for the incoming query. |