Skip to content

feat: widen openai dependency to support 2.x for litellm compatibility#1793

Open
BV-Venky wants to merge 1 commit intostrands-agents:mainfrom
BV-Venky:feat/openai-2x-support
Open

feat: widen openai dependency to support 2.x for litellm compatibility#1793
BV-Venky wants to merge 1 commit intostrands-agents:mainfrom
BV-Venky:feat/openai-2x-support

Conversation

@BV-Venky
Copy link

@BV-Venky BV-Venky commented Mar 1, 2026

Description

Users who need LiteLLM > 1.80.10 (e.g, for SAP Generative AI Hub support) cannot install strands-agents[litellm] because LiteLLM's core dependency to use SAP models requires openai>=2.8.0, while strands has openai<1.110.0 for the litellm extra and openai<2.0.0 for the openai/sagemaker extras.

This widens the openai version upper bound in three optional dependency groups:

  • litellm: openai>=1.68.0,<1.110.0openai>=1.68.0,<3.0.0
  • openai: openai>=1.68.0,<2.0.0openai>=1.68.0,<3.0.0
  • sagemaker: openai>=1.68.0,<2.0.0openai>=1.68.0,<3.0.0

The only breaking change in openai 2.0 (ResponseFunctionToolCallOutputItem.output type change) affects the Responses API, which strands does not use. All existing unit tests pass with openai 2.24.0.

Related Issues

Resolves #1672

Type of Change

New feature

Testing

  • Installed openai 2.24.0 in hatch test environment

  • All 2000 unit tests pass with openai 2.24.0

  • Verified LiteLLMModel instantiation works with openai 2.24.0 present

  • Reviewed openai CHANGELOG from 1.109.0 to 2.24.0; the only breaking change (ResponseFunctionToolCallOutputItem.output type) does not affect strands (uses Chat Completions API, not Responses API)

  • I ran hatch run prepare

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

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.

[FEATURE] Support for LiteLLM > 1.80.10 by updating strands-agents[litellm] to use openai>=2.8.0

1 participant