Skip to content

Texture2D Submission Throwing 404? #258

@taylorbrown2686

Description

@taylorbrown2686

When I submit an image-based request:

public async Task<string> GetImageBasedReply(string prompt, Texture2D image)
        {
            ChatSession.chatMessages.Add(new Message(Role.System, new List<Content> {
                new Content(ContentType.Text, "Use this image for context to the prompt."),
                image
            }));
            ChatSession.chatMessages.Add(new Message(Role.User, prompt));

            ChatRequest request = new ChatRequest(ChatSession.chatMessages, model: "gpt-4-vision-preview", maxTokens: 200);
            ChatResponse response = await ChatSession.client.ChatEndpoint.GetCompletionAsync(request);

            if (response.Choices is not null && response.Choices.Count > 0)
            {
                var gptMessage = response.Choices[0].Message;

                print("GPT Response: " + gptMessage.Content.ToString());

                ChatSession.chatMessages.Add(gptMessage);

                return gptMessage.Content.ToString();
            }
            else
            {
                return null;
            }
        }

It throws a [POST:404] RestException, simply saying it 'Failed' with no additional information. The error itself shows the preprompt given along with a long string (Base64 assumed?) that is truncated for length.

What exactly is the '404' referring to, and how can I resolve it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions