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

Fix agent responses for conversation #1668

Merged
merged 3 commits into from
Dec 6, 2024
Merged

Fix agent responses for conversation #1668

merged 3 commits into from
Dec 6, 2024

Conversation

NolanTrem
Copy link
Collaborator

@NolanTrem NolanTrem commented Dec 6, 2024

Important

Improves error handling and logging for agent responses in conversations, with changes in retrieval_service.py and r2r_logger.py.

  • Error Handling:
    • Improved error handling in agent() function in retrieval_service.py for conversation retrieval.
    • Enhanced error messages in stream_response() and agent() functions in retrieval_service.py.
  • Logging:
    • Added logging for missing branches in get_conversation() in r2r_logger.py.
    • Improved logging for conversation retrieval errors in retrieval_service.py.
  • Misc:
    • Minor whitespace and formatting adjustments in log_viewer.html.

This description was created by Ellipsis for 86f638b. It will automatically update as commits are pushed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to 1fe0c19 in 40 seconds

More details
  • Looked at 212 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. py/core/providers/logger/r2r_logger.py:695
  • Draft comment:
    Avoid using print statements for debugging. Use logging instead for better control and to avoid cluttering the output in production environments.
  • Reason this comment was not posted:
    Marked as duplicate.
2. py/core/main/services/retrieval_service.py:318
  • Draft comment:
    Avoid using print statements for debugging. Use logging instead for better control and to avoid cluttering the output in production environments.
  • Reason this comment was not posted:
    Marked as duplicate.
3. py/core/main/services/retrieval_service.py:314
  • Draft comment:
    Avoid using print statements for debugging. Use logging instead for better control and to avoid cluttering the output in production environments.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_fuFhNPbpll0BBezM


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@@ -679,6 +679,7 @@ async def get_conversation(
)
conversation_created_at = row[0]

print(f"Getting a branch_id: {branch_id}")
Copy link
Contributor

Choose a reason for hiding this comment

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

Avoid using print statements for debugging. Use logging instead for better control and to avoid cluttering the output in production environments.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 1827eca in 22 seconds

More details
  • Looked at 521 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. py/core/main/services/retrieval_service.py:276
  • Draft comment:
    The error message for invalid message format is a multi-line string. Consider using a single-line string for better readability in logs.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR description mentions changes in retrieval_service.py and r2r_logger.py for error handling and logging improvements. I will focus on these areas to ensure the changes align with the description and best practices.
2. py/core/main/services/retrieval_service.py:327
  • Draft comment:
    Consider adding more context to the error log message to help with debugging, such as the conversation ID and branch ID.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR description mentions changes in retrieval_service.py and r2r_logger.py for error handling and logging improvements. I will focus on these areas to ensure the changes align with the description and best practices.
3. py/core/main/services/retrieval_service.py:425
  • Draft comment:
    The error message for HTTP 500 should be more descriptive to aid in debugging. Consider including more context about the error.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR description mentions changes in retrieval_service.py and r2r_logger.py for error handling and logging improvements. I will focus on these areas to ensure the changes align with the description and best practices.
4. py/core/providers/logger/r2r_logger.py:285
  • Draft comment:
    The conversation_id and user_id should be converted to strings before being used in the SQL query to ensure compatibility with the database.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR description mentions changes in retrieval_service.py and r2r_logger.py for error handling and logging improvements. I will focus on these areas to ensure the changes align with the description and best practices.

Workflow ID: wflow_koww42GtZcQpt52l


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 86f638b in 42 seconds

More details
  • Looked at 132 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 7 drafted comments based on config settings.
1. py/core/providers/logger/r2r_logger.py:199
  • Draft comment:
    Ensure conversation_id and user_id are consistently converted to strings before database operations to avoid type errors. This is done in some places but missing in others, such as in verify_conversation_access.
  • Reason this comment was not posted:
    Comment did not seem useful.
2. py/core/providers/logger/r2r_logger.py:222
  • Draft comment:
    Ensure conversation_id and user_id are consistently converted to strings before database operations to avoid type errors. This is done in some places but missing in others, such as in verify_conversation_access.
  • Reason this comment was not posted:
    Marked as duplicate.
3. py/core/providers/logger/r2r_logger.py:407
  • Draft comment:
    Ensure conversation_id and user_id are consistently converted to strings before database operations to avoid type errors. This is done in some places but missing in others, such as in verify_conversation_access.
  • Reason this comment was not posted:
    Marked as duplicate.
4. py/core/providers/logger/r2r_logger.py:418
  • Draft comment:
    Ensure conversation_id and user_id are consistently converted to strings before database operations to avoid type errors. This is done in some places but missing in others, such as in verify_conversation_access.
  • Reason this comment was not posted:
    Marked as duplicate.
5. py/core/providers/logger/r2r_logger.py:430
  • Draft comment:
    Ensure conversation_id and user_id are consistently converted to strings before database operations to avoid type errors. This is done in some places but missing in others, such as in verify_conversation_access.
  • Reason this comment was not posted:
    Marked as duplicate.
6. py/core/providers/logger/r2r_logger.py:479
  • Draft comment:
    Ensure conversation_id and user_id are consistently converted to strings before database operations to avoid type errors. This is done in some places but missing in others, such as in verify_conversation_access.
  • Reason this comment was not posted:
    Marked as duplicate.
7. py/core/providers/logger/r2r_logger.py:714
  • Draft comment:
    Ensure conversation_id and user_id are consistently converted to strings before database operations to avoid type errors. This is done in some places but missing in others, such as in verify_conversation_access.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_4OIHcE9NKhnjW6Mv


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@NolanTrem NolanTrem merged commit b5dfaa4 into main Dec 6, 2024
10 of 30 checks passed
@NolanTrem NolanTrem deleted the Nolan/FixAgent branch December 6, 2024 20:34
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