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

refactor(backend): Centralize Block Cost into a Single File #8623

Merged

Conversation

majdyz
Copy link
Contributor

@majdyz majdyz commented Nov 12, 2024

Currently, the cost for LLM blocks is defined separately (in llm.py) from the rest of the block cost (in credit.py).
We need a single place to configure these.

Changes 🏗️

  • Moved blockcost-related models to cost.py.
  • Merged LLM cost and the rest of the block cost to block_cost_config.py.

Checklist 📋

For code changes:

  • I have clearly listed my changes in the PR description
  • I have made a test plan
  • I have tested my changes according to the test plan:
    • ...
Example test plan
  • Create from scratch and execute an agent with at least 3 blocks
  • Import an agent from file upload, and confirm it executes correctly
  • Upload agent to marketplace
  • Import an agent from marketplace and confirm it executes correctly
  • Edit an agent from monitor, and confirm it executes correctly

For configuration changes:

  • .env.example is updated or already compatible with my changes
  • docker-compose.yml is updated or already compatible with my changes
  • I have included a list of my configuration changes in the PR description (under Changes)
Examples of configuration changes
  • Changing ports
  • Adding new services that need to communicate with each other
  • Secrets or environment variable changes
  • New or infrastructure changes such as databases

Copy link

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Code Duplication
The MODEL_COST dictionary duplicates the model list from MODEL_METADATA. Consider deriving MODEL_COST from MODEL_METADATA to avoid maintaining two separate lists.

Default Cost Configuration
The default cost configuration using GPT4O model should be validated to ensure it's the intended default choice for all unspecified cases.

Copy link

netlify bot commented Nov 12, 2024

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit b6cd563
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/6733219f86702d000880867e

@majdyz majdyz enabled auto-merge (squash) November 12, 2024 09:38
@majdyz majdyz merged commit ef7e504 into dev Nov 12, 2024
15 checks passed
@majdyz majdyz deleted the zamilmajdy/secrt-995-centralise-credit-prices-into-a-single-file branch November 12, 2024 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants