Skip to content

Conversation

@avi-007
Copy link
Collaborator

@avi-007 avi-007 commented Jun 19, 2025

Q/A checklist

  • If you add new dependencies, did you update the lock file?
poetry lock --no-update
  • Run tests
ulimit -n unlimited && ./scripts/run-tests.sh
  • Do a self code review of the changes - Read the diff at least twice.
  • Carefully think about the stuff that might break because of this change - this sounds obvious but it's easy to forget to do "Go to references" on each function you're changing and see if it's used in a way you didn't expect.
  • The relevant pages still run when you press submit
  • The API for those pages still work (API tab)
  • The public API interface doesn't change if you didn't want it to (check API tab > docs page)
  • Do your UI changes (if applicable) look acceptable on mobile?
  • Ensure you have not regressed the import time unless you have a good reason to do so.
    You can visualize this using tuna:
python3 -X importtime -c 'import server' 2> out.log && tuna out.log

To measure import time for a specific library:

$ time python -c 'import pandas'

________________________________________________________
Executed in    1.15 secs    fish           external
   usr time    2.22 secs   86.00 micros    2.22 secs
   sys time    0.72 secs  613.00 micros    0.72 secs

To reduce import times, import libraries that take a long time inside the functions that use them instead of at the top of the file:

def my_function():
    import pandas as pd
    ...

Legal Boilerplate

Look, I get it. The entity doing business as “Gooey.AI” and/or “Dara.network” was incorporated in the State of Delaware in 2020 as Dara Network Inc. and is gonna need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Dara Network Inc can use, modify, copy, and redistribute my contributions, under its choice of terms.

avi-007 added 2 commits June 18, 2025 15:37
- Added logic to hide editor when user does not belong to a workspace
@avi-007 avi-007 requested a review from devxpy June 19, 2025 02:32
@entelligence-ai-pr-reviews
Copy link

Unable to Process PR Review

The author of this PR does not exist on Entelligence Dashboard. Please add the user to Entelligence AI here to enable reviews for this user.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 19, 2025

Walkthrough

This change updates the ModelPricing model in the usage_costs app by altering the model_name field to a CharField with an expanded set of predefined AI model choices and the sku field to an IntegerField with a specific set of SKU type choices. In the UI, the threshold for displaying run count captions and badges is raised from more than 1 to 50 or more in both widgets/explore.py and widgets/saved_workflow.py. Additionally, a hide_last_editor boolean parameter is introduced to control the display of last editor information in workflow preview components, with logic adjustments in widgets/saved_workflow.py and widgets/workflow_search.py.

Possibly related PRs

Suggested reviewers

  • devxpy
✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • 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 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 for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in 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 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 for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b06798e and 3d2e235.

📒 Files selected for processing (4)
  • usage_costs/migrations/0032_alter_modelpricing_model_name_alter_modelpricing_sku.py (1 hunks)
  • widgets/explore.py (1 hunks)
  • widgets/saved_workflow.py (6 hunks)
  • widgets/workflow_search.py (1 hunks)
🧰 Additional context used
🪛 Pylint (3.3.7)
usage_costs/migrations/0032_alter_modelpricing_model_name_alter_modelpricing_sku.py

[refactor] 6-6: Too few public methods (0/2)

(R0903)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (python)
🔇 Additional comments (6)
widgets/explore.py (1)

116-116: Good threshold adjustment for run count display.

Raising the threshold from >1 to ≥50 effectively reduces visual clutter by only highlighting workflows with significant usage, which improves the user experience.

widgets/workflow_search.py (1)

189-196: Well-implemented privacy control for editor visibility.

The logic correctly hides last editor information when the user isn't a member of the workspace, and the defensive use of getattr with a default value handles cases where the is_member attribute might not be present.

widgets/saved_workflow.py (3)

31-31: Proper implementation of the hide_last_editor feature.

The parameter is consistently added with appropriate defaults and properly threaded through the function calls. The conditional logic in render_footer_breadcrumbs correctly respects the visibility control.

Also applies to: 84-84, 168-168, 196-196


132-132: Good UX improvement for author name display.

Increasing the max-width from 100px to 150px provides more space for author names, reducing truncation and improving readability.


211-211: Consistent threshold adjustment with other files.

The run count display threshold change aligns with the same modification in widgets/explore.py, ensuring consistent behavior across the application.

usage_costs/migrations/0032_alter_modelpricing_model_name_alter_modelpricing_sku.py (1)

272-281: SKU choices are well-defined and appropriate.

The integer-based SKU choices with clear descriptions provide good categorization for different model usage types.

Comment on lines +241 to +263
("dream_shaper", "DreamShaper (Lykon)"),
("dreamlike_2", "Dreamlike Photoreal 2.0 (dreamlike.art)"),
("sd_2", "Stable Diffusion v2.1 (stability.ai)"),
("sd_1_5", "Stable Diffusion v1.5 (RunwayML)"),
("dall_e", "Dall-E (OpenAI)"),
("gpt_image_1", "GPT Image 1 (OpenAI)"),
("instruct_pix2pix", "✨ InstructPix2Pix (Tim Brooks)"),
("openjourney_2", "Open Journey v2 beta [Deprecated] (PromptHero)"),
("openjourney", "Open Journey [Deprecated] (PromptHero)"),
("analog_diffusion", "Analog Diffusion [Deprecated] (wavymulder)"),
("protogen_5_3", "Protogen v5.3 [Deprecated] (darkstorm2150)"),
("jack_qiao", "Stable Diffusion v1.4 [Deprecated] (Jack Qiao)"),
(
"rodent_diffusion_1_5",
"Rodent Diffusion 1.5 [Deprecated] (NerdyRodent)",
),
("sd_2", "Stable Diffusion v2.1 (stability.ai)"),
("runway_ml", "Stable Diffusion v1.5 (RunwayML)"),
("dall_e", "Dall-E (OpenAI)"),
("jack_qiao", "Stable Diffusion v1.4 [Deprecated] (Jack Qiao)"),
("wav2lip", "LipSync (wav2lip)"),
("sadtalker", "LipSync (sadtalker)"),
],
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix duplicate model choices that will cause Django validation errors.

Multiple models appear as duplicates in the choices list:

  • dream_shaper (lines 224, 241)
  • dreamlike_2 (lines 225, 242)
  • sd_2 (lines 226, 243, 257)
  • dall_e (lines 228, 245, 259)
  • gpt_image_1 (lines 230, 246)
  • Several others with duplicate keys

Django choice fields cannot have duplicate keys as this will cause validation errors.

Remove the duplicate entries to fix the model choices:

-                    ("dream_shaper", "DreamShaper (Lykon)"),
-                    ("dreamlike_2", "Dreamlike Photoreal 2.0 (dreamlike.art)"),
-                    ("sd_2", "Stable Diffusion v2.1 (stability.ai)"),
-                    ("sd_1_5", "Stable Diffusion v1.5 (RunwayML)"),
-                    ("dall_e", "Dall-E (OpenAI)"),
-                    ("gpt_image_1", "GPT Image 1 (OpenAI)"),
-                    ("instruct_pix2pix", "✨ InstructPix2Pix (Tim Brooks)"),
-                    ("openjourney_2", "Open Journey v2 beta [Deprecated] (PromptHero)"),
-                    ("openjourney", "Open Journey [Deprecated] (PromptHero)"),
-                    ("analog_diffusion", "Analog Diffusion [Deprecated] (wavymulder)"),
-                    ("protogen_5_3", "Protogen v5.3 [Deprecated] (darkstorm2150)"),
-                    ("jack_qiao", "Stable Diffusion v1.4 [Deprecated] (Jack Qiao)"),
-                    (
-                        "rodent_diffusion_1_5",
-                        "Rodent Diffusion 1.5 [Deprecated] (NerdyRodent)",
-                    ),
-                    ("sd_2", "Stable Diffusion v2.1 (stability.ai)"),
-                    ("runway_ml", "Stable Diffusion v1.5 (RunwayML)"),
-                    ("dall_e", "Dall-E (OpenAI)"),
-                    ("jack_qiao", "Stable Diffusion v1.4 [Deprecated] (Jack Qiao)"),

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In
usage_costs/migrations/0032_alter_modelpricing_model_name_alter_modelpricing_sku.py
between lines 241 and 263, there are duplicate entries in the model choices list
which will cause Django validation errors. Identify and remove all duplicate
keys so that each model key appears only once in the choices list, ensuring no
repeated keys like "sd_2", "dall_e", "jack_qiao", and others remain.

@avi-007 avi-007 merged commit 5727238 into master Jun 19, 2025
10 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Jun 27, 2025
4 tasks
@coderabbitai coderabbitai bot mentioned this pull request Jul 29, 2025
4 tasks
@coderabbitai coderabbitai bot mentioned this pull request Dec 4, 2025
4 tasks
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.

3 participants