Skip to content

dto

v1 data transfer objects (DTOs) for the Eleanor API.

This module defines the v1 data transfer objects (DTOs) for the Eleanor API. These DTOs are used for data validation, serialization, and deserialization in the API endpoints. They provide a structured representation of the data exchanged between the client and the server.

Attributes

RESOURCE_CREATE_TS_DOC module-attribute

RESOURCE_CREATE_TS_DOC = 'Timestamp of resource creation'

RESOURCE_DELETED_DOC module-attribute

RESOURCE_DELETED_DOC = "Flag that indicates whether the resource has been soft-deleted"

RESOURCE_DESC_DOC module-attribute

RESOURCE_DESC_DOC = 'Free-form description of the resource'

RESOURCE_ENABLED_DOC module-attribute

RESOURCE_ENABLED_DOC = (
    "Flag that indicates whether the resource is enabled"
)

RESOURCE_MANAGED_DOC module-attribute

RESOURCE_MANAGED_DOC = (
    "Flag that indicates whether the resource is managed"
)

RESOURCE_NAME_DOC module-attribute

RESOURCE_NAME_DOC = 'Resource name'

RESOURCE_PKID_DOC module-attribute

RESOURCE_PKID_DOC = 'Resource primary key identifier'

RESOURCE_UPDATE_TS_DOC module-attribute

RESOURCE_UPDATE_TS_DOC = "Timestamp of resource last update"

SETTINGS_DOC module-attribute

SETTINGS_DOC = 'List of resource settings'

SETTING_KEY_DOC module-attribute

SETTING_KEY_DOC = 'Setting key'

SETTING_VALUE_DOC module-attribute

SETTING_VALUE_DOC = 'Setting value'

SETTING_VERSION_DOC module-attribute

SETTING_VERSION_DOC = 'Setting version'

Classes

AgentCreateRequestV1

Bases: BaseRequest

Create new agent request object

Attributes

description class-attribute instance-attribute
description: str = Field(
    default="", description=RESOURCE_DESC_DOC
)
enabled class-attribute instance-attribute
enabled: bool = Field(
    default=True, description=RESOURCE_ENABLED_DOC
)
episodic_memory_collection_config class-attribute instance-attribute
episodic_memory_collection_config: str = Field(
    default="{}", description=comment
)
managed class-attribute instance-attribute
managed: bool = Field(
    default=False, description=RESOURCE_MANAGED_DOC
)
name class-attribute instance-attribute
name: str = Field(..., description=RESOURCE_NAME_DOC)
settings class-attribute instance-attribute
settings: AgentResourceSettings = Field(
    default_factory=AgentResourceSettings,
    description=__doc__,
)

AgentCreateResponseV1

Bases: BaseResponse

Create new agent response object

Attributes

agent class-attribute instance-attribute
agent: AgentV1 = Field(..., description=__doc__)

AgentGetResponseV1

Bases: BaseResponse

Agent response object

Attributes

agent class-attribute instance-attribute
agent: AgentV1 = Field(..., description=__doc__)

AgentLookupMemoriesResponseV1

Bases: BaseResponse

Agent lookup memories response object

Attributes

memories class-attribute instance-attribute
memories: GetMemoriesResponse = Field(
    ..., title="Memories", description=__doc__
)

AgentPersonaResponseV1

Bases: BaseResponse

Derive agent values response

Attributes

persona class-attribute instance-attribute
persona: str = Field(
    default="",
    title="Persona Statement",
    description="Derived persona for the agent",
)

AgentReVoiceRequestV1

Bases: BaseRequest

Agent ReVoice request object

Attributes

agent_memory_settings class-attribute instance-attribute
agent_memory_settings: MemoryRecallSettingsV1 = Field(
    default_factory=None,
    title="Agent Memory Recall Settings",
    description="Memory recall settings for the agent during re-voice operation",
)
memory_txt_context class-attribute instance-attribute
memory_txt_context: str | None = Field(
    default=None,
    title="Memory Text Context",
    description="",
)
queue class-attribute instance-attribute
queue: str | None = Field(
    default=None,
    title="Queue",
    description="CheckMate queue name",
)
source_memory_settings class-attribute instance-attribute
source_memory_settings: MemoryRecallSettingsV1 = Field(
    default_factory=None,
    title="Source Memory Recall Settings",
    description="Memory recall settings for the source collection during re-voice operation",
)
tags class-attribute instance-attribute
tags: List[str] | None = Field(
    default=None,
    title="Tags",
    description="CheckMate task tag(s)",
)
vector_txt_context class-attribute instance-attribute
vector_txt_context: str | None = Field(
    default=None,
    title="Vector Text Context",
    description="",
)

AgentUpdateRequestV1

Bases: BaseRequest

Update agent object

Attributes

description class-attribute instance-attribute
description: Optional[str] = Field(
    None, description=RESOURCE_DESC_DOC
)
dynamic_persona class-attribute instance-attribute
dynamic_persona: Optional[str] = Field(
    None, description=comment
)
enabled class-attribute instance-attribute
enabled: Optional[bool] = Field(
    None, description=RESOURCE_ENABLED_DOC
)
managed class-attribute instance-attribute
managed: Optional[bool] = Field(
    None, description=RESOURCE_MANAGED_DOC
)
name class-attribute instance-attribute
name: Optional[str] = Field(
    None, description=RESOURCE_NAME_DOC
)
settings class-attribute instance-attribute
settings: Optional[AgentResourceSettings] = Field(
    None, description=__doc__
)

AgentUpdateResponseV1

Bases: BaseResponse

Update agent response object

Attributes

agent class-attribute instance-attribute
agent: AgentV1 = Field(..., description=__doc__)

AgentV1

Bases: BaseResourceV1

Attributes

__doc__ class-attribute instance-attribute
__doc__ = __doc__
collections class-attribute instance-attribute
collections: List[CollectionV1] = Field(
    default_factory=list,
    title="Collections",
    description="A list of memory collections bound to the agent",
)
dynamic_persona class-attribute instance-attribute
dynamic_persona: Optional[str] = Field(
    None, title="Dynamic Persona", description=comment
)
dynamic_persona_updated class-attribute instance-attribute
dynamic_persona_updated: Optional[datetime] = Field(
    None,
    title="Dynamic Persona Statement Update Timestamp",
    description=comment,
)
namespace_pkid class-attribute instance-attribute
namespace_pkid: str = Field(
    ..., title="Namespace PKID", description=comment
)
settings class-attribute instance-attribute
settings: AgentResourceSettings = Field(
    ..., title="Agent Settings", description=__doc__
)

Functions

from_orm_model staticmethod
from_orm_model(model: Agent) -> AgentV1

BaseResourceV1

Bases: BaseModel

Resource base class

Attributes

create_ts class-attribute instance-attribute
create_ts: datetime = Field(
    ..., description=RESOURCE_CREATE_TS_DOC
)
deleted class-attribute instance-attribute
deleted: bool = Field(..., description=RESOURCE_DELETED_DOC)
description class-attribute instance-attribute
description: Optional[str] = Field(
    default=None, description=RESOURCE_DESC_DOC
)
enabled class-attribute instance-attribute
enabled: bool = Field(..., description=RESOURCE_ENABLED_DOC)
managed class-attribute instance-attribute
managed: bool = Field(
    default=False, description=RESOURCE_MANAGED_DOC
)
name class-attribute instance-attribute
name: str = Field(..., description=RESOURCE_NAME_DOC)
pkid class-attribute instance-attribute
pkid: str = Field(..., description=RESOURCE_PKID_DOC)
update_ts class-attribute instance-attribute
update_ts: datetime = Field(
    ..., description=RESOURCE_UPDATE_TS_DOC
)

BaseSettingV1

Bases: BaseModel

Setting base class

Attributes

key class-attribute instance-attribute
key: str = Field(..., description=SETTING_KEY_DOC)
value class-attribute instance-attribute
value: str = Field(..., description=SETTING_VALUE_DOC)
version class-attribute instance-attribute
version: int = Field(..., description=SETTING_VERSION_DOC)

CancelTaskRequestV1

Bases: BaseModel

Request object for canceling one or more tasks

Attributes

task_ids class-attribute instance-attribute
task_ids: Union[List[str], str] | None = Field(
    default_factory=list,
    title="Task IDs",
    description="Task ID(s) to cancel",
)

Functions

validate_task_ids classmethod
validate_task_ids(
    value: Union[List[str], str]
) -> List[str]

Validate and normalize the task_ids field.

Parameters:

  • value (Union[List[str], str]) –

    The task ID(s) to validate.

Returns:

  • List[str]

    List[str]: The list of task IDs.

CancelTaskResponseV1

Bases: BaseResponse

Response object returned when canceling CheckMate task(s)

Attributes

fail_count class-attribute instance-attribute
fail_count: int = Field(
    ...,
    ge=0,
    title="Fail Count",
    description="Count of tasks that failed to cancel",
)
fail_results class-attribute instance-attribute
fail_results: List[CheckMateTaskBatchResultV1] = Field(
    ...,
    title="Failed Results",
    description="A list of tasks that failed to cancel",
)
success_count class-attribute instance-attribute
success_count: int = Field(
    ...,
    ge=0,
    title="Success Count",
    description="Count of successfully canceled tasks",
)
success_results class-attribute instance-attribute
success_results: List[CheckMateTaskBatchResultV1] = Field(
    ...,
    title="Successful Results",
    description="A list of tasks that were successfully canceled",
)

Functions

from_service_response staticmethod
from_service_response(
    service_response: Tuple[
        List[CheckMateTaskBatchResult],
        List[CheckMateTaskBatchResult],
    ]
) -> CancelTaskResponseV1

ChainTokenLimitsRequestV1

Bases: BaseRequest

Chain token limits request object

Attributes

base_template class-attribute instance-attribute
base_template: Dict[str, Any] | None = Field(
    default=None,
    title="Base Template",
    description="When provided, this template will be used to render the chain's prompt template and account for these tokens when calculating the maximum input token length.",
)
default_output_token_pct class-attribute instance-attribute
default_output_token_pct: float = Field(
    default=0.25,
    title="Default Token Percentage",
    description="When the ``max_tokens`` value cannot be determined on the chain or the chain's LLM, this percentage will be used to derive the maximum output tokens from the LLM's max_position_embeddings value.",
)

ChainTokenLimitsResponseV1

Bases: BaseResponse

Chain token limits response object

Attributes

max_input_tokens class-attribute instance-attribute
max_input_tokens: int = Field(
    ...,
    title="Maximum Input Tokens",
    description="Maximum number of input tokens possible for the chain",
)
max_output_tokens class-attribute instance-attribute
max_output_tokens: int = Field(
    ...,
    title="Maximum Output Tokens",
    description="Maximum number of output tokens possible for the chain",
)

CheckMateTaskBatchResultV1

Bases: BaseDataModel

CheckMate task batch result

Used for service operations that return a list of task results, particularly when a mixture of success / failures is possible.

Attributes

error class-attribute instance-attribute
error: str | None = Field(
    None,
    title="Error",
    description="Error message if an error occurred during processing",
)
status class-attribute instance-attribute
status: StageStatus = Field(
    ...,
    title="Status",
    description="The current status of the task",
)
task_id class-attribute instance-attribute
task_id: str = Field(
    ...,
    title="TaskID",
    description="The unique identifier of the task",
)

CleanTaskResponseV1

Bases: BaseResponse

Response object returned when cleaning CheckMate task(s)

Attributes

fail_count class-attribute instance-attribute
fail_count: int = Field(
    ...,
    ge=0,
    title="Fail Count",
    description="Count of tasks that failed to cancel",
)
fail_results class-attribute instance-attribute
fail_results: List[CheckMateTaskBatchResultV1] = Field(
    ...,
    title="Failed Results",
    description="A list of tasks that failed to cancel",
)
success_count class-attribute instance-attribute
success_count: int = Field(
    ...,
    ge=0,
    title="Success Count",
    description="Count of successfully canceled tasks",
)
success_results class-attribute instance-attribute
success_results: List[CheckMateTaskBatchResultV1] = Field(
    ...,
    title="Successful Results",
    description="A list of tasks that were successfully canceled",
)

Functions

from_service_response staticmethod
from_service_response(
    service_response: Tuple[
        List[CheckMateTaskBatchResult],
        List[CheckMateTaskBatchResult],
    ]
) -> CleanTaskResponseV1

CollectionCreateRequestV1

Bases: BaseRequest

Create new collection request object

Attributes

collection_type class-attribute instance-attribute
collection_type: MemoryCollectionType = Field(
    ..., description=comment
)
config class-attribute instance-attribute
config: str = Field(default='{}', description=comment)
description class-attribute instance-attribute
description: str = Field(
    default="", description=RESOURCE_DESC_DOC
)
enabled class-attribute instance-attribute
enabled: bool = Field(True, description=comment)
managed class-attribute instance-attribute
managed: bool = Field(
    default=False, description=RESOURCE_MANAGED_DOC
)
name class-attribute instance-attribute
name: str = Field(..., description=RESOURCE_NAME_DOC)
read_only class-attribute instance-attribute
read_only: bool = Field(True, description=comment)
vectordb_name class-attribute instance-attribute
vectordb_name: str = Field(
    default="default", description=comment
)

CollectionCreateResponseV1

Bases: BaseResponse

Create collection response object

Attributes

collection class-attribute instance-attribute
collection: CollectionV1 = Field(..., description=__doc__)

CollectionExportResponseV1

Bases: BaseResponse

Memory collection export response object

Attributes

memories class-attribute instance-attribute
memories: List[MemoryV1] = Field(
    default_factory=list,
    description="List of memory objects in the collection",
)

CollectionGetResponseV1

Bases: BaseResponse

Create get response object

Attributes

collection class-attribute instance-attribute
collection: CollectionV1 = Field(..., description=__doc__)

CollectionListResponseV1

Bases: BaseResponse

List collection response object

Attributes

collections class-attribute instance-attribute
collections: List[CollectionV1] = Field(
    default_factory=list,
    description="List of memory collections in the namespace",
)

CollectionUpdateRequestV1

Bases: BaseRequest

Collection update request object

Attributes

collection_type class-attribute instance-attribute
collection_type: Optional[MemoryCollectionType] = Field(
    default=None, description=comment
)
config class-attribute instance-attribute
config: Optional[str] = Field(
    default=None, description=comment
)
description class-attribute instance-attribute
description: Optional[str] = Field(
    default=None, description=RESOURCE_DESC_DOC
)
enabled class-attribute instance-attribute
enabled: Optional[bool] = Field(
    default=None, description=RESOURCE_ENABLED_DOC
)
managed class-attribute instance-attribute
managed: Optional[bool] = Field(
    None, description=RESOURCE_MANAGED_DOC
)
name class-attribute instance-attribute
name: Optional[str] = Field(
    default=None, description=RESOURCE_NAME_DOC
)
read_only class-attribute instance-attribute
read_only: Optional[bool] = Field(
    default=None, description=comment
)
vectordb_name class-attribute instance-attribute
vectordb_name: Optional[str] = Field(
    default=None, description=comment
)

CollectionUpdateResponseV1

Bases: BaseResponse

Update collection response object

Attributes

collection class-attribute instance-attribute
collection: CollectionV1 = Field(..., description=__doc__)

CollectionV1

Bases: BaseResourceV1

Attributes

__doc__ class-attribute instance-attribute
__doc__ = __doc__
agents class-attribute instance-attribute
agents: List[str] = Field(
    ...,
    description="List of agent pkids bound to the collection",
)
collection_type class-attribute instance-attribute
collection_type: str = Field(..., description=comment)
config class-attribute instance-attribute
config: str = Field(..., description=comment)
namespace_pkid class-attribute instance-attribute
namespace_pkid: str = Field(..., description=comment)
read_only class-attribute instance-attribute
read_only: bool = Field(..., description=comment)
vectordb_name class-attribute instance-attribute
vectordb_name: str = Field(..., description=comment)

Functions

from_orm_model staticmethod
from_orm_model(model: MemoryCollection) -> CollectionV1

CreateMemoriesResponseV1

Bases: BaseResponse

Create memory response object

Attributes

results class-attribute instance-attribute
results: List[CreateMemoryResponseRecordV1] = Field(
    default_factory=list,
    description="List of memory creation results",
)

CreateMemoryRequestV1

Bases: BaseRequest

Create observation memory request object

Attributes

agent_pkid class-attribute instance-attribute
agent_pkid: str = Field(..., description=comment)
memo class-attribute instance-attribute
memo: Optional[str] = Field(
    default=None, description=comment
)
memory_txt class-attribute instance-attribute
memory_txt: str = Field(..., description=comment)
session_pkid class-attribute instance-attribute
session_pkid: str = Field(..., description=comment)
vector_txt class-attribute instance-attribute
vector_txt: Optional[str] = Field(
    default=None, description=comment
)

CreateMemoryResponseRecordV1

Bases: BaseModel

Create memory response record object

Attributes

memory class-attribute instance-attribute
memory: Optional[MemoryV1] = Field(
    default=None, description=__doc__
)
success class-attribute instance-attribute
success: bool = Field(
    ...,
    description="When true, the memory was created successfully",
)

CreateTaskRequestV1

Bases: BaseModel

Request object for creating a new asynchronous task

Attributes

description class-attribute instance-attribute
description: str = Field(
    ...,
    title="Task Description",
    description="Description of the task to be created",
)

CreateTaskResponseV1

Bases: BaseResponse

Response object returned when submitting a new asynchronous task

Attributes

task_id class-attribute instance-attribute
task_id: str = Field(
    default_factory=lambda: gen_uuid(prefix="task."),
    title="Task ID",
    description="Unique identifier of the new task",
)

DebateHistoryEntryV1

Bases: BaseModel

Agent debate history entry.

Attributes

confidence_scores class-attribute instance-attribute
confidence_scores: List[float] = Field(
    ...,
    title="Confidence",
    description="Unweighted confidence scores from the turn",
)
r class-attribute instance-attribute
r: int = Field(
    ..., title="Round", description="The round number"
)
response class-attribute instance-attribute
response: str = Field(
    ..., title="Response", description="The agent response"
)
role class-attribute instance-attribute
role: str = Field(
    ..., title="Role", description="The agent role"
)
scores class-attribute instance-attribute
scores: List[List[float]] = Field(
    ...,
    title="Scores",
    description="Unweighted scores from the turn",
)

EvalResponseV1

Bases: BaseResponse

Eval response

Attributes

data class-attribute instance-attribute
data: List[EvaluateTaskResponseV1] = Field(
    default_factory=list,
    title="Data",
    description="Evaluate response data for each task",
)

EvaluateRequestV1

Bases: BaseRequest

TextEvolve/Evaluate request object

Attributes

agents class-attribute instance-attribute
agents: List[str] = Field(
    default_factory=list,
    title="Agents",
    description="Override profile agents",
)
profile class-attribute instance-attribute
profile: str | None = Field(
    default=None,
    title="Profile Reference",
    description="Profile reference name",
)
queue class-attribute instance-attribute
queue: str | None = Field(
    default=None,
    title="Queue",
    description="CheckMate queue name",
)
tags class-attribute instance-attribute
tags: List[str] | None = Field(
    default=None,
    title="Tags",
    description="CheckMate task tag(s)",
)
tasks class-attribute instance-attribute
tasks: List[EvaluateTaskV1] | EvaluateTaskV1 = Field(
    ..., title="Tasks", description="Evaluation task(s)"
)

EvaluateTaskResponseV1

Bases: BaseModel

TextEvolve/Evaluate response data model for a single response

Attributes

S class-attribute instance-attribute
S: List[List[List[List[float]]]] = Field(
    default_factory=list,
    title="S",
    description="The scoring tensor of shape (r x i x j x k)",
)
Sc class-attribute instance-attribute
Sc: List[List[List[float]]] = Field(
    default_factory=list,
    title="Sc",
    description="The confidence scoring tensor of shape (r x i x j)",
)
debate_history class-attribute instance-attribute
debate_history: List[DebateHistoryEntryV1] = Field(
    default_factory=list,
    title="Debate History",
    description="The debate history",
)
exception class-attribute instance-attribute
exception: str | None = Field(
    default=None,
    title="Exception",
    description="The exception raised during evaluation on failure",
)
scores_norm class-attribute instance-attribute
scores_norm: List[float] = Field(
    default_factory=list,
    title="Normalized Scores",
    description="The normalized (weighted) score vector of shape (j). Normalized scores have confidence applied.",
)
scores_norm_unweighted class-attribute instance-attribute
scores_norm_unweighted: List[float] = Field(
    default_factory=list,
    title="Unweighted Normalized Scores",
    description="The normalized (weighted) score vector of shape (j)",
)
scores_softmax class-attribute instance-attribute
scores_softmax: List[float] = Field(
    default_factory=list,
    title="Softmax Scores",
    description="The softmax score vector of shape (j)",
)
status class-attribute instance-attribute
status: EvaluateTaskStatusV1 = Field(
    default=FAIL,
    title="Status",
    description="The evaluation status",
)
y_debate class-attribute instance-attribute
y_debate: str = Field(
    default="",
    title="y Debate",
    description="The formatted debate transcript used to determine the final scores.",
)
y_index class-attribute instance-attribute
y_index: int = Field(
    default=-1,
    title="y Index",
    description="The index of the highest scoring response candidate",
)
y_response class-attribute instance-attribute
y_response: str = Field(
    default="",
    title="y Response",
    description="The raw text of the highest scoring response candidate",
)
y_score class-attribute instance-attribute
y_score: float = Field(
    default=0.0,
    title="y Score",
    description="The score of the highest scoring response candidate. When probabilistic selection is enabled, this is the softmax score, otherwise it is the normalized score.",
)

Functions

exception_validator classmethod
exception_validator(value)

EvaluateTaskStatusV1

Bases: Enum

TextEvolve/Evaluate response status enumeration.

Attributes:

  • SUCCESS (int) –

    The evaluation was successful.

  • FAIL (int) –

    The evaluation failed.

Attributes

FAIL class-attribute instance-attribute
FAIL = 'FAIL'
SUCCESS class-attribute instance-attribute
SUCCESS = 'SUCCESS'

EvaluateTaskV1

Bases: BaseModel

TextEvolve/Evaluate API task definition

Attributes

x class-attribute instance-attribute
x: str = Field(
    ...,
    title="x",
    description="Input context in natural language",
)
x_name class-attribute instance-attribute
x_name: str = Field(
    default="input",
    title="X Name",
    description="Natural language name of the x input, ex: 'prompt', 'document', etc. This should be one word that can be used to identify the context of the evaluation to the LLM.",
)
y class-attribute instance-attribute
y: List[str] = Field(
    default_factory=list,
    title="y",
    description="List of candidate responses in natural language. Each will be scored against 'x'. Examples may include answers to a question, prompt variations, reasoning, etc.",
)
y_name class-attribute instance-attribute
y_name: str = Field(
    default="output",
    title="Y Name",
    description="Name of the y outputs that are to be scored. This should be one word that can be used to identify what is being evaluated.",
)

Functions

validate_y classmethod
validate_y(value: List[str]) -> List[str]

GenerateDefinitionRequestV1

Bases: BaseRequest

Generate definition request object

Attributes

audience class-attribute instance-attribute
audience: str = Field(
    default="A normal college-educated adult in their early 30s",
    title="Audience",
    description="Audience for the definition generation, use this parameter to control the tone and language complexity of the response",
)
collection_names class-attribute instance-attribute
collection_names: List[str] = Field(
    default_factory=list,
    title="Collection Names",
    description="List of memory collection names to use for definition generation, overriding the system defaults",
)
inputs class-attribute instance-attribute
inputs: List[str] = Field(
    default_factory=list,
    title="Inputs",
    description="Word or phrase inputs to define or explain.",
)

GenerateDefinitionResponseV1

Bases: BaseResponse

Generate definition response object

Attributes

result class-attribute instance-attribute
result: List[Dict] = Field(
    ...,
    title="Definition Result",
    description="Definition generation result",
)

GetConfigResponseV1

Bases: BaseResponse

List namespace participants response object

Attributes

loaded_collections class-attribute instance-attribute
loaded_collections: List[str] = Field(
    default_factory=list,
    description="List of memory collections loaded into the application cache",
)
settings class-attribute instance-attribute
settings: AppSettings = Field(
    ..., description="Application settings object"
)

GetTaskResponseV1

Bases: BaseResponse

Get task response object

Attributes

task class-attribute instance-attribute
task: TaskV1 = Field(..., description=__doc__)

InvokeChainRequestV1

Bases: BaseRequest

Invoke a LLM chain request object

Attributes

chain_ref class-attribute instance-attribute
chain_ref: str = Field(..., description='')
max_tries class-attribute instance-attribute
max_tries: int = Field(1, description='')
templates class-attribute instance-attribute
templates: List[Dict] = Field(..., description='')
trace_session_id class-attribute instance-attribute
trace_session_id: Optional[str] = Field(
    default=None, description="Session ID for trace"
)
trace_user_id class-attribute instance-attribute
trace_user_id: Optional[str] = Field(
    default=None, description="USer ID for trace"
)

InvokeChainResponseV1

Bases: BaseResponse

Invoke a LLM chain response object

Attributes

completion_tokens class-attribute instance-attribute
completion_tokens: Optional[int] = Field(
    None, description="Completion tokens used in chain"
)
execute_seconds class-attribute instance-attribute
execute_seconds: float = Field(
    description="Execution time in seconds"
)
fail_count class-attribute instance-attribute
fail_count: int = Field(
    0, description="Failed response count"
)
prompt_tokens class-attribute instance-attribute
prompt_tokens: Optional[int] = Field(
    None, description="Prompt tokens used in chain"
)
responses class-attribute instance-attribute
responses: Dict[int, InvokeServiceResponseRecord] = Field(
    ..., description="Indexed chain response"
)
success_count class-attribute instance-attribute
success_count: int = Field(
    0, description="Successful response count"
)
total_tokens class-attribute instance-attribute
total_tokens: Optional[int] = Field(
    None, description="Total tokens used in chain"
)

Functions

from_service_response staticmethod
from_service_response(
    model: InvokeServiceResponse,
) -> InvokeChainResponseV1

InvokeTaskResponseV1

Bases: BaseResponse

Response object returned when invoking a CheckMate task

Attributes

task_id class-attribute instance-attribute
task_id: str = Field(
    default_factory=lambda: gen_uuid(prefix="task."),
    title="Task ID",
    description="Unique identifier of the task",
)

ListTaskResponseV1

Bases: BaseResponse

List task response object

Attributes

tasks class-attribute instance-attribute
tasks: List[TaskV1] = Field(..., description=__doc__)

MemoryGetResponseV1

Bases: BaseResponse

Memory response object

Attributes

memory class-attribute instance-attribute
memory: MemoryV1 = Field(..., description=__doc__)

MemoryListResponseV1

Bases: BaseResponse

List memories response object

Attributes

memories class-attribute instance-attribute
memories: List[MemoryV1] = Field(
    default_factory=list, description=__doc__
)

MemoryRecallSettingsV1

Bases: BaseModel

Memory recall settings object

Attributes

enabled class-attribute instance-attribute
enabled: bool = Field(
    default=True,
    title="Enable Memory Recall",
    description="When true, memories recall is enabled",
)
importance_alpha class-attribute instance-attribute
importance_alpha: float = Field(
    default=1.0,
    ge=0.0,
    le=1.0,
    title="Importance Alpha",
    description="Weight multiplier for importance score",
)
max_memories class-attribute instance-attribute
max_memories: int = Field(
    default=5,
    gt=0,
    title="Maximum Memories",
    description="Maximum number of memories that will be returned",
)
max_memory_strategy class-attribute instance-attribute
max_memory_strategy: str = Field(
    default="HARD_LIMIT",
    title="Maximum Memory Strategy",
    description="Determines how the maximum number of memories is enforced. When set to 'HARD_LIMIT' then the number of memories returned will not exceed 'max_memories'. When set to 'COLLECTION_LIMIT', then up to 'max_memories' from each collection bound to the agent will be returned. When set to 'SUMMARY' a LLM chain will be used to summarize recalled memories that meet the min_score threshold",
)
min_score class-attribute instance-attribute
min_score: float = Field(
    default=0.4,
    gt=0.0,
    title="Minimum Score",
    description="Memories with an overall score below this threshold will be filtered out",
)
recency_alpha class-attribute instance-attribute
recency_alpha: float = Field(
    default=1.0,
    ge=0.0,
    le=1.0,
    title="Recency Alpha",
    description="Weight multiplier for recency score",
)
relevance_alpha class-attribute instance-attribute
relevance_alpha: float = Field(
    default=1.0,
    ge=0.0,
    le=1.0,
    title="Relevance Alpha",
    description="Weight multiplier for relevance score",
)
top_k_vectors class-attribute instance-attribute
top_k_vectors: int = Field(
    default=10,
    gt=0,
    title="Top K Vectors",
    description="Top K vectors to return from vector database from each memory collection inscope prior to scoring & filtering. Scope is use case specific, for example memory collections bound to a given agent.",
)

MemoryUpdateRequestV1

Bases: BaseRequest

Update memory object

Attributes

importance class-attribute instance-attribute
importance: Optional[int] = Field(None, description=comment)
memo class-attribute instance-attribute
memo: Optional[str] = Field(None, description=comment)
memory_txt class-attribute instance-attribute
memory_txt: Optional[str] = Field(None, description=comment)
vector_txt class-attribute instance-attribute
vector_txt: Optional[str] = Field(None, description=comment)

MemoryUpdateResponseV1

Bases: BaseResponse

Update memory response object

Attributes

memory class-attribute instance-attribute
memory: MemoryV1 = Field(..., description=__doc__)

MemoryV1

Bases: BaseModel

Attributes

__doc__ class-attribute instance-attribute
__doc__ = __doc__
access_count class-attribute instance-attribute
access_count: int = Field(..., description=comment)
accessed class-attribute instance-attribute
accessed: datetime = Field(..., description=comment)
agent_pkid class-attribute instance-attribute
agent_pkid: str = Field(..., description=comment)
create_ts class-attribute instance-attribute
create_ts: datetime = Field(..., description=comment)
deleted class-attribute instance-attribute
deleted: bool = Field(..., description=RESOURCE_DELETED_DOC)
importance class-attribute instance-attribute
importance: int = Field(..., description=comment)
memo class-attribute instance-attribute
memo: Optional[str] = Field(
    default=None, description=comment
)
memory_collection_pkid class-attribute instance-attribute
memory_collection_pkid: str = Field(
    ..., description=comment
)
memory_txt class-attribute instance-attribute
memory_txt: str = Field(..., description=comment)
memory_type class-attribute instance-attribute
memory_type: str = Field(..., description=comment)
pkid class-attribute instance-attribute
pkid: str = Field(..., description=RESOURCE_PKID_DOC)
reduction_refs class-attribute instance-attribute
reduction_refs: int = Field(..., description=comment)
session_pkid class-attribute instance-attribute
session_pkid: str = Field(..., description=comment)
update_ts class-attribute instance-attribute
update_ts: datetime = Field(..., description=comment)
vector_txt class-attribute instance-attribute
vector_txt: Optional[str] = Field(
    default=None, description=comment
)

Functions

from_orm_model staticmethod
from_orm_model(model: Memory) -> MemoryV1

NamespaceCreateRequestV1

Bases: BaseRequest

Create namespace request object

Attributes

description class-attribute instance-attribute
description: str = Field(
    default="", description=RESOURCE_DESC_DOC
)
enabled class-attribute instance-attribute
enabled: bool = Field(
    default=True, description=RESOURCE_ENABLED_DOC
)
managed class-attribute instance-attribute
managed: bool = Field(
    default=False, description=RESOURCE_MANAGED_DOC
)
name class-attribute instance-attribute
name: str = Field(..., description=comment)
settings class-attribute instance-attribute
settings: NamespaceResourceSettings = Field(
    default_factory=NamespaceResourceSettings,
    description=__doc__,
)

NamespaceCreateResponseV1

Bases: BaseResponse

Create namespace response object

Attributes

namespace class-attribute instance-attribute
namespace: NamespaceV1 = Field(..., description=__doc__)

NamespaceGetResponseV1

Bases: BaseResponse

Namespace response object

Attributes

namespace class-attribute instance-attribute
namespace: NamespaceV1 = Field(..., description=__doc__)

NamespaceListResponseV1

Bases: BaseResponse

List namespace response object

Attributes

namespaces class-attribute instance-attribute
namespaces: List[NamespaceV1] = Field(
    default_factory=list, description="List of namespaces"
)

NamespaceUpdateRequestV1

Bases: BaseRequest

Update an existing namespace object

Attributes

description class-attribute instance-attribute
description: Optional[str] = Field(
    None, description=RESOURCE_DESC_DOC
)
enabled class-attribute instance-attribute
enabled: Optional[bool] = Field(
    None, description=RESOURCE_ENABLED_DOC
)
managed class-attribute instance-attribute
managed: Optional[bool] = Field(
    None, description=RESOURCE_MANAGED_DOC
)
name class-attribute instance-attribute
name: Optional[str] = Field(
    None, description=RESOURCE_NAME_DOC
)
settings class-attribute instance-attribute
settings: Optional[NamespaceResourceSettings] = Field(
    None, description=__doc__
)

NamespaceUpdateResponseV1

Bases: BaseResponse

Update namespace response object

Attributes

namespace class-attribute instance-attribute
namespace: NamespaceV1 = Field(..., description=__doc__)

NamespaceV1

Bases: BaseResourceV1

Attributes

__doc__ class-attribute instance-attribute
__doc__ = __doc__
settings class-attribute instance-attribute
settings: NamespaceResourceSettings = Field(
    ..., description=__doc__
)

Functions

from_orm_model staticmethod
from_orm_model(model: Namespace) -> NamespaceV1

NewTaskResponseV1

Bases: BaseResponse

Response object returned when submitting a new asynchronous task

Attributes

task_id class-attribute instance-attribute
task_id: str = Field(
    default_factory=lambda: gen_uuid(prefix="task."),
    title="Task ID",
    description="Unique identifier of the new task",
)

OptimizeRequestV1

Bases: BaseRequest

Optimize request object

Attributes

initial_prompt class-attribute instance-attribute
initial_prompt: str = Field(
    ...,
    title="Initial Prompt",
    description="Initial prompt to optimize",
)
profile class-attribute instance-attribute
profile: str = Field(
    ...,
    title="Profile",
    description="Optimization profile name",
)
training_data class-attribute instance-attribute
training_data: List[OptimizeTrainingRecordV1] = Field(
    ...,
    title="Training Data",
    description="List of training data records",
)

OptimizeResponseV1

Bases: BaseResponse

Optimize response object

OptimizeTrainingRecordV1

Bases: BaseModel

Optimize training record object

Attributes

x class-attribute instance-attribute
x: Dict[str, Any] = Field(
    default_factory=dict,
    title="X",
    description="Prompt input template fields",
)
y class-attribute instance-attribute
y: str = Field(
    ..., title="y", description="Desired output response"
)
y_score class-attribute instance-attribute
y_score: float | None = Field(
    default=None,
    title="Y Score",
    description="Score value for prediction",
)

ParticipantDeleteResponseV1

Bases: BaseResponse

Delete participant response object

ParticipantListResponseV1

Bases: BaseResponse

List namespace participants response object

Attributes

agents class-attribute instance-attribute
agents: List[AgentV1] = Field(
    default_factory=list,
    description="List of agent participants in the namespace",
)
users class-attribute instance-attribute
users: List[UserV1] = Field(
    default_factory=list,
    description="List of user participants in the namespace",
)

ReadCorpusRequestV1

Bases: BaseRequest

Attributes

collection_name class-attribute instance-attribute
collection_name: str = Field(
    ...,
    title="Collection Name",
    description="Name of the memory collection to create",
)
corpus class-attribute instance-attribute
corpus: str = Field(
    ..., title="Corpus", description="Corpus URL to read"
)

SessionCreateRequestV1

Bases: BaseRequest

Create new session request object

Attributes

description class-attribute instance-attribute
description: str = Field(
    default="", description=RESOURCE_DESC_DOC
)
enabled class-attribute instance-attribute
enabled: bool = Field(
    default=True, description=RESOURCE_ENABLED_DOC
)
managed class-attribute instance-attribute
managed: bool = Field(
    default=False, description=RESOURCE_MANAGED_DOC
)
name class-attribute instance-attribute
name: str = Field(..., description=RESOURCE_NAME_DOC)
participant_pkids class-attribute instance-attribute
participant_pkids: Optional[List[str]] = Field(
    default_factory=list,
    description="List of initial participant pkids to be included in the new session",
)
settings class-attribute instance-attribute
settings: SessionResourceSettings = Field(
    default_factory=SessionResourceSettings,
    description=__doc__,
)

SessionCreateResponseV1

Bases: BaseResponse

Create new session response object

Attributes

session class-attribute instance-attribute
session: SessionV1 = Field(..., description=__doc__)

SessionGetResponseV1

Bases: BaseResponse

Session response object

Attributes

session class-attribute instance-attribute
session: SessionV1 = Field(..., description=__doc__)

SessionIntegrateResponseV1

Bases: BaseResponse

Session integration response object

Attributes

failure_count class-attribute instance-attribute
failure_count: int = Field(
    ...,
    title="Failure Count",
    description="Count of memories that failed during the integration operation",
)
integrated_memories class-attribute instance-attribute
integrated_memories: List[MemoryV1] = Field(
    default_factory=list,
    title="Integrated Memories",
    description="New integrated memory objects",
)
success_count class-attribute instance-attribute
success_count: int = Field(
    ...,
    title="Success Count",
    description="Count of new memories successfully created via the integration operation",
)

SessionListResponseV1

Bases: BaseResponse

List namespace sessions response object

Attributes

sessions class-attribute instance-attribute
sessions: List[SessionV1] = Field(
    default_factory=list,
    description="List of sessions in the namespace",
)

SessionUpdateRequestV1

Bases: BaseRequest

Update session resource

Attributes

data class-attribute instance-attribute
data: Optional[str] = Field(None, description=comment)
description class-attribute instance-attribute
description: Optional[str] = Field(
    None, description=RESOURCE_DESC_DOC
)
enabled class-attribute instance-attribute
enabled: Optional[bool] = Field(
    None, description=RESOURCE_ENABLED_DOC
)
managed class-attribute instance-attribute
managed: Optional[bool] = Field(
    None, description=RESOURCE_MANAGED_DOC
)
name class-attribute instance-attribute
name: Optional[str] = Field(
    None, description=RESOURCE_NAME_DOC
)
settings class-attribute instance-attribute
settings: Optional[SessionResourceSettings] = Field(
    None, description=__doc__
)

SessionUpdateResponseV1

Bases: BaseResponse

Update session resource

Attributes

session class-attribute instance-attribute
session: SessionV1 = Field(..., description=__doc__)

SessionV1

Bases: BaseResourceV1

Attributes

__doc__ class-attribute instance-attribute
__doc__ = __doc__
data class-attribute instance-attribute
data: Optional[str] = Field(None, description=comment)
namespace_pkid class-attribute instance-attribute
namespace_pkid: str = Field(..., description=comment)
participants class-attribute instance-attribute
participants: List[str] = Field(
    ..., description="List of participant pkids"
)
settings class-attribute instance-attribute
settings: SessionResourceSettings = Field(
    ..., description=__doc__
)

Functions

from_orm_model staticmethod
from_orm_model(model: ActivitySession) -> SessionV1

TaskStatusResponseV1

Bases: BaseResponse

Task status response object

Attributes

result class-attribute instance-attribute
result: Dict = Field(
    default_factory=dict,
    title="Result",
    description="The task result",
)
task_id class-attribute instance-attribute
task_id: str = Field(
    ...,
    title="TaskID",
    description="The unique identifier of the task",
)
task_status class-attribute instance-attribute
task_status: StageStatus = Field(
    ...,
    title="Task Status",
    description="The current status of the task",
)

TaskV1

Bases: BaseDataModel

Attributes

__doc__ class-attribute instance-attribute
__doc__ = __doc__
base_url class-attribute instance-attribute
base_url: str = Field(
    ..., title="Base URL", description=comment
)
cleaned class-attribute instance-attribute
cleaned: bool = Field(
    ..., title="Cleaned", description=comment
)
create_ts class-attribute instance-attribute
create_ts: datetime = Field(
    ..., title="Create Timestamp", description=comment
)
lock_detected class-attribute instance-attribute
lock_detected: bool = Field(
    default=False,
    title="Lock Detected",
    description="Indicates whether a lock was detected in the CheckMate persistence store.",
)
memo class-attribute instance-attribute
memo: str | None = Field(
    ..., title="Memo", description=comment
)
queue class-attribute instance-attribute
queue: str | None = Field(
    default=None,
    title="Queue",
    description="Task queue. This field will be populated when the task has been enqueued and is available for retrieval.",
)
result class-attribute instance-attribute
result: Dict[str, Any] | None = Field(
    default=None,
    title="Result",
    description="Task result. This field will be populated when the task has been completed and the result is available for retrieval.",
)
stage_metadata class-attribute instance-attribute
stage_metadata: List[Dict[str, Any]] = Field(
    default_factory=list,
    title="Stage Metadata",
    description="Persisted task metadata. This field will be populated when the metadata has not been cleaned and is available for retrieval.",
)
status class-attribute instance-attribute
status: StageStatus | None = Field(
    default=None, title="Status", description="Task status"
)
task_id class-attribute instance-attribute
task_id: str = Field(
    ..., title="Task ID", description=comment
)
update_ts class-attribute instance-attribute
update_ts: datetime = Field(
    ..., title="Update Timestamp", description=comment
)

Functions

from_orm_model staticmethod
from_orm_model(model: Task) -> TaskV1

Create a TaskV1 instance from an ORM Task model.

Parameters:

  • model (Task) –

    The ORM Task model instance.

Returns:

  • TaskV1 ( TaskV1 ) –

    The corresponding TaskV1 instance.

from_service_response staticmethod
from_service_response(task_obj: CheckMateTask) -> TaskV1

Create a TaskV1 instance from a service response.

Parameters:

Returns:

  • TaskV1 ( TaskV1 ) –

    The corresponding TaskV1 instance.

serialize_datetime
serialize_datetime(value: datetime) -> str

Serialize datetime fields to ISO format.

Parameters:

  • value (datetime) –

    The datetime value to serialize.

Returns:

  • str ( str ) –

    The serialized datetime string in ISO format.

validate_datetime classmethod
validate_datetime(value: str | datetime) -> datetime

Validate and parse datetime fields.

Parameters:

  • value (str | datetime) –

    The datetime value to validate and parse.

Returns:

  • datetime ( datetime ) –

    The parsed datetime object.

UnlockTaskRequestV1

Bases: BaseModel

Request object for unlocking one or more tasks

Attributes

task_ids class-attribute instance-attribute
task_ids: Union[List[str], str] | None = Field(
    default_factory=list,
    title="Task IDs",
    description="Task ID(s) to cancel",
)

Functions

validate_task_ids classmethod
validate_task_ids(
    value: Union[List[str], str]
) -> List[str]

Validate and normalize the task_ids field.

Parameters:

  • value (Union[List[str], str]) –

    The task ID(s) to validate.

Returns:

  • List[str]

    List[str]: The list of task IDs.

UnlockTaskResponseV1

Bases: BaseResponse

Response object returned when unlocking CheckMate task(s)

Attributes

fail_count class-attribute instance-attribute
fail_count: int = Field(
    ...,
    ge=0,
    title="Fail Count",
    description="Count of tasks that failed to cancel",
)
fail_results class-attribute instance-attribute
fail_results: List[CheckMateTaskBatchResultV1] = Field(
    ...,
    title="Failed Results",
    description="A list of tasks that failed to cancel",
)
success_count class-attribute instance-attribute
success_count: int = Field(
    ...,
    ge=0,
    title="Success Count",
    description="Count of successfully canceled tasks",
)
success_results class-attribute instance-attribute
success_results: List[CheckMateTaskBatchResultV1] = Field(
    ...,
    title="Successful Results",
    description="A list of tasks that were successfully canceled",
)

Functions

from_service_response staticmethod
from_service_response(
    service_response: Tuple[
        List[CheckMateTaskBatchResult],
        List[CheckMateTaskBatchResult],
    ]
) -> UnlockTaskResponseV1

UserCreateRequestV1

Bases: BaseRequest

Create new user request object

Attributes

description class-attribute instance-attribute
description: str = Field(
    default="", description=RESOURCE_DESC_DOC
)
enabled class-attribute instance-attribute
enabled: bool = Field(
    default=True, description=RESOURCE_ENABLED_DOC
)
managed class-attribute instance-attribute
managed: bool = Field(
    default=False, description=RESOURCE_MANAGED_DOC
)
name class-attribute instance-attribute
name: str = Field(..., description=RESOURCE_NAME_DOC)
settings class-attribute instance-attribute
settings: UserResourceSettings = Field(
    default_factory=UserResourceSettings,
    description=__doc__,
)

UserCreateResponseV1

Bases: BaseResponse

Create new user response object

Attributes

user class-attribute instance-attribute
user: UserV1 = Field(..., description=__doc__)

UserGetResponseV1

Bases: BaseResponse

User response object

Attributes

user class-attribute instance-attribute
user: UserV1 = Field(..., description=__doc__)

UserUpdateRequestV1

Bases: BaseRequest

Update user object

Attributes

description class-attribute instance-attribute
description: Optional[str] = Field(
    None, description=RESOURCE_DESC_DOC
)
enabled class-attribute instance-attribute
enabled: Optional[bool] = Field(
    None, description=RESOURCE_ENABLED_DOC
)
managed class-attribute instance-attribute
managed: Optional[bool] = Field(
    None, description=RESOURCE_MANAGED_DOC
)
name class-attribute instance-attribute
name: Optional[str] = Field(
    None, description=RESOURCE_NAME_DOC
)
settings class-attribute instance-attribute
settings: Optional[UserResourceSettings] = Field(
    None, description=__doc__
)

UserUpdateResponseV1

Bases: BaseResponse

Update user response object

Attributes

user class-attribute instance-attribute
user: UserV1 = Field(..., description=__doc__)

UserV1

Bases: BaseResourceV1

Attributes

__doc__ class-attribute instance-attribute
__doc__ = __doc__
namespace_pkid class-attribute instance-attribute
namespace_pkid: str = Field(..., description=comment)
settings class-attribute instance-attribute
settings: UserResourceSettings = Field(
    ..., description=__doc__
)

Functions

from_orm_model staticmethod
from_orm_model(model: User) -> UserV1

Functions