Skip to content

Commit

Permalink
more test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Zachary King committed Nov 15, 2024
1 parent 5c67120 commit dfe1686
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions sdk/ai/ai-projects/src/agents/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,7 @@ function getAgents(context: Client): AgentsOperations {
listFiles(context, {...requestParams, body: {purpose } }),
uploadFile: (content: ReadableStream | NodeJS.ReadableStream, purpose: string, fileName?: string, requestParams?: OptionalRequestParameters) =>
uploadFile(context, {
body: [{ name: "file" as const, body: content, filename: fileName }],
queryParameters: { purpose },
body: [{ name: "file" as const, body: content, filename: fileName }, {name: "purpose" as const, body: purpose}],
...(requestParams as { [key: string]: any; }),
contentType: "multipart/form-data"
}),
Expand Down
8 changes: 4 additions & 4 deletions sdk/ai/ai-projects/test/public/agents/files.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe("Agents - files", () => {
controller.close();
}
});
const file = await agents.uploadFile(fileContent, "purpose", "fileName");
const file = await agents.uploadFile(fileContent, "assistants", "fileName");
assert.isNotEmpty(file);
});

Expand All @@ -49,7 +49,7 @@ describe("Agents - files", () => {
controller.close();
}
});
const file = await agents.uploadFile(fileContent, "purpose", "fileName");
const file = await agents.uploadFile(fileContent, "assistants", "fileName");
const deleted = await agents.deleteFile(file.id);
assert.isNotNull(deleted);
});
Expand All @@ -61,7 +61,7 @@ describe("Agents - files", () => {
controller.close();
}
});
const file = await agents.uploadFile(fileContent, "purpose", "fileName");
const file = await agents.uploadFile(fileContent, "assistants", "fileName");
const _file = await agents.getFile(file.id);
assert.isNotEmpty(_file);
assert.equal(_file.id, file.id);
Expand All @@ -75,7 +75,7 @@ describe("Agents - files", () => {
controller.close();
}
});
const file = await agents.uploadFile(fileContent, "purpose", "fileName");
const file = await agents.uploadFile(fileContent, "assistants", "fileName");
const content = await agents.getFileContent(file.id);
assert.isNotEmpty(content);
});
Expand Down

0 comments on commit dfe1686

Please sign in to comment.