-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Description
Description
OpenAI supports uploading files to its files api, which can then be referenced by file_id when calling the inference endpoints that accept the messages property:
Some other providers such as Google support similar APIs :https://ai.google.dev/api/files
This feature is useful because it avoids having to re-upload images or documents in multi-turn conversations.
Looking at the _map_user_prompt function, it is clear that PydanticAI doesn't currently support this feature and provides no way to use it (such as allowing custom message content to be added when calling inference endpoint).
I would like to contribute this to PydanticAI and have two questions:
- Would this be a desirable contribution?
- What would be the recommended strategy to support this in a cross-provider way? My first instinct is to add a new UserContent type (FileId, or FileReference) which would then be handled in
_map_user_promptfor OpenAIModel.
References
No response
tekumara and marmor7
Metadata
Metadata
Assignees
Labels
Feature requestNew feature requestNew feature request