-
-
Notifications
You must be signed in to change notification settings - Fork 92
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
Agents #92
Agents #92
Conversation
# Conflicts: # src/libs/Providers/LangChain.Providers.LLamaSharp/LLamaSharpConfiguration.cs
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 can be removed?
messagesCount = _conversationBufferMemory.ChatHistory.Messages.Count; | ||
if (ThrowOnLimit && messagesCount >= _messagesLimit) | ||
{ | ||
throw new Exception("Messages limit reached"); |
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.
Use InvalidOperationException instead Exception
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 is not an invalid operation. This exception is thrown when agens are behaving wrong. For example, you expecting that conversation will be over within 10 messages, but one of agents starts halucinating and continues dicussion instead of stopping 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.
https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/exceptions/creating-and-throwing-exceptions#things-to-avoid-when-throwing-exceptions
I'm talking about this article.
In my code I usually only use ArgumentException/ArgumentNullException/InvalidOperationException and very rarely define my own. If you create a new exception, then there is also a set of rules that are described in this article.
In my opinion InvalidOperationException is appropriate here
An inappropriate call to an object is made, based on the object state. One example might be trying to write to a read-only file. In cases where an object state doesn't allow an operation, throw an instance of InvalidOperationException or an object based on a derivation of this class.
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.
Ok, it's not that critical to me.
Added agents and chat group