-
Notifications
You must be signed in to change notification settings - Fork 8
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
GetStreamingChatMessageContentsAsync not working #11
Comments
Can you make sure that when you provide the Ollama API URL, you're not using a trailing slash in the URL? |
Hi - Same here. There seems to be an issue with the When I try to run a streaming chat completion, the variable contains all response chunks: which can't be deserialized to a single |
I have an improved version based on @william-daconceicao's work #12 in #13 so that the (streamed) content of the response can start to be read as soon as the HTTP headers have been received. See before/after here https://www.youtube.com/watch?v=toSgN-HUOIQ |
Thanks for this, I have been working on getting the Ollama plugin merged in the source repository, so haven't tested this for a while but I have merged #13 |
Hi there,
Thanks so much for the connector.
Please could you describe how to get message streaming working?
I have set up the project accordingly and when attempting to stream i receive an error:
result = chatCompletionService.GetStreamingChatMessageContentsAsync(
history,
executionSettings: _openAIPromptExecutionSettings,
kernel: kernel);
System.Text.Json.JsonException
$>d__0.MoveNext() in xxxxHResult=0x80131500
Message='{' is invalid after a single JSON value. Expected end of data. Path: $ | LineNumber: 1 | BytePositionInLine: 0.
Source=System.Text.Json
StackTrace:
at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, JsonReaderException ex)
at System.Text.Json.Serialization.JsonConverter
1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan
1 utf8Json, JsonTypeInfo1 jsonTypeInfo, Nullable
1 actualByteCount)at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan
1 json, JsonTypeInfo
1 jsonTypeInfo)at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
at Codeblaze.SemanticKernel.Connectors.Ollama.OllamaChatCompletionService.d__2.MoveNext()
at Codeblaze.SemanticKernel.Connectors.Ollama.OllamaChatCompletionService.d__2.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)
at xxx.d__2.MoveNext() in xxx
at xxx.d__2.MoveNext() in xxx
at Program.<
This exception was originally thrown at this call stack:
[External Code]
Inner Exception 1:
JsonReaderException: '{' is invalid after a single JSON value. Expected end of data. LineNumber: 1 | BytePositionInLine: 0.
The text was updated successfully, but these errors were encountered: