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

Prevent duplicate executions #1291

Merged
merged 1 commit into from
Dec 11, 2024
Merged

Prevent duplicate executions #1291

merged 1 commit into from
Dec 11, 2024

Conversation

Josh-XT
Copy link
Owner

@Josh-XT Josh-XT commented Dec 11, 2024

This pull request includes a significant refactor of the command and answer handling logic in the run method of the agixt/Interactions.py file. The changes aim to improve the structure and readability of the code while ensuring that commands and responses are processed more efficiently.

Key changes include:

Command Handling Improvements:

  • Introduced a processed_length variable to track the length of the response that has been processed, ensuring that only new content is processed in each iteration.
  • Added an initial command execution check to handle any commands present in the initial response before entering the main processing loop.

Main Processing Loop Enhancements:

  • Refactored the main processing loop to check for new commands and process them only if new content is detected, reducing unnecessary iterations.
  • Improved the handling of the answer block by ensuring that the loop continues to check for new commands after obtaining more response content.

These changes aim to optimize the command execution flow and ensure that the assistant's response is processed efficiently.

@Josh-XT Josh-XT marked this pull request as ready for review December 11, 2024 14:02
@Josh-XT Josh-XT merged commit 1b9c674 into main Dec 11, 2024
7 checks passed
@Josh-XT Josh-XT deleted the issue-1289 branch December 11, 2024 14:02
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.

1 participant