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: add support for o3 models & update litellm #130

Merged
merged 10 commits into from
Feb 4, 2025

Conversation

olbychos
Copy link
Contributor

@olbychos olbychos commented Feb 1, 2025

Important

Add support for O3 models, update litellm, and enhance OpenAI class for O-series models with new example and tests.

  • Behavior:
    • Add update_completion_params() in base.py to allow subclasses to modify completion parameters.
    • Modify execute() in base.py to use update_completion_params().
    • Add is_o_series_model and override update_completion_params() in openai.py to handle O-series models.
  • Examples:
    • Add adaptive_article_o3.py to demonstrate adaptive orchestrator with O3 models.
  • Dependencies:
    • Update litellm version to 1.59.12 in pyproject.toml.
  • Tests:
    • Add api_key to test_flow.py and test_ollama.py to ensure correct API usage.
    • Update test_flow.py to handle new parameter updates in OpenAI class.

This description was created by Ellipsis for 6b675d5. It will automatically update as commits are pushed.

@olbychos olbychos self-assigned this Feb 1, 2025
@olbychos olbychos requested a review from a team as a code owner February 1, 2025 14:29
Copy link

@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 ed65a80 in 2 minutes and 44 seconds

More details
  • Looked at 209 lines of code in 3 files
  • Skipped 1 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_j07WKSbicZ1eFXnM


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.

dynamiq/nodes/llms/openai.py Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Feb 1, 2025

Coverage

Coverage Report •
FileStmtsMissCoverMissing
dynamiq/nodes/llms
   base.py1301588%14, 47, 53, 200–205, 263–265, 267–269
   openai.py21385%26, 45–46
TOTAL10900336869% 

Tests Skipped Failures Errors Time
347 0 💤 0 ❌ 0 🔥 46.041s ⏱️

Copy link

@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 3d1191e in 8 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. dynamiq/nodes/llms/openai.py:75
  • Draft comment:
    Good use of params.update() to ensure existing parameters are not overwritten.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The update to use params.update() instead of assignment ensures that existing parameters are not overwritten, which is a better practice when dealing with dictionaries that may have pre-existing keys.

Workflow ID: wflow_El6n87AQwKVCJIKY


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

Copy link

@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 a8e4386 in 9 seconds

More details
  • Looked at 52 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. dynamiq/nodes/llms/openai.py:32
  • Draft comment:
    Consider updating the test cases to reflect the method name change from is_o_family to is_o_series_model to maintain consistency and avoid confusion.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The method name change from is_o_family to is_o_series_model is not reflected in the test file. This could lead to confusion or errors if the test file is not updated accordingly.

Workflow ID: wflow_amvZl4iX8is1SdKf


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

dynamiq/nodes/llms/openai.py Outdated Show resolved Hide resolved
dynamiq/nodes/llms/openai.py Outdated Show resolved Hide resolved
dynamiq/nodes/llms/openai.py Show resolved Hide resolved
@olbychos olbychos requested a review from acoola February 3, 2025 10:47
Copy link

@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 ff27000 in 46 seconds

More details
  • Looked at 223 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 9 drafted comments based on config settings.
1. dynamiq/nodes/llms/base.py:315
  • Draft comment:
    Good use of .copy() on connection parameters. This prevents accidental mutations to the shared config.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    None
2. dynamiq/nodes/llms/openai.py:44
  • Draft comment:
    Override uses property is_o_series_model correctly to switch between 'max_tokens' and 'max_completion_tokens'.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    None
3. tests/integration/nodes/llms/test_ollama.py:91
  • Draft comment:
    Added 'api_base' parameter in the expected call; ensure this matches the runtime connection config.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    None
4. dynamiq/nodes/llms/base.py:315
  • Draft comment:
    Good use of .copy() on connection parameters to avoid side effects.
  • Reason this comment was not posted:
    Comment did not seem useful.
5. dynamiq/nodes/llms/base.py:316
  • Draft comment:
    Nice that you update the params with client info instead of replacing the dict, preserving other connection parameters.
  • Reason this comment was not posted:
    Marked as duplicate.
6. dynamiq/nodes/llms/base.py:273
  • Draft comment:
    The new 'update_completion_params' hook is a good design for subclass customization.
  • Reason this comment was not posted:
    Comment did not seem useful.
7. dynamiq/nodes/llms/openai.py:44
  • Draft comment:
    Cached property 'is_o_series_model' is used correctly in update_completion_params. Its boolean usage without parentheses is intentional.
  • Reason this comment was not posted:
    Comment did not seem useful.
8. dynamiq/nodes/llms/openai.py:43
  • Draft comment:
    Optionally add an inline comment explaining why 'max_tokens' is replaced by 'max_completion_tokens' for O-series models, despite the clear docstring.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    None
9. tests/integration/nodes/llms/test_ollama.py:91
  • Draft comment:
    Test now expects an 'api_base' parameter; ensure the connection consistently supplies this value across environments.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_m1TKoUvRpJ5gbeKq


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

poetry.lock Outdated Show resolved Hide resolved
Copy link

@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.

Skipped PR review on c7a24b3 because no changed files had a supported extension. If you think this was in error, please contact us and we'll fix it right away.

poetry.lock Outdated Show resolved Hide resolved
@olbychos olbychos requested a review from acoola February 4, 2025 10:26
@olbychos olbychos merged commit 49d1f4c into main Feb 4, 2025
7 checks passed
@olbychos olbychos deleted the feat/add_support_for_o3 branch February 4, 2025 11:55
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