Skip to content

Comments

feat(openai): add support for file inputs#290

Merged
sixlive merged 2 commits intoprism-php:mainfrom
Gertiozuni:feature/open-ai-doc-support
Apr 10, 2025
Merged

feat(openai): add support for file inputs#290
sixlive merged 2 commits intoprism-php:mainfrom
Gertiozuni:feature/open-ai-doc-support

Conversation

@Gertiozuni
Copy link
Contributor

Description

This PR adds support for file inputs/documents:

https://platform.openai.com/docs/guides/pdf-files?api-mode=chat

@ChrisB-TL
Copy link
Contributor

Thanks for this!

I am not sure about the support for file IDs. They are OpenAI specific, and we don't offer a way to upload documents via Prism, so it may throw up a lot of issues/questions.

If we do leave them in, could we move to a OpenAI specific OpenAIFile value object - to be added to a message in the same way as Document - which should avoid confusion a little?

@kinsta
Copy link

kinsta bot commented Apr 2, 2025

Preview deployments for prism ⚡️

Status Branch preview Commit preview
✅ Ready Visit preview Visit preview

Commit: 9fb74312dd0740bd79a139bff9d3194f5c7d1ddb

Deployment ID: 083ee27d-a0fb-4b47-abbe-187fd3a25323

Static site name: prism-97nz9

@ianhawes
Copy link

PDF files can be added inline via Base64 as documented here:
https://platform.openai.com/docs/guides/pdf-files?api-mode=chat#base64-encoded-files

@sixlive sixlive force-pushed the feature/open-ai-doc-support branch from 7f640dc to fb5b104 Compare April 10, 2025 18:12
Copy link
Contributor

@sixlive sixlive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

@sixlive sixlive merged commit 356f0dd into prism-php:main Apr 10, 2025
14 checks passed
@elnurvl
Copy link

elnurvl commented Apr 24, 2025

The documentation still not updated to advertise documents support for OpenAI. Is there a catch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants