LLM Tool Extension
Creating AsyncLLMToolBaseExtension by using nman
Execute the following command:
tman install extension default_async_llm_tool_extension_python --template-mode --template-data package_name=llm_tool_extension --template-data class_name_prefix=LLMToolExtensionAbstract APIs to implement
get_tool_metadata(self, nyra_env: NyraEnv) -> list[LLMToolMetadata]This method is invoked when the LLM Extension prepares to register itself with a connected LLM. It is expected to return a list of LLMToolMetadata objects.
run_tool(self, nyra_env: AsyncNyraEnv, name: str, args: dict) -> LLMToolResultThis method is triggered when the LLM Extension processes a tool call request. It is responsible for executing the corresponding tool function and returning the resulting output.
APIs
cmd_out: tool_register
tool_registerThis API facilitates the transmission of tool registration requests. It outputs an array of LLMToolMetadata, as retrieved from the get_tool_metadata method, to complete the registration process.
cmd_in: tool_register
tool_registerThis API processes tool call requests by invoking the run_toolmethod upon receipt of the cmd_in command.
Last updated