generated from RageAgainstThePixel/upm-template
-
-
Notifications
You must be signed in to change notification settings - Fork 86
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
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
Labels
bugSomething isn't workingSomething isn't working