Skip to content

Can you make it easier to add the OpenAI built in code interpreter for the OpenAI Responses API? #2392

@mtessar

Description

@mtessar

Description

Currently it's easy to integrate the following built in tools from OpenAI in the Responses API:

  • FileSearchToolParam
  • WebSearchToolParam
  • ComputerToolParam

Can you add a CodeInterpreterToolParam to make it easier to add that?

Currently I have to do this to get the built in code interpreter

from pydantic_ai import Agent
from pydantic_ai.models.openai import OpenAIResponsesModel, OpenAIResponsesModelSettings

from openai.types.responses import
model_settings = OpenAIResponsesModelSettings(
    temperature=0.0,
    openai_builtin_tools=[{'type': 'code_interpreter', 'container': {'type': 'auto'}}],
)
model = OpenAIResponsesModel('gpt-4o')

ad_hoc_agent = Agent(
    model=model,
    model_settings=model_settings,
)

References

openai_builtin_tools: Sequence[FileSearchToolParam | WebSearchToolParam | ComputerToolParam]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions