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: remove exclusive mode #423

Merged
merged 2 commits into from
Jan 25, 2025

Conversation

jrmi
Copy link
Contributor

@jrmi jrmi commented Jan 25, 2025

This MR fixes two minor comments from previous MRs:


Important

Remove exclusive_mode and simplify tool format handling in gptme/tools/base.py, updating related logic in llm_anthropic.py and llm_openai.py.

  • Behavior:
    • Remove exclusive_mode variable and related logic in gptme/tools/base.py.
    • Simplify tool format handling by removing exclusive_mode checks in ToolUse.iter_from_content().
  • Functions:
    • Update _handle_tools() in llm_anthropic.py and llm_openai.py to use before_tool.strip() instead of before_tool.replace("\n", "").
  • Tests:
    • Remove print() statement from test_message_conversion_with_tool_and_non_tool() in tests/test_llm_anthropic.py.

This description was created by Ellipsis for f725110. 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.

👍 Looks good to me! Reviewed everything up to f725110 in 28 seconds

More details
  • Looked at 79 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. gptme/llm/llm_anthropic.py:254
  • Draft comment:
    The change from if before_tool: to if before_tool.strip(): ensures that only non-whitespace text is considered, which is a more accurate check.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The change from if before_tool: to if before_tool.strip(): is a good improvement. It ensures that only non-whitespace text is considered, which is more accurate for the intended logic.
2. gptme/llm/llm_openai.py:305
  • Draft comment:
    The change from if before_tool.replace("\n", ""): to if before_tool.strip(): ensures that only non-whitespace text is considered, which is a more accurate check.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The change from if before_tool.replace("\n", ""): to if before_tool.strip(): is a good improvement. It ensures that only non-whitespace text is considered, which is more accurate for the intended logic.
3. gptme/tools/base.py:34
  • Draft comment:
    The removal of the exclusive_mode variable is appropriate since it is no longer used in the code. This helps in cleaning up the codebase.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The removal of the exclusive_mode variable is appropriate since it is no longer used in the code. This helps in cleaning up the codebase.
4. gptme/tools/base.py:344
  • Draft comment:
    The removal of the exclusive_mode condition in the iter_from_content method is appropriate since exclusive_mode is no longer used. This simplifies the logic.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The removal of the exclusive_mode condition in the iter_from_content method is appropriate since exclusive_mode is no longer used. This simplifies the logic.

Workflow ID: wflow_jM2bAISBPJzzekK6


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

@ErikBjare ErikBjare merged commit 0c99cb8 into ErikBjare:master Jan 25, 2025
5 of 8 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