Skip to content

Commit 03e28b3

Browse files
authored
Merge pull request #235 from openai/nikunj/message-attachment-changes
message.attachment type fixes
2 parents e37b454 + 3b821f0 commit 03e28b3

File tree

1 file changed

+69
-4
lines changed

1 file changed

+69
-4
lines changed

openapi.yaml

Lines changed: 69 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6618,6 +6618,22 @@ paths:
66186618
endpoint="/v1/chat/completions",
66196619
completion_window="24h"
66206620
)
6621+
node: |
6622+
import OpenAI from "openai";
6623+
6624+
const openai = new OpenAI();
6625+
6626+
async function main() {
6627+
const batch = await openai.batches.create({
6628+
input_file_id: "file-abc123",
6629+
endpoint: "/v1/chat/completions",
6630+
completion_window: "24h"
6631+
});
6632+
6633+
console.log(batch);
6634+
}
6635+
6636+
main();
66216637
response: |
66226638
{
66236639
"id": "batch_abc123",
@@ -6684,6 +6700,25 @@ paths:
66846700
curl https://api.openai.com/v1/batches?limit=2 \
66856701
-H "Authorization: Bearer $OPENAI_API_KEY" \
66866702
-H "Content-Type: application/json"
6703+
python: |
6704+
from openai import OpenAI
6705+
client = OpenAI()
6706+
6707+
client.batches.list()
6708+
node: |
6709+
import OpenAI from "openai";
6710+
6711+
const openai = new OpenAI();
6712+
6713+
async function main() {
6714+
const list = await openai.batches.list();
6715+
6716+
for await (const batch of list) {
6717+
console.log(batch);
6718+
}
6719+
}
6720+
6721+
main();
66876722
response: |
66886723
{
66896724
"object": "list",
@@ -6759,6 +6794,18 @@ paths:
67596794
client = OpenAI()
67606795
67616796
client.batches.retrieve("batch_abc123")
6797+
node: |
6798+
import OpenAI from "openai";
6799+
6800+
const openai = new OpenAI();
6801+
6802+
async function main() {
6803+
const batch = await openai.batches.retrieve("batch_abc123");
6804+
6805+
console.log(batch);
6806+
}
6807+
6808+
main();
67626809
response: &batch_object |
67636810
{
67646811
"id": "batch_abc123",
@@ -6826,6 +6873,18 @@ paths:
68266873
client = OpenAI()
68276874
68286875
client.batches.cancel("batch_abc123")
6876+
node: |
6877+
import OpenAI from "openai";
6878+
6879+
const openai = new OpenAI();
6880+
6881+
async function main() {
6882+
const batch = await openai.batches.cancel("batch_abc123");
6883+
6884+
console.log(batch);
6885+
}
6886+
6887+
main();
68296888
response: |
68306889
{
68316890
"id": "batch_abc123",
@@ -10793,10 +10852,13 @@ components:
1079310852
type: string
1079410853
description: The ID of the file to attach to the message.
1079510854
tools:
10855+
description: The tools to add this file to.
1079610856
type: array
1079710857
items:
10798-
type: string
10799-
enum: ["file_search", "code_interpreter"]
10858+
oneOf:
10859+
- $ref: "#/components/schemas/AssistantToolsCode"
10860+
- $ref: "#/components/schemas/AssistantToolsFileSearch"
10861+
x-oaiExpandable: true
1080010862
description: A list of files attached to the message, and the tools they were added to.
1080110863
nullable: true
1080210864
metadata:
@@ -10923,10 +10985,13 @@ components:
1092310985
type: string
1092410986
description: The ID of the file to attach to the message.
1092510987
tools:
10988+
description: The tools to add this file to.
1092610989
type: array
1092710990
items:
10928-
type: string
10929-
enum: ["file_search", "code_interpreter"]
10991+
oneOf:
10992+
- $ref: "#/components/schemas/AssistantToolsCode"
10993+
- $ref: "#/components/schemas/AssistantToolsFileSearch"
10994+
x-oaiExpandable: true
1093010995
description: A list of files attached to the message, and the tools they should be added to.
1093110996
required:
1093210997
- file_id

0 commit comments

Comments
 (0)