Skip to content

Commit 1e6805b

Browse files
committed
refactor: rename OVHcloudAIEndpoints to OVHcloud when needed
1 parent 3641872 commit 1e6805b

File tree

9 files changed

+24
-24
lines changed

9 files changed

+24
-24
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ We built Pydantic AI with one simple aim: to bring that FastAPI feeling to GenAI
3939
[Pydantic Validation](https://docs.pydantic.dev/latest/) is the validation layer of the OpenAI SDK, the Google ADK, the Anthropic SDK, LangChain, LlamaIndex, AutoGPT, Transformers, CrewAI, Instructor and many more. _Why use the derivative when you can go straight to the source?_ :smiley:
4040

4141
2. **Model-agnostic**:
42-
Supports virtually every [model](https://ai.pydantic.dev/models/overview) and provider: OpenAI, Anthropic, Gemini, DeepSeek, Grok, Cohere, Mistral, and Perplexity; Azure AI Foundry, Amazon Bedrock, Google Vertex AI, Ollama, LiteLLM, Groq, OpenRouter, Together AI, Fireworks AI, Cerebras, Hugging Face, GitHub, Heroku, Vercel, Nebius, OVHcloud AI Endpoints. If your favorite model or provider is not listed, you can easily implement a [custom model](https://ai.pydantic.dev/models/overview#custom-models).
42+
Supports virtually every [model](https://ai.pydantic.dev/models/overview) and provider: OpenAI, Anthropic, Gemini, DeepSeek, Grok, Cohere, Mistral, and Perplexity; Azure AI Foundry, Amazon Bedrock, Google Vertex AI, Ollama, LiteLLM, Groq, OpenRouter, Together AI, Fireworks AI, Cerebras, Hugging Face, GitHub, Heroku, Vercel, Nebius, OVHcloud. If your favorite model or provider is not listed, you can easily implement a [custom model](https://ai.pydantic.dev/models/overview#custom-models).
4343

4444
3. **Seamless Observability**:
4545
Tightly [integrates](https://ai.pydantic.dev/logfire) with [Pydantic Logfire](https://pydantic.dev/logfire), our general-purpose OpenTelemetry observability platform, for real-time debugging, evals-based performance monitoring, and behavior, tracing, and cost tracking. If you already have an observability platform that supports OTel, you can [use that too](https://ai.pydantic.dev/logfire#alternative-observability-backends).

docs/api/providers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@
4444

4545
::: pydantic_ai.providers.nebius.NebiusProvider
4646

47-
::: pydantic_ai.providers.ovhcloud.OVHcloudAIEndpointsProvider
47+
::: pydantic_ai.providers.ovhcloud.OVHcloudProvider

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ We built Pydantic AI with one simple aim: to bring that FastAPI feeling to GenAI
1414
[Pydantic Validation](https://docs.pydantic.dev/latest/) is the validation layer of the OpenAI SDK, the Google ADK, the Anthropic SDK, LangChain, LlamaIndex, AutoGPT, Transformers, CrewAI, Instructor and many more. _Why use the derivative when you can go straight to the source?_ :smiley:
1515

1616
2. **Model-agnostic**:
17-
Supports virtually every [model](models/overview.md) and provider: OpenAI, Anthropic, Gemini, DeepSeek, Grok, Cohere, Mistral, and Perplexity; Azure AI Foundry, Amazon Bedrock, Google Vertex AI, Ollama, LiteLLM, Groq, OpenRouter, Together AI, Fireworks AI, Cerebras, Hugging Face, GitHub, Heroku, Vercel, Nebius, OVHcloud AI Endpoints. If your favorite model or provider is not listed, you can easily implement a [custom model](models/overview.md#custom-models).
17+
Supports virtually every [model](models/overview.md) and provider: OpenAI, Anthropic, Gemini, DeepSeek, Grok, Cohere, Mistral, and Perplexity; Azure AI Foundry, Amazon Bedrock, Google Vertex AI, Ollama, LiteLLM, Groq, OpenRouter, Together AI, Fireworks AI, Cerebras, Hugging Face, GitHub, Heroku, Vercel, Nebius, OVHcloud. If your favorite model or provider is not listed, you can easily implement a [custom model](models/overview.md#custom-models).
1818

1919
3. **Seamless Observability**:
2020
Tightly [integrates](logfire.md) with [Pydantic Logfire](https://pydantic.dev/logfire), our general-purpose OpenTelemetry observability platform, for real-time debugging, evals-based performance monitoring, and behavior, tracing, and cost tracking. If you already have an observability platform that supports OTel, you can [use that too](logfire.md#alternative-observability-backends).

docs/models/openai.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ To use OVHcloud AI Endpoints, you need to create a new API key. To do so, go to
731731

732732
You can explore our [catalog](https://endpoints.ai.cloud.ovh.net/catalog) to find which models are available.
733733

734-
Once you've set the `OVHCLOUD_AI_ENDPOINTS_API_KEY` environment variable with your new API key, you can run the following:
734+
You can set the `OVHCLOUD_API_KEY` environment variable and use [`OVHcloudProvider`][pydantic_ai.providers.ovhcloud.OVHcloudProvider] by name:
735735

736736
```python
737737
from pydantic_ai import Agent
@@ -742,16 +742,16 @@ print(result.output)
742742
#> The capital of France is Paris.
743743
```
744744

745-
If you need to configure the provider, you can use the [`OVHcloudAIEndpointsProvider`][pydantic_ai.providers.ovhcloud.OVHcloudAIEndpointsProvider] class:
745+
If you need to configure the provider, you can use the [`OVHcloudProvider`][pydantic_ai.providers.ovhcloud.OVHcloudProvider] class:
746746

747747
```python
748748
from pydantic_ai import Agent
749749
from pydantic_ai.models.openai import OpenAIChatModel
750-
from pydantic_ai.providers.ovhcloud import OVHcloudAIEndpointsProvider
750+
from pydantic_ai.providers.ovhcloud import OVHcloudProvider
751751

752752
model = OpenAIChatModel(
753753
'gpt-oss-120b',
754-
provider=OVHcloudAIEndpointsProvider(api_key='your-api-key'),
754+
provider=OVHcloudProvider(api_key='your-api-key'),
755755
)
756756
agent = Agent(model)
757757
result = agent.run_sync('What is the capital of France?')

pydantic_ai_slim/pydantic_ai/providers/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ def infer_provider_class(provider: str) -> type[Provider[Any]]: # noqa: C901
147147

148148
return NebiusProvider
149149
elif provider == 'ovhcloud':
150-
from .ovhcloud import OVHcloudAIEndpointsProvider
150+
from .ovhcloud import OVHcloudProvider
151151

152-
return OVHcloudAIEndpointsProvider
152+
return OVHcloudProvider
153153
else: # pragma: no cover
154154
raise ValueError(f'Unknown provider: {provider}')
155155

pydantic_ai_slim/pydantic_ai/providers/ovhcloud.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
) from _import_error
2020

2121

22-
class OVHcloudAIEndpointsProvider(Provider[AsyncOpenAI]):
22+
class OVHcloudProvider(Provider[AsyncOpenAI]):
2323
"""Provider for OVHcloud AI Endpoints."""
2424

2525
@property
@@ -56,11 +56,11 @@ def __init__(
5656
openai_client: AsyncOpenAI | None = None,
5757
http_client: httpx.AsyncClient | None = None,
5858
) -> None:
59-
api_key = api_key or os.getenv('OVHCLOUD_AI_ENDPOINTS_API_KEY')
59+
api_key = api_key or os.getenv('OVHCLOUD_API_KEY')
6060
if not api_key and openai_client is None:
6161
raise UserError(
62-
'Set the `OVHCLOUD_AI_ENDPOINTS_API_KEY` environment variable or pass it via '
63-
'`OVHcloudAIEndpointsProvider(api_key=...)` to use OVHcloud AI Endpoints provider.'
62+
'Set the `OVHCLOUD_API_KEY` environment variable or pass it via '
63+
'`OVHcloudProvider(api_key=...)` to use OVHcloud AI Endpoints provider.'
6464
)
6565

6666
if openai_client is not None:

tests/providers/test_ovhcloud.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
with try_import() as imports_successful:
1111
import openai
1212

13-
from pydantic_ai.providers.ovhcloud import OVHcloudAIEndpointsProvider
13+
from pydantic_ai.providers.ovhcloud import OVHcloudProvider
1414

1515

1616
pytestmark = [
@@ -21,33 +21,33 @@
2121

2222

2323
def test_ovhcloud_provider():
24-
provider = OVHcloudAIEndpointsProvider(api_key='your-api-key')
24+
provider = OVHcloudProvider(api_key='your-api-key')
2525
assert provider.name == 'ovhcloud'
2626
assert provider.base_url == 'https://oai.endpoints.kepler.ai.cloud.ovh.net/v1'
2727
assert isinstance(provider.client, openai.AsyncOpenAI)
2828
assert provider.client.api_key == 'your-api-key'
2929

3030

3131
def test_ovhcloud_provider_need_api_key(env: TestEnv) -> None:
32-
env.remove('OVHCLOUD_AI_ENDPOINTS_API_KEY')
32+
env.remove('OVHCLOUD_API_KEY')
3333
with pytest.raises(
3434
UserError,
3535
match=re.escape(
36-
'Set the `OVHCLOUD_AI_ENDPOINTS_API_KEY` environment variable or pass it via '
37-
'`OVHcloudAIEndpointsProvider(api_key=...)` to use OVHcloud AI Endpoints provider.'
36+
'Set the `OVHCLOUD_API_KEY` environment variable or pass it via '
37+
'`OVHcloudProvider(api_key=...)` to use OVHcloud AI Endpoints provider.'
3838
),
3939
):
40-
OVHcloudAIEndpointsProvider()
40+
OVHcloudProvider()
4141

4242

4343
def test_ovhcloud_pass_openai_client() -> None:
4444
openai_client = openai.AsyncOpenAI(api_key='your-api-key')
45-
provider = OVHcloudAIEndpointsProvider(openai_client=openai_client)
45+
provider = OVHcloudProvider(openai_client=openai_client)
4646
assert provider.client == openai_client
4747

4848

4949
def test_ovhcloud_pass_http_client():
5050
http_client = httpx.AsyncClient()
51-
provider = OVHcloudAIEndpointsProvider(api_key='your-api-key', http_client=http_client)
51+
provider = OVHcloudProvider(api_key='your-api-key', http_client=http_client)
5252
assert isinstance(provider.client, openai.AsyncOpenAI)
5353
assert provider.client.api_key == 'your-api-key'

tests/providers/test_provider_names.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
from pydantic_ai.providers.ollama import OllamaProvider
3333
from pydantic_ai.providers.openai import OpenAIProvider
3434
from pydantic_ai.providers.openrouter import OpenRouterProvider
35-
from pydantic_ai.providers.ovhcloud import OVHcloudAIEndpointsProvider
35+
from pydantic_ai.providers.ovhcloud import OVHcloudProvider
3636
from pydantic_ai.providers.together import TogetherProvider
3737
from pydantic_ai.providers.vercel import VercelProvider
3838

@@ -57,7 +57,7 @@
5757
('ollama', OllamaProvider, 'OLLAMA_BASE_URL'),
5858
('litellm', LiteLLMProvider, None),
5959
('nebius', NebiusProvider, 'NEBIUS_API_KEY'),
60-
('ovhcloud', OVHcloudAIEndpointsProvider, 'OVHCLOUD_AI_ENDPOINTS_API_KEY'),
60+
('ovhcloud', OVHcloudProvider, 'OVHCLOUD_API_KEY'),
6161
]
6262

6363
if not imports_successful():

tests/test_examples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def print(self, *args: Any, **kwargs: Any) -> None:
184184
env.set('GROK_API_KEY', 'testing')
185185
env.set('MOONSHOTAI_API_KEY', 'testing')
186186
env.set('DEEPSEEK_API_KEY', 'testing')
187-
env.set('OVHCLOUD_AI_ENDPOINTS_API_KEY', 'testing')
187+
env.set('OVHCLOUD_API_KEY', 'testing')
188188

189189
prefix_settings = example.prefix_settings()
190190
opt_test = prefix_settings.get('test', '')

0 commit comments

Comments
 (0)