in_mem_tool_repository
File: core/src/utcp/implementations/in_mem_tool_repository.py
class InMemToolRepository (ConcurrentToolRepository)
No class documentation available
Methods:
async save_manual(self, manual_call_template: CallTemplate, manual: UtcpManual) -> None
Save a manual and its associated tools.
Args
manual_call_template
: The manual call template to save.manual
: The manual to save.
async remove_manual(self, manual_name: str) -> bool
Remove a manual and its associated tools.
Args
manual_name
: The name of the manual to remove.
Returns
True if the manual was removed, False otherwise.
async remove_tool(self, tool_name: str) -> bool
Remove a tool from the repository.
Args
tool_name
: The name of the tool to remove.
Returns
True if the tool was removed, False otherwise.
async get_tool(self, tool_name: str) -> Optional[Tool]
Get a tool by name.
Args
tool_name
: The name of the tool to get.
Returns
The tool if it exists, None otherwise.
async get_tools(self) -> List[Tool]
Get all tools in the repository.
Returns
A list of all tools in the repository.
async get_tools_by_manual(self, manual_name: str) -> Optional[List[Tool]]
Get all tools associated with a manual.
Args
manual_name
: The name of the manual to get tools for.
Returns
A list of tools associated with the manual, or None if the manual does not exist.
async get_manual(self, manual_name: str) -> Optional[UtcpManual]
Get a manual by name.
Args
manual_name
: The name of the manual to get.
Returns
The manual if it exists, None otherwise.
async get_manuals(self) -> List[UtcpManual]
Get all manuals in the repository.
Returns
A list of all manuals in the repository.
async get_manual_call_template(self, manual_call_template_name: str) -> Optional[CallTemplate]
Get a manual call template by name.
Args
manual_call_template_name
: The name of the manual call template to get.
Returns
The manual call template if it exists, None otherwise.
async get_manual_call_templates(self) -> List[CallTemplate]
Get all manual call templates in the repository.
Returns
A list of all manual call templates in the repository.
class InMemToolRepositoryConfigSerializer (Serializer[InMemToolRepository])
No class documentation available
Methods:
to_dict(self, obj: InMemToolRepository) -> dict
Convert an InMemToolRepository
instance to a dictionary.
Args
obj
: TheInMemToolRepository
instance to convert.
Returns
A dictionary representing the InMemToolRepository
instance.
validate_dict(self, data: dict) -> InMemToolRepository
Convert a dictionary to an InMemToolRepository
instance.
Args
data
: The dictionary to convert.
Returns
An InMemToolRepository
instance representing the dictionary.