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

feat(server): support interrupting stream, support slash commands #248

Merged
merged 2 commits into from
Nov 5, 2024

Conversation

ErikBjare
Copy link
Owner

@ErikBjare ErikBjare commented Nov 5, 2024

…lash commands


Important

Refactor api_conversation_generate() to handle user commands during streaming and manage client disconnections in gptme/server/api.py.

  • Behavior:
    • Refactor api_conversation_generate() to execute user commands during streaming.
    • Handle client disconnections in generate(), marking output as interrupted.
  • Functions:
    • Remove user-command execution from the initial part of api_conversation_generate().
    • Add client_disconnected() placeholder in generate().
  • Misc:
    • Minor logging changes in generate() to reflect client disconnection and completion.

This description was created by Ellipsis for a12ace2. 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 5b90039 in 1 minute and 18 seconds

More details
  • Looked at 109 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. gptme/server/api.py:199
  • Draft comment:
    The interrupted flag is set but not used effectively. Ensure that the logic for handling interruptions is complete and correct.
  • Reason this comment was not posted:
    Comment did not seem useful.
2. gptme/server/api.py:184
  • Draft comment:
    The client_disconnected function is not implemented. Consider implementing it to handle client disconnections properly.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_rog8bSb8G90vtOsP


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.

@codecov-commenter
Copy link

codecov-commenter commented Nov 5, 2024

Codecov Report

Attention: Patch coverage is 24.00000% with 19 lines in your changes missing coverage. Please review.

Project coverage is 72.09%. Comparing base (b3f3118) to head (a12ace2).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
gptme/server/api.py 24.00% 19 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #248      +/-   ##
==========================================
- Coverage   72.36%   72.09%   -0.27%     
==========================================
  Files          60       60              
  Lines        3893     3906      +13     
==========================================
- Hits         2817     2816       -1     
- Misses       1076     1090      +14     
Flag Coverage Δ
anthropic/claude-3-haiku-20240307 71.07% <24.00%> (-0.32%) ⬇️
openai/gpt-4o-mini 70.96% <24.00%> (-0.32%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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 a12ace2 in 16 seconds

More details
  • Looked at 82 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. gptme/server/api.py:9
  • Draft comment:
    The client_disconnected function is defined but not used, and the logic for checking client disconnection is commented out. Consider removing the function or implementing the logic to avoid confusion.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The client_disconnected function is defined but not used, and the logic for checking client disconnection is commented out. This could lead to confusion or missed functionality.
2. gptme/server/api.py:146
  • Draft comment:
    Consider moving the initialization of output closer to its first use to improve readability.
  • Reason this comment was not posted:
    Confidence changes required: 20%
    The output variable is initialized as an empty string at the start of the generate function, but it is not used until later. This initialization could be moved closer to its first use to improve code readability.
3. gptme/server/api.py:144
  • Draft comment:
    The client_disconnected function is defined but not used, and the logic for checking client disconnection is commented out. Consider removing the function or implementing the logic to avoid confusion.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The client_disconnected function is defined but not used, and the logic for checking client disconnection is commented out. This could lead to confusion or missed functionality.

Workflow ID: wflow_98SiU98ZWcMJCw9c


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

@ErikBjare ErikBjare changed the title fix(server): started work on interrupting stream, added support for s… fix(server): support interrupting stream, support for slash commands Nov 5, 2024
@ErikBjare ErikBjare changed the title fix(server): support interrupting stream, support for slash commands feat(server): support interrupting stream, support for slash commands Nov 5, 2024
@ErikBjare ErikBjare changed the title feat(server): support interrupting stream, support for slash commands feat(server): support interrupting stream, support slash commands Nov 5, 2024
@ErikBjare ErikBjare merged commit c1d136f into master Nov 5, 2024
7 checks 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