Skip to content

docs: add Pydantic AI guide + Hermes standalone provider-plugin section#72

Closed
MVS-source wants to merge 2 commits into
mainfrom
integrations/frameworks-pydantic-hermes-plugin
Closed

docs: add Pydantic AI guide + Hermes standalone provider-plugin section#72
MVS-source wants to merge 2 commits into
mainfrom
integrations/frameworks-pydantic-hermes-plugin

Conversation

@MVS-source

@MVS-source MVS-source commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

What

  • Pydantic AI (new guide, AI Frameworks): build type-safe, structured-output agents on Eden AI's 500+ models through OpenAIChatModel + OpenAIProvider, pointed at https://api.edenai.run/v3.
  • Hermes (additive edit): new optional section "First-class provider plugin" documenting the standalone model-provider plugin route (native --provider eden-ai, shows up in hermes model / hermes doctor), alongside the existing custom-provider setup.

Files

  • v3/integrations/pydantic-ai.mdx (new)
  • integration-logo/pydantic-ai-icondoc.svg (new, square, brand magenta)
  • v3/integrations/hermes.mdx (edit: +1 section, dateModified bump — 45 insertions, no existing lines rewritten)
  • docs.jsonpydantic-ai added to AI Frameworks

Conventions

  • Format matches existing integration docs (<TechArticleSchema> + <CodeGroup>).
  • Env var: EDEN_AI_API_KEY (house style) for Pydantic AI. Hermes keeps EDENAI_API_KEY since it derives the name from the base URL host.
  • Hermes edit is strictly additive; no rewrite of the published content.

To confirm before merge

  • Hermes plugin API (register_provider / ProviderProfile fields) against the current Hermes plugin loader.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added documentation for integrating Pydantic AI with Eden AI’s V3 OpenAI-compatible endpoint.
    • Added setup examples for installation, authentication, model selection, structured outputs, conversations, and error handling.
    • Added navigation for the new Pydantic AI integration guide.
    • Documented an optional Eden AI model-provider plugin for Hermes, including setup and usage instructions.

…tion

- Pydantic AI: new integration guide (AI Frameworks). Type-safe agents on
  Eden AI via OpenAIChatModel + OpenAIProvider; house-style env var
  EDEN_AI_API_KEY.
- Hermes: add an optional "First-class provider plugin" section documenting
  the standalone model-provider plugin route (native --provider eden-ai),
  alongside the existing custom-provider setup. Additive edit only.

Includes pydantic-ai icon SVG and docs.json nav entry.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Added a Pydantic AI integration guide and navigation entry, plus Hermes documentation for an optional Eden AI model-provider plugin and updated metadata.

Changes

Integration documentation

Layer / File(s) Summary
Pydantic AI integration guide
v3/integrations/pydantic-ai.mdx, docs.json
Adds structured metadata, installation and usage examples, model listings, structured output, multi-turn conversations, error handling, environment setup, next steps, and navigation.
Hermes provider plugin guidance
v3/integrations/hermes.mdx
Documents Eden AI provider registration, plugin manifest configuration, and Hermes provider commands; updates the modification date.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • edenai/docs#55: Both changes update Hermes integration documentation and navigation.

Suggested reviewers: tristantelleb

Poem

I’m a rabbit with docs in my paws,
Hopping through models and plugin laws.
Pydantic shapes neatly appear,
Hermes welcomes Eden AI here.
New paths are added—what a delight!
I nibble the changelog and bid goodnight.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main changes: a new Pydantic AI guide and a Hermes provider-plugin docs section.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch integrations/frameworks-pydantic-hermes-plugin

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mintlify

mintlify Bot commented Jul 16, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
edenai 🟢 Ready View Preview Jul 16, 2026, 2:05 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@mintlify

mintlify Bot commented Jul 16, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
edenai 🟡 Building Jul 16, 2026, 2:04 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

The Execution Tests harness runs ```python blocks against the sandbox
API. Two docs have blocks that cannot run in the minimal test env:

- pydantic-ai.mdx: pydantic-ai is not in tests/requirements-lock.txt
- hermes.mdx: the plugin __init__.py imports Hermes' internal
  `providers` module (only available inside $HERMES_HOME)

Mark them with the documented {/* skip-test */} MDX comment (invisible
in rendered docs) so CI skips execution while keeping the snippets.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@v3/integrations/pydantic-ai.mdx`:
- Around line 46-57: Update the PydanticAI example’s OpenAI configuration around
OpenAIChatModel to use the supported model/provider setup for the installed
PydanticAI version, removing the unavailable OpenAIProvider import and usage.
Preserve the Eden AI API key and base_url configuration.
- Line 158: Update the import in the pydantic-ai example to remove
ModelHTTPError and retain only the valid UnexpectedModelBehavior symbol from
pydantic_ai.exceptions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9edec37c-039f-43bb-8b95-cd659e536fec

📥 Commits

Reviewing files that changed from the base of the PR and between 5174e81 and b55eb3a.

⛔ Files ignored due to path filters (1)
  • integration-logo/pydantic-ai-icondoc.svg is excluded by !**/*.svg
📒 Files selected for processing (3)
  • docs.json
  • v3/integrations/hermes.mdx
  • v3/integrations/pydantic-ai.mdx

Comment on lines +46 to +57
```python Python
from pydantic_ai import Agent
from pydantic_ai.models.openai import OpenAIChatModel
from pydantic_ai.providers.openai import OpenAIProvider

model = OpenAIChatModel(
"openai/gpt-4o",
provider=OpenAIProvider(
api_key="YOUR_EDEN_AI_API_KEY", # Get from https://app.edenai.run
base_url="https://api.edenai.run/v3",
),
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

"OpenAIModel" OR "OpenAIChatModel" site:ai.pydantic.dev

💡 Result:

In the context of the PydanticAI framework, OpenAIChatModel is a class designed to facilitate interaction with OpenAI's API [1]. It serves as a model implementation that utilizes the official OpenAI Python client internally to manage API requests [1]. While the search results specifically identify and document OpenAIChatModel as part of the pydantic_ai.models.openai module [1], there is no distinct, documented class named OpenAIModel currently identified in the standard PydanticAI library structure; it is likely a misidentification or a conceptual reference to the base model interface or the broader family of OpenAI-compatible models [1][2]. Key characteristics of OpenAIChatModel include: - Functionality: It acts as a bridge between PydanticAI agents and OpenAI's chat-based language models [1]. - Initialization: It requires a model name (e.g., 'gpt-4o') and accepts optional parameters such as providers, model profiles, and default settings [1]. - Integration: It inherits from the base Model class [1], allowing it to be used seamlessly within PydanticAI Agents to process tasks, manage tool usage, and handle structured output [1][3][4]. If you encountered the term OpenAIModel, it may refer to the generic Model base class or a custom implementation in a specific codebase, as OpenAIChatModel is the explicit, provided implementation for OpenAI chat interfaces within the framework [1][2].

Citations:


🌐 Web query:

"OpenAIProvider" site:ai.pydantic.dev pydantic_ai.providers.openai

💡 Result:

In the Pydantic AI library, OpenAI support is provided through the pydantic_ai.models.openai module, which defines model classes for interacting with OpenAI APIs [1]. Specifically, there is no top-level class named OpenAIProvider; instead, models are initialized using model strings (e.g., 'openai:gpt-4o') or by instantiating OpenAIChatModel or OpenAIResponsesModel [1]. Key points regarding OpenAI integration in Pydantic AI: 1. Model Initialization: When defining an Agent, you specify the model using a string identifier [2]. For example, Agent('openai:gpt-4o') automatically configures the agent to use the OpenAI provider [3][2]. 2. Provider Classes: - OpenAIChatModel: A model that uses the standard OpenAI Chat API [1]. - OpenAIResponsesModel: A model designed for the OpenAI Responses API [1]. 3. Provider Configuration: Both model classes accept a provider argument during initialization, which defaults to 'openai' [1]. This argument allows for specifying alternative compatible providers or custom AsyncOpenAI client configurations [1]. 4. Documentation Reference: Technical details and configuration options, such as OpenAIChatModelSettings, can be found in the pydantic_ai.models.openai API documentation [1].

Citations:


🌐 Web query:

site:ai.pydantic.dev pydantic_ai.models.openai OpenAIChatModel provider api_key base_url

💡 Result:

In Pydantic AI, the OpenAIChatModel is designed to interface with the OpenAI API (or compatible services) [1]. Configuration of the api_key and base_url for OpenAIChatModel is typically handled through the underlying provider rather than directly in the OpenAIChatModel constructor [1]. 1. Provider Configuration: The OpenAIChatModel constructor accepts a provider argument [1]. By default, this is set to 'openai' [1]. To customize parameters like api_key or base_url, you should instantiate a specific provider object (e.g., OpenAIProvider or a similar provider class) and pass it to the provider argument of the OpenAIChatModel [1]. 2. Environment Variables: For standard OpenAI usage, Pydantic AI typically retrieves the API key from environment variables (e.g., OPENAI_API_KEY) automatically when using the default provider [1]. 3. General Pattern for Custom Providers: While documentation for specific OpenAIChatModel provider configuration options can vary by version, the general pattern for custom configurations in Pydantic AI involves [2][3]: - Instantiating the provider class (e.g., provider = OpenAIProvider(api_key='...', base_url='...')). - Passing this instance to the model (e.g., model = OpenAIChatModel(..., provider=provider)). If you are using a self-hosted or compatible OpenAI-like API, ensure the provider instance is configured with the correct base_url and api_key before initializing the OpenAIChatModel [1]. Check your specific version's API documentation for the exact provider class exported by pydantic_ai.providers [1][2].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the relevant file and any nearby Pydantic AI usage in docs.
git ls-files 'v3/integrations/pydantic-ai.mdx' 'v3/**/*.mdx' | sed -n '1,80p'
echo
wc -l v3/integrations/pydantic-ai.mdx
echo
cat -n v3/integrations/pydantic-ai.mdx | sed -n '35,70p'
echo
rg -n "OpenAIChatModel|OpenAIProvider|OpenAIResponsesModel|Agent\\('openai:|pydantic_ai" v3 -g '*.mdx'

Repository: edenai/docs

Length of output: 6263


🌐 Web query:

site:ai.pydantic.dev "pydantic_ai.providers.openai" OR "OpenAIProvider" OR "class OpenAIProvider"

💡 Result:

PydanticAI does not have a class named OpenAIProvider within the pydantic_ai.providers namespace. In PydanticAI, OpenAI integration is primarily handled through the pydantic_ai.models.openai module [1]. The core class for using OpenAI models is OpenAIChatModel (or OpenAIResponsesModel for the Responses API) [1]. When configuring an agent, you typically specify the model name (e.g., 'openai:gpt-5.2') directly in the Agent constructor [2][3]. Internally, the framework uses these model classes to interact with the OpenAI API. While there is a concept of a provider within the OpenAIChatModel configuration—often defaulting to 'openai' or 'gateway'—it is managed via string identifiers or specific provider objects rather than a top-level class named OpenAIProvider [1]. If you are looking to define a custom provider or configure the underlying connection, you would interact with the model settings or the specific model class constructors [1].

Citations:


Replace OpenAIProvider with the supported PydanticAI OpenAI configuration
OpenAIChatModel is valid, but pydantic_ai.providers.openai.OpenAIProvider is not exposed in PydanticAI, so this snippet will fail on import. Use the documented model/provider setup for the installed version instead.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@v3/integrations/pydantic-ai.mdx` around lines 46 - 57, Update the PydanticAI
example’s OpenAI configuration around OpenAIChatModel to use the supported
model/provider setup for the installed PydanticAI version, removing the
unavailable OpenAIProvider import and usage. Preserve the Eden AI API key and
base_url configuration.

from pydantic_ai import Agent
from pydantic_ai.models.openai import OpenAIChatModel
from pydantic_ai.providers.openai import OpenAIProvider
from pydantic_ai.exceptions import ModelHTTPError, UnexpectedModelBehavior

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

"ModelHTTPError" site:ai.pydantic.dev

💡 Result:

ModelHTTPError is not a standard error class in the Pydantic AI framework or general Python programming. Based on the provided technical documentation for Pydantic AI, the library primarily uses UserError for configuration or usage issues [1], ModelRetry for validation failures during agent runs [2], and NotImplementedError for base model methods that have not been implemented by specific providers [1]. If you are encountering an error related to HTTP requests in Pydantic AI, it typically relates to the underlying HTTP client used by the model provider (e.g., OpenAI, Anthropic, or Groq) [3][4][5]. These are usually handled by the provider's official SDK or standard HTTP exception classes rather than a specific library-wide ModelHTTPError. If you are seeing this name, it may be a custom exception defined within your specific codebase or a third-party library not covered by the official Pydantic AI documentation.

Citations:


🌐 Web query:

site:ai.pydantic.dev "class ModelHTTPError" OR "ModelHTTPError" "pydantic_ai.exceptions"

💡 Result:

Based on the provided documentation for Pydantic AI, there is no public class named ModelHTTPError defined within the pydantic_ai.exceptions module or the broader library. Pydantic AI uses standard exception handling mechanisms, and model-related errors typically surface through specific exceptions related to request failures or configuration issues, such as UserError or general HTTP/network exceptions depending on the underlying provider client (e.g., httpx for OpenAI or Anthropic). [1][2]

Citations:


Drop ModelHTTPError from the import. pydantic_ai.exceptions doesn’t expose that symbol, so this snippet won’t run as written.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@v3/integrations/pydantic-ai.mdx` at line 158, Update the import in the
pydantic-ai example to remove ModelHTTPError and retain only the valid
UnexpectedModelBehavior symbol from pydantic_ai.exceptions.

@MVS-source

Copy link
Copy Markdown
Collaborator Author

Remplacée par #75 (historique de commits nettoyé, même contenu).

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.

1 participant