Repository navigation
LCORE-4707: Bumped PAI version to 2.38.0 #3020
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
Merged
+111
−106
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,8 +57,7 @@ dependencies = [ | |
| # Used by authorization resolvers | ||
| "jsonpath-ng>=1.6.1,<1.9.0", | ||
| "psycopg2-binary>=2.9.10", | ||
| # LCORE-1565 | ||
| "litellm>=1.83.7", | ||
| "litellm==1.107.0rc2", | ||
| "urllib3>=2.6.3", | ||
| # Used for agent card configuration | ||
| "PyYAML>=6.0.0", | ||
|
|
@@ -86,7 +85,7 @@ dependencies = [ | |
| # Used for model context windows in conversation compaction (LCORE-4765) | ||
| "genai-prices>=0.1.12", | ||
| # Used for Pydantic AI | ||
| "pydantic-ai==2.27.1", | ||
| "pydantic-ai==2.38.0", | ||
| "pydantic-ai-skills>=0.11.0", | ||
| # Used for OpenTelemetry instrumentation | ||
| "opentelemetry-distro>=0.49b0", | ||
|
|
@@ -207,9 +206,6 @@ ogxlibdev = [ | |
| "peft>=0.15.2", | ||
| # API inference: remote::vertexai | ||
| "google-cloud-aiplatform>=1.130.0", | ||
| # API inference: remote::watsonx | ||
| # LCORE-1565 | ||
| "litellm>=1.88.6", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WatsonX no longer uses litellm dependency, litellm is already present in root deps. |
||
| # Other | ||
| "autoevals>=0.0.129", | ||
| "fire>=0.7.0", | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |
| from ogx_client import AsyncOgxClient | ||
| from openai import AsyncOpenAI | ||
| from pydantic_ai import ModelProfile | ||
| from pydantic_ai._http import AsyncHTTPClient | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Type union for httpx and httpx2 clients |
||
| from pydantic_ai.models import create_async_http_client | ||
| from pydantic_ai.profiles.openai import openai_model_profile | ||
| from pydantic_ai.providers import Provider | ||
|
|
@@ -88,7 +89,7 @@ def __init__( | |
| base_url: Optional[str] = None, | ||
| api_key: Optional[str] = None, | ||
| library_client: Optional[AsyncOGXAsLibraryClient] = None, | ||
| http_client: Optional[httpx.AsyncClient] = None, | ||
| http_client: Optional[AsyncHTTPClient] = None, | ||
| ) -> None: | ||
| """Create a new OGX provider. | ||
|
|
||
|
|
@@ -102,8 +103,8 @@ def __init__( | |
| library_client: An initialized ``AsyncOGXAsLibraryClient`` for library mode. | ||
| When provided, requests are dispatched in-process (no server needed). | ||
| Mutually exclusive with ``base_url``, ``api_key``, and ``http_client``. | ||
| http_client: An existing ``httpx.AsyncClient`` to use for making HTTP requests. | ||
| Must be ``None`` when ``library_client`` is provided. | ||
| http_client: An existing ``httpx``/``httpx2`` async client for HTTP | ||
| requests. Must be ``None`` when ``library_client`` is provided. | ||
|
|
||
| """ | ||
| if library_client is not None: | ||
|
|
@@ -123,8 +124,9 @@ def __init__( | |
| base_url="http://ogx-library", | ||
| timeout=httpx.Timeout(None), | ||
| ) | ||
| # OpenAI 3 types http_client as httpx2 only; legacy httpx still works. | ||
| self._client = AsyncOpenAI( | ||
| http_client=lib_http_client, | ||
| http_client=lib_http_client, # type: ignore[arg-type] | ||
| base_url="http://ogx-library/v1", | ||
| api_key="not-needed", | ||
| ) | ||
|
|
@@ -135,15 +137,15 @@ def __init__( | |
| self._client = AsyncOpenAI( | ||
| base_url=base_url, | ||
| api_key=api_key, | ||
| http_client=http_client or create_async_http_client(), | ||
| http_client=http_client or create_async_http_client(), # type: ignore[arg-type] | ||
| ) | ||
|
|
||
| def __repr__(self) -> str: | ||
| """Return a string representation of the provider.""" | ||
| return f"OgxProvider(name={self.name!r}, base_url={self.base_url!r})" | ||
|
|
||
| def _set_http_client(self, http_client: httpx.AsyncClient) -> None: | ||
| """Inject an httpx.AsyncClient into the underlying OpenAI client. | ||
| def _set_http_client(self, http_client: AsyncHTTPClient) -> None: | ||
| """Inject an async HTTP client into the underlying OpenAI client. | ||
|
|
||
| Replaces the internal HTTP transport by assigning directly to the | ||
| protected ``self._client._client`` attribute of the AsyncOpenAI instance. | ||
|
|
@@ -152,4 +154,4 @@ def _set_http_client(self, http_client: httpx.AsyncClient) -> None: | |
| http_client: The async HTTP client to use for subsequent requests. | ||
|
|
||
| """ | ||
| self._client._client = http_client # pyright: ignore[reportPrivateUsage] # pylint: disable=protected-access | ||
| self._client._client = http_client # type: ignore[assignment] # pylint: disable=protected-access | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required for vLLM provider