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

When using GPT-4 with ChatRequest, get a bunch of other stuff in the received string #53

Closed
doomlaser opened this issue Mar 17, 2023 · 11 comments
Labels
question Further information is requested

Comments

@doomlaser
Copy link

doomlaser commented Mar 17, 2023

Bug Report

model = await api.ModelsEndpoint.GetModelDetailsAsync("gpt-4");

when I make a ChatRequest, the result string starts with:

{"id":"chatcmpl-6vCy4dpOyIf1kZy9OiZjsy0CtwGpS","object":"chat.completion","created":1679092564,"model":"gpt-3.5-turbo-0301","usage":{"prompt_tokens":451,"completion_tokens":335,"total_tokens":786},"choices":[{"message":{"role":"assistant","content":"

then the normal content, then ends with:

"},"delta":null,"finish_reason":"stop","index":0}],"ProcessingTime":"00:00:11.0960000","Organization":"ORGID","RequestId":"RequestID}
@doomlaser doomlaser added the bug Something isn't working label Mar 17, 2023
@StephenHodgson
Copy link
Member

I don't understand your report.

@doomlaser
Copy link
Author

the JSON doesn't seem to be stripped?

@doomlaser
Copy link
Author

it also says the model is gpt-3.5-turbo-0301? when it should be GPT-4?

@StephenHodgson
Copy link
Member

StephenHodgson commented Mar 17, 2023

I'm not sure what exactly you're doing but it works fine for me on this end with gpt-4.

var api = new OpenAIClient();
var gpt4 = await api.ModelsEndpoint.GetModelDetailsAsync("gpt-4");
var chatPrompts = new List<ChatPrompt>
{
    new ChatPrompt("system", "You are a helpful assistant."),
    new ChatPrompt("user", "Who won the world series in 2020?"),
    new ChatPrompt("assistant", "The Los Angeles Dodgers won the World Series in 2020."),
    new ChatPrompt("user", "Where was it played?"),
};
var chatRequest = new ChatRequest(chatPrompts, gpt4);
var result = await api.ChatEndpoint.GetCompletionAsync(chatRequest);
Debug.Log(result.FirstChoice);

@StephenHodgson StephenHodgson added question Further information is requested and removed bug Something isn't working labels Mar 17, 2023
@StephenHodgson
Copy link
Member

I couldn't tell you one that's the case. When I put it in, I get back the right model. It could be you may not have access yet.

@doomlaser
Copy link
Author

Hmm, could possibly be an issue with Unity and the Package manager update? I do have access

@StephenHodgson
Copy link
Member

The test I ran above is in a project that's using this package through the package manager

@StephenHodgson
Copy link
Member

I just updated all the unit tests to use gpt-4 and they all passed for me as well. If there's something more specific you'd like me to test let me know. Otherwise I'm gonna keep this once closed for now until you can give me a easier repro.

@doomlaser
Copy link
Author

Thanks, I'm going to try deleting /Library/ and see if that fixes it.

@StephenHodgson
Copy link
Member

StephenHodgson commented Mar 17, 2023

It's also hard to parse out exactly what you're trying to tell me before.

Could you try giving me the whole JSON string? It looks like that your response from the server is malformed more than anything.

@StephenHodgson
Copy link
Member

If you don't feel comfortable sharing this information on GitHub you can always DM me on discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

No branches or pull requests

2 participants