Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for specifying image detail in chat completion requests #176

Closed
rpendleton opened this issue Nov 22, 2023 · 1 comment · Fixed by #177
Closed

Add support for specifying image detail in chat completion requests #176

rpendleton opened this issue Nov 22, 2023 · 1 comment · Fixed by #177
Labels
enhancement New feature or request

Comments

@rpendleton
Copy link

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 or low. 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 a high 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 responses

Describe the solution you'd like

When constructing Content with an image url, it would be nice if I could specify the level of detail to use.

Describe alternatives you've considered

The only alternatives I could think of were to:

  • somehow intercept the request to add the detail property before sending the request
  • manually rescale every image to 512x512 to hopefully force a low detail request

Neither of these alternatives are very sustainable though.

@rpendleton rpendleton added the enhancement New feature or request label Nov 22, 2023
@StephenHodgson
Copy link
Member

StephenHodgson commented Nov 22, 2023

None of their documentation showed where to add this parameter.

@StephenHodgson StephenHodgson linked a pull request Nov 22, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

2 participants