Create container file
client.Containers.Files.New(ctx, containerID, body) (*ContainerFileNewResponse, error)
POST/containers/{container_id}/files
Create a Container File
You can send either a multipart/form-data request with the raw file content, or a JSON request with a file ID.
Parameters
containerID string
Returns
Create container file
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("My API Key"),
)
file, err := client.Containers.Files.New(
context.TODO(),
"container_id",
openai.ContainerFileNewParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", file.ID)
}
{
"id": "id",
"bytes": 0,
"container_id": "container_id",
"created_at": 0,
"object": "container.file",
"path": "path",
"source": "source"
}Returns Examples
{
"id": "id",
"bytes": 0,
"container_id": "container_id",
"created_at": 0,
"object": "container.file",
"path": "path",
"source": "source"
}