Add support for specifying image detail
in chat completion requests
#176
Labels
enhancement
New feature or request
detail
in chat completion requests
#176
Feature Request
Is your feature request related to a problem? Please describe.
The
gpt-4-visual-preview
model supports processing images using two different levels of detail:high
orlow
. OpenAI-DotNet allows adding images to chat completion requests, but it doesn't allow specifying this optional parameter.According to the OpenAI documentation, this parameter defaults to
auto
, which picks the detail level automatically based on the image resolution. There are several reasons why being able to override this level of detail would be useful though.For example:
low
detail requests will always use 85 tokens per image, whereas ahigh
detail request could use up to 1,445 tokens per image in the worst case (768x2048 image, which takes 8 512x512 tiles). Using fewer tokens can reduce costs (and/or lead to more predictable costs), and it also allows conversations run longer before hitting the context limit.low
detail requests can result in faster completion responsesDescribe the solution you'd like
When constructing
Content
with an image url, it would be nice if I could specify the level ofdetail
to use.Describe alternatives you've considered
The only alternatives I could think of were to:
detail
property before sending the request512x512
to hopefully force alow
detail requestNeither of these alternatives are very sustainable though.
The text was updated successfully, but these errors were encountered: