Skip to content

Conversation

@biplavbarua
Copy link

Summary

Improved the import error message when 'openai' is missing in 'autogen-ext'.

Changes

  • Wrapped 'openai' imports in 'python/packages/autogen-ext/src/autogen_ext/models/openai/_openai_client.py' with a try-except block.
  • Raises a descriptive ImportError: 'Please install openai using pip install autogen-ext[openai]'.

Why

Fixes #4605. Users were facing confusing ModuleNotFoundErrors when the optional openai dependency was missing. This makes the resolution clear.

Wrapped openai imports in a try-except block to provide a clear error message instructing users to install autogen-ext[openai] when the dependency is missing. Fixes microsoft#4605.
@biplavbarua
Copy link
Author

@microsoft-github-policy-service agree

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.

Improve Import Error Messages for LLM Client Dependencies

1 participant