SymbolSearchOpenAIToolkitBuilder
SymbolSearchOpenAIToolkitBuilder is a class for building OpenAI
tools using the Symbol Search API which provides functionality to search
an indexed python codebase.
Overview
SymbolSearchOpenAIToolkitBuilder provides an interface to create
OpenAI tools based on the functionality of the Symbol Search. The Symbol
Search API allows you to search python codebase indexed under Automata.
The symbols can be a specific python function, class, method, or
property. The build_for_open_ai method builds a list of OpenAI tools
to be used by the Automata Agent.
Example
The following example demonstrates how to build OpenAI tools using the
SymbolSearchOpenAIToolkitBuilder class.
from automata.tools.builders.symbol_search import SymbolSearchOpenAIToolkitBuilder
from automata.experimental.search.symbol_search import SymbolSearch
symbol_search = SymbolSearch(index_name="your-index-name")
builder = SymbolSearchOpenAIToolkitBuilder(symbol_search=symbol_search)
openai_tools = builder.build_for_open_ai()
for tool in openai_tools:
print(type(tool), tool.name)
Please replace “your-index-name” with the actual name of your index.
Limitations
SymbolSearchOpenAIToolkitBuilderis limited to only building tools that work with the Symbol Search API.The builder must be initialized with a valid
SymbolSearchinstance.The builder’s functionality is closely tied to the
SymbolSearchimplementation, and any changes in that implementation may require changes in the builder as well.
Dependencies
automata.llm.providers.openai.OpenAIToolautomata.singletons.toolkit_registries.OpenAIAutomataAgentToolkitRegistryautomata.agent.agent.AgentToolkitNamesautomata.agent.providers.OpenAIAgentToolkitBuilder
Follow-up Questions:
What are the specific use-cases for
SymbolSearchOpenAIToolkitBuilderand when should it be preferred over other builder types?How does the builder handle exceptions and errors that may occur during tool creation?