Skip to content

Commit

Permalink
Merge pull request #119 from SimonCropp/remove-redundant-
Browse files Browse the repository at this point in the history
remove redundant ?
  • Loading branch information
awaescher authored Oct 26, 2024
2 parents 340edf3 + 8a40fcf commit 1800770
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Chat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public async IAsyncEnumerable<string> SendAsAsync(ChatRole role, string message,
if (answer is not null)
{
messageBuilder.Append(answer);
yield return answer.Message?.Content ?? string.Empty;
yield return answer.Message.Content ?? string.Empty;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/OllamaApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ private async Task EnsureSuccessStatusCodeAsync(HttpResponseMessage response)

try
{
couldParse = JsonDocument.Parse(body)?.RootElement.TryGetProperty("error", out errorElement) ?? false;
couldParse = JsonDocument.Parse(body).RootElement.TryGetProperty("error", out errorElement);
}
catch (JsonException)
{
Expand Down

0 comments on commit 1800770

Please sign in to comment.