AdvancedContextOracleOpenAIToolkitBuilder

Overview

AdvancedContextOracleOpenAIToolkitBuilder is a class in the automata.experimental.tools.builders module designed to build tools associated with the context oracle for the OpenAI API. This class extends the functionality of both AdvancedContextOracleToolkitBuilder and OpenAIAgentToolkitBuilder. The AdvancedContextOracleOpenAIToolkitBuilder is registered as a tool manager with the OpenAIAutomataAgentToolkitRegistry.

This class primarily hosts the build_for_open_ai() method, which builds a list of OpenAI tools. Each OpenAI tool is an instance of OpenAITool with customized properties and required parameters.

Example

Here is a simplified example demonstrating how to utilize AdvancedContextOracleOpenAIToolkitBuilder to build OpenAI tools.

from automata.experimental.tools.builders.advanced_context_oracle_builder\
    import AdvancedContextOracleOpenAIToolkitBuilder

# Instantiate the builder
builder = AdvancedContextOracleOpenAIToolkitBuilder()

# Build the OpenAI Tools
openai_tools = builder.build_for_open_ai()

# Explore the built tools
for tool in openai_tools:
    print(f"Tool Function: {tool.function}")
    print(f"Tool Name: {tool.name}")
    print(f"Tool Description: {tool.description}")

Limitations

The AdvancedContextOracleOpenAIToolkitBuilder is specifically designed to generate tools associated with the context oracle for the OpenAI API. Therefore, it may not be suitable or efficient for building tools associated with other APIs or non-OpenAI contexts. It also requires the explicit definition of properties and required parameters which could limit its flexibility.

Follow-up Questions:

  • What are the exact properties and required parameters needed in OpenAITool instances?

  • Can we make this class more flexible, allowing it to handle tools associated with different APIs and contexts?