aixplain.modules.agent.tool
__author__
Copyright 2024 The aiXplain SDK authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Author: Lucas Pavanelli and Thiago Castro Ferreira Date: May 16th 2024 Description: Agentification Class
Tool Objects
class Tool(ABC)
Specialized software or resource designed to assist the AI in executing specific tasks or functions based on user commands.
Attributes:
name
Text - name of the tooldescription
Text - description of the toolversion
Text - version of the tool
__init__
def __init__(name: Text,
description: Text,
version: Optional[Text] = None,
api_key: Optional[Text] = config.TEAM_API_KEY,
status: Optional[AssetStatus] = AssetStatus.DRAFT,
**additional_info) -> None
Initialize a new Tool instance.
Arguments:
name
Text - The name of the tool.description
Text - A description of the tool's functionality.version
Optional[Text], optional - The version of the tool. Defaults to None.api_key
Optional[Text], optional - The API key for authentication. Defaults to config.TEAM_API_KEY.status
Optional[AssetStatus], optional - The current status of the tool. Defaults to AssetStatus.DRAFT.**additional_info
- Additional keyword arguments for tool configuration.
to_dict
def to_dict()
Converts the tool instance to a dictionary representation.
Returns:
dict
- A dictionary containing the tool's attributes and configuration.
Raises:
NotImplementedError
- This is an abstract method that must be implemented by subclasses.
validate
def validate()
Validates the tool's configuration and settings.
This method should check if all required attributes are properly set and if the tool's configuration is valid.
Raises:
NotImplementedError
- This is an abstract method that must be implemented by subclasses.
deploy
def deploy() -> None
Deploys the tool to make it available for use.
This method should handle any necessary setup or deployment steps required to make the tool operational.
Raises:
NotImplementedError
- This is an abstract method that must be implemented by subclasses.