LLM Tool Extension
Creating AsyncLLMToolBaseExtension by using tman
Run the following command,
Abstract APIs to implement
get_tool_metadata(self, ten_env: TenEnv) -> list[LLMToolMetadata]
get_tool_metadata(self, ten_env: TenEnv) -> list[LLMToolMetadata]
This method is called when the LLM Extension is going to register itself to any connected LLM. It should return a list of LLMToolMetadata.
run_tool(self, ten_env: AsyncTenEnv, name: str, args: dict) -> LLMToolResult
run_tool(self, ten_env: AsyncTenEnv, name: str, args: dict) -> LLMToolResult
This method is called when the LLM Extension receives a tool call request. It should execute the tool function and return the result.
APIs
cmd_out: tool_register
tool_register
This API is used to send the tool registration request. An array of LLMToolMetadata returned from get_tool_metadata
will be sent as output.
cmd_in: tool_call
tool_call
This API is used to consume the tool call request. The run_tool
will be executed when the cmd_in is received.
Last updated