Skip to content
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

Merged
merged 5 commits into from
Dec 29, 2023
Merged

Agents #92

merged 5 commits into from
Dec 29, 2023

Conversation

TesAnti
Copy link
Collaborator

@TesAnti TesAnti commented Dec 29, 2023

Added agents and chat group

Copy link
Contributor

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");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use InvalidOperationException instead Exception

Copy link
Collaborator Author

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.

Copy link
Contributor

@HavenDV HavenDV Dec 29, 2023

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.

Copy link
Collaborator Author

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.

@HavenDV HavenDV changed the title Ahents Agents Dec 29, 2023
@HavenDV HavenDV merged commit 052e3ca into tryAGI:main Dec 29, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants