Skip to content

Conversation

royerloic
Copy link
Member

@royerloic royerloic commented Jun 25, 2025

Summary by CodeRabbit

  • New Features

    • Expanded the list of available Anthropic Claude models to include additional, newer models.
  • Improvements

    • Updated default GPT-vision model to "gpt-4o" for image description and "gpt-4" for availability checks.
    • Enhanced filtering of OpenAI models to exclude models with certain substrings (e.g., vision, instruct, preview).
    • Clarified prompt instructions for segmentation tools and added import guidance for coding tasks.
    • Improved sorting of OpenAI models for greater robustness.
    • Updated dependency version for duckduckgo-search.
  • Bug Fixes

    • Removed warning dialog when selecting non-default LLM models.
  • Other

    • Minor documentation and whitespace adjustments.

…--> fixes problem due to recent updates to models and apis.
@royerloic royerloic self-assigned this Jun 25, 2025
Copy link
Contributor

coderabbitai bot commented Jun 25, 2025

Caution

Review failed

The pull request is closed.

## Walkthrough

This update revises dependency versions, modifies prompt instructions, adjusts model selection logic, clarifies type hints, and improves robustness in model sorting and filtering. It also includes minor documentation and whitespace changes, along with a regular expression correction for HTML text extraction.

## Changes

| File(s)                                                                                   | Change Summary                                                                                                    |
|------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
| setup.cfg                                                                                | Updated package version to v2025.06.25 and `duckduckgo-search` dependency from 6.3.2 to 8.0.4.                    |
| src/napari_chatgpt/_widget.py                                                            | Removed warning dialog and console warning for non-GPT4/Claude-3 LLM model selection in `_start_omega`.          |
| src/napari_chatgpt/omega/tools/instructions.py                                           | Added instruction to import 'ArrayLike' from 'numpy.typing' when required.                                        |
| src/napari_chatgpt/omega/tools/napari/cell_nuclei_segmentation_tool.py                   | Clarified segmentation prompt to require `segment(viewer)` returning an array, removing explicit type hint.      |
| src/napari_chatgpt/omega/tools/napari/widget_maker_tool.py                               | Removed two trailing blank lines from `_instructions` string literal.                                            |
| src/napari_chatgpt/utils/anthropic/model_list.py                                         | Refactored and expanded Anthropic model list; updated return type to `list[str]`; improved docstring and logging.|
| src/napari_chatgpt/utils/api_keys/api_key.py                                             | Added a blank line after API key dialog call for readability; no logic change.                                   |
| src/napari_chatgpt/utils/openai/default_model.py                                         | Wrapped version string float conversion in try-except to handle non-numeric versions gracefully in sorting.       |
| src/napari_chatgpt/utils/openai/gpt_vision.py                                            | Changed default GPT-vision model names in `is_gpt_vision_available` and `describe_image` functions.               |
| src/napari_chatgpt/utils/openai/model_list.py                                            | Added filtering to exclude models with substrings like 'vision', 'instruct', 'preview', etc., from model list.    |
| src/napari_chatgpt/utils/web/scrapper.py                                                 | Changed regex pattern to raw string for whitespace normalization in `text_from_html` function.                    |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant User
    participant Widget
    participant ModelSelector
    participant OmegaServer

    User->>Widget: Selects LLM model
    Widget->>ModelSelector: Get selected model
    ModelSelector-->>Widget: Returns model name
    Widget->>OmegaServer: Starts Omega with selected model

Possibly related PRs

  • #57: Updates duckduckgo-search dependency in setup.cfg from 6.2.11 to 6.3.2, showing a related progression in dependency management.

Poem

In the meadow of code, dependencies bloom,
Models are sorted—no more doom and gloom!
Prompts are more clear, instructions refined,
With whitespace and regex perfectly aligned.
A hop, a skip, a version anew—
This rabbit’s delighted to code with you! 🐇✨


<!-- walkthrough_end -->
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEejqANiS4AlEs3xTIibALD5u45mguQHS3wB3NAoMeAwiABpIbG5aahI/RRJfCyRcdAx6JW4yJQwGeGldMD1IADN4AA9i3kErZkhabESCSApRdhi4hOQ2/xTkTHo0biQNAwA5bGYBSi4ANgWDAFVEefb8WUoLfHgGI31jcCg8/nKcAmIyZRp6JlZ2Ll5+YVFxKRl5JiUqVXUtDojiYoHBUKhMJdCKRyFQ7gpHhhOO00IFnDNvBR5HIFL8VGpNNoSoZjqYDOtcLENAxykQOAYAERMgwAYhZkAAggBJa6whL0FysELyfAXBiwTCkRBmWCJbhoBgAazQpEgUgoiHg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iiOijwkyo9Rg+Ulgo03Sgq1Ung93dIG0zOO0jRcQ81QuaQwDEMzkwUzVOquiBq9sRDKdD8XLVuAWbba6LAXbJMbUdJSoVlEadsLrTfIvJgT6cWayfY8fHc6gcUNuNzcQeah6Iva4ss7DILVMCw05YYkExwYoTAeQfY++fAVcrkfCs6Q/b5R6/49EAQa4hHbiqM46aIOYrNBuXAEG7i2JAQQgeNSG0G6coS0Gs7erNgKG46AzLUDG11MyGKg+M/biuK46LYhaoCV8oYGAooPLeQDoT8h6IFDSFsbk2DA3BDG7KoQFfuZOQbfY2lPGUY18zQTEg8b+Oyleb4i5YYa/cCw/SCmItEDpd8ejD2edGnA2ZC1kuEwhJnDCpE7dSknCnCV2KAT+Z0+nLMTUAXIGHlEhB4g26g3CqeBgk9LS2iRU40p3V8AQCiRy6fSgJqj9ASePB09q5PbEmQsuOkh6tmW8M2XlQcDwkihWSgHUPyUqGgKoKqQNTse7ZgCwFQzk860QS6z6CwlseUFOuJI8toDobrRAuuujeEXtGgLDAdG1KgYKAacIlGX6IgbA+URAltJMo+O0FGbrXUa4/UBkAAHUQDnoAGpZzW4UYqA0Qp69QKBZ757EAl6l8hhaAhBnJcAh80At93hkA7M0R2zRh+4SA+wGwHq8YStKB7J4QcQQVaoEInZ3tEhPyMgIZ197M/yjsWx7qqBPpG0aYwLLw5bIET80RwCOSv8MBITsENbAEtbULSDET7aKTHbjbRV6DyrShSRTgsVxs8BoRWr4QHg7EuA17RIdEkU7C8R/hCQgRSGQQERXNK9aBxLBLXxaAGZKpiQyGkUFgHQ0APQPQ0AFgfQlwfQfRoxVAPQQwaQfQSAHQfR/ofQXRaAnQtGfRaA1GlxDGxGDBuG6H1Buz+HuwQr2k68zh9AgA -->

<!-- internal state end -->

---

<details>
<summary>📜 Recent review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between b62a11a6838825bb15cf8e28fa802d0e28d1530e and 81c95e8b07452289b17da77bd51f32dfa0db0c82.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `setup.cfg` (2 hunks)

</details>

</details>
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

<details open="true">
<summary>🧪 Generate Unit Tests</summary>

- [ ] <!-- {"checkboxId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} -->   Create PR with Unit Tests
- [ ] <!-- {"checkboxId": "07f1e7d6-8a8e-4e23-9900-8731c2c87f58", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} -->   Post Copyable Unit Tests in Comment
- [ ] <!-- {"checkboxId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} -->   Commit Unit Tests in branch `hot_fixes`

</details>

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=royerlab/napari-chatgpt&utm_content=66):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai explain this code block.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and explain its main purpose.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai auto-generate unit tests` to generate unit tests for this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

@royerloic royerloic merged commit 32559e0 into main Jun 25, 2025
1 of 10 checks passed
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
src/napari_chatgpt/utils/anthropic/model_list.py (1)

8-8: Verify the future verification date.

The verification date shows "2025-06-25" which appears to be in the future. Please ensure this date is accurate.

src/napari_chatgpt/utils/openai/model_list.py (1)

51-53: Good filtering logic to exclude specialized models.

The filtering approach effectively removes models that are typically unsuitable for general chat purposes (vision, audio, preview, instruct variants). This aligns well with the PR objective of improving model selection.

Consider if this filtering might be too broad - some models containing these substrings might still be useful in specific contexts. However, for the general use case this filtering appears appropriate.

src/napari_chatgpt/utils/openai/gpt_vision.py (1)

32-32: Consider model consistency between vision functions.

The default model has been updated to "gpt-4o" while the is_gpt_vision_available function uses 'gpt-4' as default. Consider whether these functions should use the same default model for consistency, especially since they both relate to vision capabilities.

If both functions should use the same model, consider extracting a constant:

+# Default vision model
+DEFAULT_VISION_MODEL = "gpt-4o"
+
 def is_gpt_vision_available(vision_model_name: str = DEFAULT_VISION_MODEL) -> bool:
 def describe_image(image_path: str,
                    query: str = 'Here is an image, please carefully describe it in detail.',
-                   model: str = "gpt-4o",
+                   model: str = DEFAULT_VISION_MODEL,
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e60f329 and b62a11a.

📒 Files selected for processing (11)
  • setup.cfg (1 hunks)
  • src/napari_chatgpt/_widget.py (0 hunks)
  • src/napari_chatgpt/omega/tools/instructions.py (1 hunks)
  • src/napari_chatgpt/omega/tools/napari/cell_nuclei_segmentation_tool.py (1 hunks)
  • src/napari_chatgpt/omega/tools/napari/widget_maker_tool.py (0 hunks)
  • src/napari_chatgpt/utils/anthropic/model_list.py (1 hunks)
  • src/napari_chatgpt/utils/api_keys/api_key.py (1 hunks)
  • src/napari_chatgpt/utils/openai/default_model.py (1 hunks)
  • src/napari_chatgpt/utils/openai/gpt_vision.py (2 hunks)
  • src/napari_chatgpt/utils/openai/model_list.py (1 hunks)
  • src/napari_chatgpt/utils/web/scrapper.py (1 hunks)
💤 Files with no reviewable changes (2)
  • src/napari_chatgpt/omega/tools/napari/widget_maker_tool.py
  • src/napari_chatgpt/_widget.py
🔇 Additional comments (9)
src/napari_chatgpt/omega/tools/instructions.py (1)

26-26: LGTM! Good addition for type hinting best practices.

This instruction clearly guides developers to import ArrayLike from the proper location when type annotations are needed, following NumPy's recommended typing practices.

src/napari_chatgpt/omega/tools/napari/cell_nuclei_segmentation_tool.py (1)

182-182: LGTM! Good flexibility improvement while maintaining clarity.

Removing the mandatory -> ArrayLike type hint requirement makes the instruction more flexible, while still clearly communicating that the function should return an array. This pairs well with the ArrayLike import guidance added to the instructions file.

setup.cfg (1)

58-58: ```shell
#!/bin/bash

Fetch release notes for 7.x and 8.x major versions from GitHub

echo "Retrieving release notes for duckduckgo_search 7.x and 8.x:"
curl -s https://api.github.com/repos/deedy5/duckduckgo_search/releases?per_page=100
| jq -r '.[]
| select(.tag_name | test("^[78]\."))
| "Tag: (.tag_name)\n(.body // "No release notes")\n---"'


</details>
<details>
<summary>src/napari_chatgpt/utils/api_keys/api_key.py (1)</summary>

`49-49`: **Good formatting improvement.**

The added blank line improves readability by clearly separating the API key request logic from the Qt app cleanup section.

</details>
<details>
<summary>src/napari_chatgpt/utils/anthropic/model_list.py (2)</summary>

`4-4`: **Excellent type annotation improvement.**

The specific `list[str]` return type annotation is much better than the generic `list` type for better type safety and IDE support.

---

`11-20`: **Verify the existence of newer model names.**

Some of the models in the list appear to have future release dates or may not exist yet. Please verify these model names are valid and available:

- `claude-3-7-sonnet-20250219` (February 2025 date)
- `claude-sonnet-4-20250514` (May 2025 date) 
- `claude-opus-4-20250514` (May 2025 date)



```web
Are the following Anthropic Claude models currently available: claude-3-7-sonnet-20250219, claude-sonnet-4-20250514, claude-opus-4-20250514?
src/napari_chatgpt/utils/web/scrapper.py (1)

62-62: Good regex pattern fix using raw string.

Using a raw string r"\s\s+" instead of a regular string "\s\s+" is the correct approach for regex patterns to avoid issues with escape sequence interpretation.

src/napari_chatgpt/utils/openai/default_model.py (1)

33-39: LGTM! Excellent error handling improvement.

The try-except block properly handles edge cases where model version strings cannot be converted to float, ensuring robust model sorting. Using float('inf') to sort problematic models last is a smart approach that prevents crashes while maintaining predictable behavior.

src/napari_chatgpt/utils/openai/gpt_vision.py (1)

7-7: Verify that 'gpt-4' supports vision capabilities.

The default model has been updated from 'gpt-4-vision-preview' to 'gpt-4'. Please ensure that the standard 'gpt-4' model supports vision functionality, as this function specifically checks for GPT-vision availability.

#!/bin/bash
# Description: Check if 'gpt-4' model supports vision capabilities by searching for documentation or usage patterns
rg -A 5 -B 2 "gpt-4.*vision\|vision.*gpt-4" --type py

@coderabbitai coderabbitai bot mentioned this pull request Aug 23, 2025
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