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 model family specification #4856

Merged
merged 7 commits into from
Dec 30, 2024
Merged

Conversation

jackgerrits
Copy link
Member

@jackgerrits jackgerrits commented Dec 30, 2024

Adds support for the model client to advertise the family of model it supports.

This is a non breaking change but the change, however, for a client to properly advertise its family changes are required.

I'm not sure if I like the ModelFamily class or not. The idea was to make it easier to find the families that are supported by AutoGen but make it clear other families can be added by extensions and user code. This is the main reason I opted not to use an Enum. Also, an Enum might make component config etc trickier

Closes #3883

@jackgerrits jackgerrits requested a review from Copilot December 30, 2024 16:25
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 12 changed files in this pull request and generated 1 comment.

Files not reviewed (7)
  • python/packages/autogen-agentchat/src/autogen_agentchat/agents/_assistant_agent.py: Evaluated as low risk
  • python/packages/autogen-ext/src/autogen_ext/models/replay/_replay_chat_completion_client.py: Evaluated as low risk
  • python/packages/autogen-ext/src/autogen_ext/teams/magentic_one.py: Evaluated as low risk
  • python/packages/autogen-ext/tests/models/test_openai_model_client.py: Evaluated as low risk
  • python/packages/autogen-ext/src/autogen_ext/models/openai/config/init.py: Evaluated as low risk
  • python/packages/autogen-ext/src/autogen_ext/agents/web_surfer/_multimodal_web_surfer.py: Evaluated as low risk
  • python/packages/autogen-ext/src/autogen_ext/models/openai/_model_info.py: Evaluated as low risk
Comments suppressed due to low confidence (4)

python/packages/autogen-core/src/autogen_core/models/_model_client.py:100

  • [nitpick] The warning message could be clearer. Suggestion: 'The model client in use does not implement the model_info property. Falling back to the deprecated capabilities property, which will be removed soon. Please implement the model_info property in the model client class.'
Model client in use does not implement model_info property. Falling back to capabilities property. The capabilities property is deprecated and will be removed soon, please implement model_info instead in the model client class.

python/packages/autogen-ext/src/autogen_ext/models/openai/_openai_client.py:371

  • The condition to check if both model_capabilities and model_info are provided is correct, but we need to ensure that this case is covered by tests to prevent future issues.
elif model_capabilities is not None and model_info is not None:

python/packages/autogen-ext/src/autogen_ext/models/openai/_openai_client.py:374

  • Ensure that there are tests to verify that the deprecation warning for model_capabilities is triggered correctly.
warnings.warn("model_capabilities is deprecated, use model_info instead", DeprecationWarning, stacklevel=2)

python/packages/autogen-ext/src/autogen_ext/models/openai/_openai_client.py:909

  • [nitpick] The method name capabilities should be updated to reflect the new ModelInfo property to avoid confusion.
def capabilities(self) -> ModelCapabilities:

@jackgerrits jackgerrits requested a review from afourney December 30, 2024 18:41
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.

Add model-family to context of model client
3 participants