forked from boos/BoosAPI
feat: rewrite user journey documentation and enhance input file handling in responses
This commit is contained in:
@@ -37,7 +37,7 @@ describe('proxyInputFileResolver', () => {
|
||||
expect(getProxyFileByPublicIdForOwnerMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('resolves object-form responses input payloads with local file ids', async () => {
|
||||
it('resolves object-form responses input payloads with local file ids into inline-only uploads', async () => {
|
||||
getProxyFileByPublicIdForOwnerMock.mockResolvedValue({
|
||||
publicId: 'file-metapi-123',
|
||||
filename: 'brief.pdf',
|
||||
@@ -69,7 +69,6 @@ describe('proxyInputFileResolver', () => {
|
||||
content: [
|
||||
{
|
||||
type: 'input_file',
|
||||
file_id: 'file-metapi-123',
|
||||
filename: 'brief.pdf',
|
||||
file_data: `data:application/pdf;base64,${Buffer.from('%PDF-local').toString('base64')}`,
|
||||
},
|
||||
|
||||
@@ -212,7 +212,7 @@ function toResponsesResolvedBlock(file: { fileId?: string; filename: string; fil
|
||||
}
|
||||
return {
|
||||
type: 'input_file',
|
||||
...(file.fileId ? { file_id: file.fileId } : {}),
|
||||
...(!file.fileData && file.fileId ? { file_id: file.fileId } : {}),
|
||||
filename: file.filename,
|
||||
file_data: ensureBase64DataUrl(file.fileData, file.mimeType),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user