-
Notifications
You must be signed in to change notification settings - Fork 93
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
Source code cleanups #163
Source code cleanups #163
Conversation
@@ -20,7 +21,7 @@ public void Append(ChatResponseStream? item) | |||
{ | |||
_messageBuilder.Append(item); | |||
|
|||
if (item?.Done ?? false) | |||
if (item is not null && item.Done) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is very subjective, I know, but I actually prefer item?.Done ?? false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood, this can be reversed.
test/TestOllamaApiClient.cs
Outdated
@@ -5,7 +5,7 @@ | |||
|
|||
namespace Tests; | |||
|
|||
#pragma warning disable CS8424 // The EnumeratorCancellationAttribute will have no effect. The attribute is only effective on a parameter of type CancellationToken in an async-iterator method returning IAsyncEnumerable | |||
#pragma warning disable CS8424 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why would you remove the comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It already tells you this message if you hover over CS8424
in VSCode or Visual Studio, but it can be reversed if you want to keep it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you'd need tooling support for that. Might not be there on GitHub on the web, for example. I'd prefer to keep it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why would you remove those? it's an extension method that can be used in other projects
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake, I thought it was internal
like StreamingChatCompletionUpdateAppender.cs
and StreamingChatCompletionUpdateBuilder.cs
which can be safely removed.
@awaescher I've made changes based on your feedback, please take a look. |
This pull request cleans up some of the source code:
using
susing
s