Skip to content

client

High-level Eleanor API client.

This module provides a high-level API client for interacting with the Eleanor Framework. It allows users to perform various resource-specific operations such as creating namespaces, managing participants, and listing sessions.

Example
client = EleanorAPIClient(low_level_client)
namespaces = client.namespace_list()
for namespace in namespaces:
    print(namespace.name)

Attributes

CONTENT_TYPE_TEXT module-attribute

CONTENT_TYPE_TEXT = 'text/plain'

T module-attribute

T = TypeVar('T')

Classes

APIResponseError

Bases: Exception

Raised when problems are detected on the API response object by the high-level client

EleanorAPIClient

EleanorAPIClient(
    low_level_client: ApiClient, timeout=300.0
)

High-level Eleanor API client

Attributes

low_level_client instance-attribute
low_level_client = low_level_client
timeout instance-attribute
timeout = timeout

Functions

agent_bind_collection
agent_bind_collection(
    agent_pkid: str, collection_pkid: str
) -> None
agent_delete
agent_delete(agent_pkid: str) -> None
agent_unbind_collection
agent_unbind_collection(
    agent_pkid: str, collection_pkid: str
) -> None
agent_undelete
agent_undelete(agent_pkid: str) -> None
agent_update
agent_update(
    agent_pkid: str,
    description: Optional[str] = None,
    settings: Optional[AgentResourceSettings] = None,
    managed: Optional[bool] = None,
    enabled: Optional[bool] = None,
) -> AgentV1
collection_delete
collection_delete(collection_pkid: str) -> None
collection_rebuild
collection_rebuild(
    collection_pkid: str,
) -> CollectionRebuildResponseV1Collection
collection_truncate
collection_truncate(collection_pkid: str) -> None
collection_undelete
collection_undelete(collection_pkid: str) -> None
collection_update
collection_update(
    collection_pkid: str,
    name: Optional[str] = None,
    description: Optional[str] = None,
    enabled: Optional[bool] = None,
    collection_type: Optional[MemoryCollectionType] = None,
    vectordb_name: Optional[str] = None,
    config: Optional[Union[Dict, str]] = None,
    managed: Optional[bool] = None,
    read_only: Optional[bool] = None,
) -> CollectionV1
invoke_chain
invoke_chain(
    chain_ref: str,
    templates: List[Dict[str, Any]],
    max_tries: int = 1,
) -> Dict[str, InvokeServiceResponseRecord]
namespace_agent_get_by_name
namespace_agent_get_by_name(
    namespace_pkid: str, name: str
) -> Optional[AgentV1]
namespace_agent_get_or_create
namespace_agent_get_or_create(
    namespace_pkid: str,
    name: str,
    description: str = "",
    settings: Optional[AgentResourceSettings] = None,
    enabled: bool = True,
    managed: bool = False,
    episodic_memory_collection_config: Optional[
        Union[Dict, str]
    ] = None,
    vectordb_name: Optional[str] = None,
) -> AgentV1
namespace_agent_list
namespace_agent_list(
    namespace_pkid: str, include_deleted: bool = False
) -> List[AgentV1]
namespace_collection_get_by_name
namespace_collection_get_by_name(
    namespace_pkid: str, name: str
) -> Optional[CollectionV1]
namespace_collection_get_or_create
namespace_collection_get_or_create(
    namespace_pkid: str,
    name: str,
    description: str,
    enabled: bool,
    collection_type: MemoryCollectionType,
    vectordb_name: str,
    config: Optional[Union[Dict, str]],
    managed: bool = False,
    read_only: bool = False,
) -> CollectionV1
namespace_collection_list
namespace_collection_list(
    namespace_pkid: str, include_deleted: bool = False
) -> List[CollectionV1]
namespace_create
namespace_create(
    name: str,
    description: str = "",
    settings: Optional[NamespaceResourceSettings] = None,
    managed: bool = False,
    enabled: bool = True,
) -> NamespaceV1
namespace_delete
namespace_delete(namespace_pkid: str) -> None
namespace_get_by_name
namespace_get_by_name(name: str) -> Optional[NamespaceV1]
namespace_get_or_create
namespace_get_or_create(
    name: str,
    description: str = "",
    settings: Optional[NamespaceResourceSettings] = None,
    managed: bool = False,
    enabled: bool = True,
) -> NamespaceV1

Get or create a namespace

namespace_list
namespace_list(
    include_deleted: bool = False,
) -> List[NamespaceV1]
namespace_participant_list
namespace_participant_list(
    namespace_pkid: str, include_deleted: bool = False
) -> Tuple[List[UserV1], List[AgentV1]]
namespace_session_create
namespace_session_create(
    namespace_pkid: str,
    name: str,
    participant_pkids: Optional[List[str]] = None,
    description: str = "",
    settings: Optional[SessionResourceSettings] = None,
    managed: bool = False,
    enabled: bool = True,
) -> SessionV1
namespace_session_get_by_name
namespace_session_get_by_name(
    namespace_pkid: str, name: str
) -> Optional[SessionV1]
namespace_session_get_or_create
namespace_session_get_or_create(
    namespace_pkid: str,
    name: str,
    participant_pkids: Optional[List[str]] = None,
    description: str = "",
    settings: Optional[SessionResourceSettings] = None,
    managed: bool = False,
    enabled: bool = True,
) -> SessionV1
namespace_session_list
namespace_session_list(
    namespace_pkid: str, include_deleted: bool = False
) -> List[SessionV1]
namespace_undelete
namespace_undelete(namespace_pkid: str) -> None
namespace_update
namespace_update(
    namespace_pkid: str,
    name: Optional[str] = None,
    description: Optional[str] = None,
    settings: Optional[NamespaceResourceSettings] = None,
    managed: Optional[bool] = None,
    enabled: Optional[bool] = None,
) -> NamespaceV1
namespace_user_get_by_name
namespace_user_get_by_name(
    namespace_pkid: str, name: str
) -> Optional[UserV1]
namespace_user_get_or_create
namespace_user_get_or_create(
    namespace_pkid: str,
    name: str,
    description: str = "",
    settings: Optional[UserResourceSettings] = None,
    managed: bool = False,
    enabled: bool = True,
) -> UserV1
namespace_user_list
namespace_user_list(
    namespace_pkid: str, include_deleted: bool = False
) -> List[UserV1]
session_delete
session_delete(session_pkid: str) -> None
session_get_by_pkid
session_get_by_pkid(
    session_pkid: str,
) -> Optional[SessionV1]
session_integrate
session_integrate(
    session_pkid: str,
) -> SessionIntegrateResponseV1
session_participant_add
session_participant_add(
    session_pkid: str, participant_pkid: str
) -> None
session_participant_remove
session_participant_remove(
    session_pkid: str, participant_pkid: str
) -> None
session_truncate
session_truncate(session_pkid: str) -> None
session_undelete
session_undelete(session_pkid: str) -> None
session_update
session_update(
    session_pkid: str,
    name: Optional[str] = None,
    data: Optional[str] = None,
    description: Optional[str] = None,
    settings: Optional[SessionResourceSettings] = None,
    managed: Optional[bool] = None,
    enabled: Optional[bool] = None,
) -> SessionV1
user_delete
user_delete(user_pkid: str) -> None
user_undelete
user_undelete(user_pkid: str) -> None
user_update
user_update(
    user_pkid: str,
    name: Optional[str] = None,
    description: Optional[str] = None,
    settings: Optional[UserResourceSettings] = None,
    managed: Optional[bool] = None,
    enabled: Optional[bool] = None,
) -> UserV1