You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a Blazor Maui Hybrid app that's currently running on Windows, macOS, iOS, and Android. When making a call to OpenAIService.CreateCompletionAsStream() on an iOS device, the following exception occurs:
System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Net.Http.HttpClientHandler.Send(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpMessageInvoker.Send(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.Send(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
at OpenAI.GPT3.Extensions.HttpClientExtensions.PostAsStreamAsync(HttpClient client, String uri, Object requestModel, CancellationToken cancellationToken)
at OpenAI.GPT3.Managers.OpenAIService.CreateCompletionAsStream(ChatCompletionCreateRequest chatCompletionCreateRequest, String modelId, CancellationToken cancellationToken)+MoveNext()
at OpenAI.GPT3.Managers.OpenAIService.CreateCompletionAsStream(ChatCompletionCreateRequest chatCompletionCreateRequest, String modelId, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
The problem appears to be that iOS does not support synchronous HTTP operations, so calling return client.Send(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken); in HttpClientExtensions.PostAsStreamAsync() results in an exception.
I'll look into this more deeply when I have a few minutes free, but from a cursor glance it looks like fixing this would require a significant refactor to make this operation truly asynchronous.
OS: iOS 18.0 (22A5350a)
Language: C#
Version: 8.6.2
The text was updated successfully, but these errors were encountered:
Interesting. If I recall correctly, we had a similar issue previously, but it was fixed. Since then, we haven't seen the problem recur. If you could create a sample repository that I can use to reproduce the issue, I'd be able to look into this quickly.
I've noticed something in your stack trace: you have a dependency on OpenAI.GPT3, but you also mentioned you're using version 8.6.2. Version 8.6.2 shouldn't have any dependency on the legacy "OpenAI.GPT3" code. 🤔
We have a Blazor Maui Hybrid app that's currently running on Windows, macOS, iOS, and Android. When making a call to
OpenAIService.CreateCompletionAsStream()
on an iOS device, the following exception occurs:The problem appears to be that iOS does not support synchronous HTTP operations, so calling
return client.Send(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken);
inHttpClientExtensions.PostAsStreamAsync()
results in an exception.I'll look into this more deeply when I have a few minutes free, but from a cursor glance it looks like fixing this would require a significant refactor to make this operation truly asynchronous.
The text was updated successfully, but these errors were encountered: