For everyone interested, you can vote for the feature here: https://feedback.azure.com/d365community/idea/5c414e8f-d40a-f011-a4de-6045bdbc7eba
Support for PDF files as base64 of the OpenAI SDK
Christian Korherr
0
Reputation points
Will there be support for PDF files as base64 for the OpenAI SDK?
export namespace ChatCompletionContentPart {
/**
* Learn about [file inputs](https://platform.openai.com/docs/guides/text) for text
* generation.
*/
export interface File {
file: File.File;
/**
* The type of the content part. Always `file`.
*/
type: 'file';
}
export namespace File {
export interface File {
/**
* The base64 encoded file data, used when passing the file to the model as a
* string.
*/
file_data?: string;
/**
* The ID of an uploaded file to use as input.
*/
file_id?: string;
/**
* The name of the file, used when passing the file to the model as a string.
*/
file_name?: string;
}
}
}
If I use it I'm getting this error:
{
"error": {
"message": "Unknown parameter: 'messages[2].content[0].file.file_name'.",
"type": "invalid_request_error",
"param": "messages[2].content[0].file.file_name",
"code": "unknown_parameter"
}
}