SymbolSearchOpenAIToolkitBuilder

SymbolSearchOpenAIToolkitBuilder is a component utilized in building OpenAI tools, specifically for symbol search operations. It extends from the SymbolSearchToolkitBuilder and OpenAIAgentToolkitBuilder classes. The primary purpose of this builder is to allow OpenAI tool to be constructed for specific symbol search operations.

Overview

The main responsibility of SymbolSearchOpenAIToolkitBuilder is to define the build process for an OpenAI tool. It sets the TOOL_NAME and LLM_PROVIDER property to Symbol Search and OpenAI respectively, inheriting from SymbolSearchToolkitBuilder and OpenAIAgentToolkitBuilder. It then overrides the build_for_open_ai method, building the tools with specific properties and requirements designed for OpenAI tools.

Example

Before using the example below, please ensure that all necessary packages and modules have been correctly installed and imported.

from automata.experimental.tools.builders.symbol_search_builder import SymbolSearchOpenAIToolkitBuilder
from automata.tools.tool_metadata import ToolFunction

# Initialize the tool builder
builder = SymbolSearchOpenAIToolkitBuilder()

# Create new tools
tool = ToolFunction(function="my_function", name="my_tool", description="my custom tool")
builder.add_tool_function(tool)

# Build tools for open AI
openai_tools = builder.build_for_open_api()

This example shows how to create an instance of SymbolSearchOpenAIToolkitBuilder, add a new tool function, and then build OpenAI tools.

Limitations

As the SymbolSearchOpenAIToolkitBuilder class is primarily designed to build OpenAI tools for symbol search operations, it may not be suitable or effective for building tools for non-symbol search operations. It also relies on the structure and specifications of the OpenAITool class for building tools.

Follow-up Questions:

  • Are there any specific constraints or requirements on the tool functions added to the SymbolSearchOpenAIToolkitBuilder?

  • Can the SymbolSearchOpenAIToolkitBuilder be extended or modified to support the building of tools for other types of operations?