CodeInterpreterTool Class

public final class CodeInterpreterTool
extends Tool

Code interpreter A tool that runs Python code to help generate a response to a prompt.

Constructor Summary

Constructor Description
CodeInterpreterTool()

Creates an instance of CodeInterpreterTool class.

Method Summary

Modifier and Type Method and Description
static CodeInterpreterTool fromJson(JsonReader jsonReader)

Reads an instance of CodeInterpreterTool from the JsonReader.

AutoCodeInterpreterToolParameter getContainerAsAutoCodeInterpreterToolParameter()

Get the container property: The code interpreter container.

String getContainerAsString()

Get the container property: The code interpreter container.

String getDescription()

Get the description property: Deprecated.

String getName()

Get the name property: Deprecated.

Map<String,ToolConfig> getToolConfigs()

Get the toolConfigs property: Deprecated.

ToolType getType()

Get the type property: The type property.

CodeInterpreterTool setContainer(AutoCodeInterpreterToolParameter container)

Set the container property: The code interpreter container.

CodeInterpreterTool setContainer(String containerId)

Set the container property: The code interpreter container.

CodeInterpreterTool setDescription(String description)

Set the description property: Deprecated.

CodeInterpreterTool setName(String name)

Set the name property: Deprecated.

CodeInterpreterTool setToolConfigs(Map<String,ToolConfig> toolConfigs)

Set the toolConfigs property: Deprecated.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from Tool

Methods inherited from java.lang.Object

Constructor Details

CodeInterpreterTool

public CodeInterpreterTool()

Creates an instance of CodeInterpreterTool class.

Method Details

fromJson

public static CodeInterpreterTool fromJson(JsonReader jsonReader)

Reads an instance of CodeInterpreterTool from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of CodeInterpreterTool if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the CodeInterpreterTool.

getContainerAsAutoCodeInterpreterToolParameter

public AutoCodeInterpreterToolParameter getContainerAsAutoCodeInterpreterToolParameter()

Get the container property: The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional `memory_limit` setting. If not provided, the service assumes auto.

Returns:

the container value as an AutoCodeInterpreterToolParameter.

getContainerAsString

public String getContainerAsString()

Get the container property: The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional `memory_limit` setting. If not provided, the service assumes auto.

Returns:

the container value as a String.

getDescription

public String getDescription()

Get the description property: Deprecated. This property is deprecated and will be removed in a future version.

Returns:

the description value.

getName

public String getName()

Get the name property: Deprecated. This property is deprecated and will be removed in a future version.

Returns:

the name value.

getToolConfigs

public Map<String,ToolConfig> getToolConfigs()

Get the toolConfigs property: Deprecated. This property is deprecated and will be removed in a future version.

Returns:

the toolConfigs value.

getType

public ToolType getType()

Get the type property: The type property.

Overrides:

CodeInterpreterTool.getType()

Returns:

the type value.

setContainer

public CodeInterpreterTool setContainer(AutoCodeInterpreterToolParameter container)

Set the container property: The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional `memory_limit` setting. If not provided, the service assumes auto.

Parameters:

container - the AutoCodeInterpreterToolParameter to set.

Returns:

the CodeInterpreterTool object itself.

setContainer

public CodeInterpreterTool setContainer(String containerId)

Set the container property: The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional `memory_limit` setting. If not provided, the service assumes auto.

Parameters:

containerId - the container ID string to set.

Returns:

the CodeInterpreterTool object itself.

setDescription

public CodeInterpreterTool setDescription(String description)

Set the description property: Deprecated. This property is deprecated and will be removed in a future version.

Parameters:

description - the description value to set.

Returns:

the CodeInterpreterTool object itself.

setName

public CodeInterpreterTool setName(String name)

Set the name property: Deprecated. This property is deprecated and will be removed in a future version.

Parameters:

name - the name value to set.

Returns:

the CodeInterpreterTool object itself.

setToolConfigs

public CodeInterpreterTool setToolConfigs(Map<String,ToolConfig> toolConfigs)

Set the toolConfigs property: Deprecated. This property is deprecated and will be removed in a future version.

Parameters:

toolConfigs - the toolConfigs value to set.

Returns:

the CodeInterpreterTool object itself.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

CodeInterpreterTool.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to