Skip to content

Conversation

@pgrayy
Copy link
Member

@pgrayy pgrayy commented May 20, 2025

Description

This PR introduces the following changes:

  • Implementation of a base OpenAI model provider class.
    • This class provides shared logic for formatting requests and responses to and from the OpenAI specification.
    • Any model provider that implements the OpenAI specification (e.g., LiteLLM) can derive this class.
    • We have discussed supporting a SageMaker model provider. We could ask that customers host their SageMaker models with OpenAI compatibility. Doing so means we could derive the provider class from the OpenAI base and thus reduce code duplication.
  • Implementation of the OpenAIModel provider.
    • Provides direct access to OpenAI (vs LiteLLM which adds another layer of abstraction).
  • Derive LiteLLMModel from the new OpenAIModel provider class to reduce code duplication.

Documentation PR

Am currently working on an entry in our docs that is similar to the other providers we support (docs).

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

  • hatch fmt --linter
  • hatch fmt --formatter
  • hatch test --all: Wrote new unit tests that achieve 100% coverage.
  • hatch run test-lint: All mypy checks pass.
  • hatch test tests-integ: Setup a local OpenAI compatible model service with Ollama.
  • Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli

Checklist

  • I have read the CONTRIBUTING document
  • I have added tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly: Added docstrings for the API reference. Will updates docs pages in a follow up PR.
  • I have added an appropriate example to the documentation to outline the feature: See note above.
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@pgrayy pgrayy requested a review from a team as a code owner May 20, 2025 22:24
zastrowm
zastrowm previously approved these changes May 22, 2025
@pgrayy pgrayy merged commit 6dda2d8 into strands-agents:main May 22, 2025
10 checks passed
@pgrayy pgrayy deleted the openai branch May 27, 2025 13:35
mkmeral pushed a commit to mkmeral/sdk-python that referenced this pull request Nov 20, 2025
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.

2 participants