Skip to content

[BUG] MessageImageDetail.Auto fails for assistantClient.CreateMessageAsync in version 2.2.0 #542

@moshe-ritterman

Description

@moshe-ritterman

Describe the bug

I just upgraded from version 2.1.0 to 2.2.0 and this code (see below) started to fail with this error message

HTTP 400 (invalid_request_error: invalid_value)
Parameter: content[1].image_file.detail

Invalid value: 'Auto'. Supported values are: 'low', 'high', and 'auto'.

This is the code that fails

await _assistantClient.CreateMessageAsync(threadId, MessageRole.User, [
        "<Some instructions>",
        MessageContent.FromImageFileId(fileId, MessageImageDetail.Auto),
        """
        Additional context: <Some more instructions>
        """
    ]
);

Steps to reproduce

  1. Create a chat assistant (using AssistantClient)
  2. Create a vector store (using VectorStoreClient)
  3. Upload 2 files (using OpenAIFileClient)
  4. Adding one of the files to the vector store (using VectorStoreClient)
  5. Creating a thread (using AssistantClient) and attaching the vector store to the thread
  6. Creating a message (using AssistantClient) passing in the thread id and the other file uploaded via OpenAIFileClient

It's at this step (where I attach the file) that I indicate that the image detail should be set to 'auto' via this code MessageContent.FromImageFileId(fileId, MessageImageDetail.Auto) and this is what fails (because 'Auto' is capitalized)

Code snippets

OS

macOS

.NET version

8

Library version

2.2.0

Metadata

Metadata

Assignees

Labels

bugCategory: Something isn't working and appears to be a defect in the client library.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions