Open jaacMusic opened 6 months ago
It's likely a deadlock in the .Result call. That can happen if you call the async client from inside a web application.
HttpClient client = new HttpClient();
HttpResponseMessage resp = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(false);
string body = await resp.Content.ReadAsStringAsync();
That may likely fix the problem you are having, if you wanted to edit the source and make a custom build of the library.
Thanks Bojake for the response! I was able to work around this issue using the following and skipping the first 8 values.
for (int i = 8; i < typeof(OpenAI_API.Models.Model).GetProperties().Length; i++)
{
AIModels.Items.Add(typeof(OpenAI_API.Models.Model).GetProperties()[i].Name);
}
Hello,
When trying to pull a list of all the models using the following:
api.Models.GetModelsAsync().Result
My program just get stuck. Does anyone knows how to pull a list of all AI models?Thanks! Juan