BloomERP

Built-ins

AIProviderDefinition

Bind a provider ID to its runtime, settings schema, and credential schema.

The ID appears on saved provider configuration and selects the runtime. Keep credentials in the separate credential schema and validated provider options in the settings schema.

SettingTypeDefaultDescription
idstrRequiredStable ID stored on the provider configuration.Minimum length: 1
documentationstr''Markdown and tagged examples included in the generated developer reference.
namestrRequiredProvider name shown when setting up a connection.Minimum length: 1
descriptionstr''User-facing explanation shown when choosing this provider.
runtimestr'pydantic_ai'Identifier of the runtime implementation.
runtime_factoryCallable[[AgentRuntimeConfig], AgentRuntime]RequiredCallback that constructs a runtime for validated configuration.
credentials_schematype[AIProviderCredentialsSchema]DefaultAIProviderCredentialsSchemaPydantic schema for provider credentials.
config_schematype[pydantic.main.BaseModel]RequiredPydantic schema for provider runtime settings.
integrationAnyNoneProvider-specific integration metadata.
model_identifier_factoryCallable[[AIProviderCredentialsSchema, str | None], list[tuple[str, str]]] | NoneNoneOptional callback that discovers selectable model identifiers.
model_modalities_factoryCallable[[str, AIProviderCredentialsSchema, str | None], ModelModalities | None] | NoneNoneOptional callback that discovers the selected model's supported modalities.

Register a project provider using an existing runtime

Reuse the built-in provider’s runtime, credential schema and integration under a project-owned ID.

python
from bloomerp.agents.providers.definition import AIProviderDefinition
from bloomerp.agents.providers.registry import AI_PROVIDER_REGISTRY

original = AI_PROVIDER_REGISTRY.openai
reviews = AIProviderDefinition(
    id="example_review_provider",
    name="Review provider",
    description="A provider entry for document review agents.",
    runtime=original.runtime,
    runtime_factory=original.runtime_factory,
    credentials_schema=original.credentials_schema,
    config_schema=original.config_schema,
    integration=original.integration,
)
AI_PROVIDER_REGISTRY.register(reviews.id, reviews)

Constrain provider settings for a short-answer agent

Pass the same settings schema to the definition and integration so both validate the response length cap.

python
from pydantic import Field

from bloomerp.agents.providers.builtins.pydantic_ai_common import PydanticAIProvider, PydanticAISettings
from bloomerp.agents.providers.builtins.pydantic_open_ai import create_openai_model
from bloomerp.agents.providers.definition import AIProviderDefinition
from bloomerp.agents.providers.registry import AI_PROVIDER_REGISTRY, pydantic_runtime


class ShortAnswerSettings(PydanticAISettings):
    '''Apply a smaller output limit for short-answer agents.'''

    max_tokens: int = Field(default=256, gt=0, le=512, strict=True)


short_answers = AIProviderDefinition(
    id="example_short_answers",
    name="Short-answer provider",
    runtime_factory=pydantic_runtime,
    config_schema=ShortAnswerSettings,
    integration=PydanticAIProvider(create_openai_model, ShortAnswerSettings),
)
AI_PROVIDER_REGISTRY.register(short_answers.id, short_answers)

OpenAI

ID openai

Use OpenAI agents through the Responses API, including compatible reasoning models.

FieldValue
runtimepydantic_ai

DefaultAIProviderCredentialsSchema

Require an explicit API key for the built-in remote providers.

SettingTypeDefaultDescription
api_keypydantic.types.SecretStrRequired—

PydanticAISettings

Allow documented model controls without bypassing the tool/secret boundary.

max_tokens is a per-response output cap, separate from the run's token budget. Provider-specific settings can be added deliberately as needed. Arbitrary headers, request bodies, and provider-hosted tools are not accepted.

SettingTypeDefaultDescription
max_tokensint | NoneNoneOutput token limit per response. Leave blank for the provider default.Greater than: 0
temperaturefloat | NoneNoneSampling temperature from 0 to 2. Leave blank for the model default; reasoning models may not support this control.At least: 0At most: 2
top_pfloat | NoneNoneNucleus sampling probability from 0 to 1. Leave blank for the model default.At least: 0At most: 1
parallel_tool_callsbool | NoneNoneAllow multiple tool calls in one response, or use the provider default.
seedint | NoneNoneOptional deterministic sampling seed, where supported by the model.
stop_sequenceslist[str] | NoneNoneStop generation when one of these strings is reached. Enter one string per line.
openai_reasoning_effortOptional[Literal['none', 'minimal', 'low', 'medium', 'high', 'xhigh']]NoneReasoning effort for compatible OpenAI agents. Leave blank for the model default.

OpenAI Chat Completions

ID openai_chat

Use OpenAI or compatible endpoints through the Chat Completions API.

FieldValue
runtimepydantic_ai

DefaultAIProviderCredentialsSchema

Require an explicit API key for the built-in remote providers.

SettingTypeDefaultDescription
api_keypydantic.types.SecretStrRequired—

PydanticAISettings

Allow documented model controls without bypassing the tool/secret boundary.

max_tokens is a per-response output cap, separate from the run's token budget. Provider-specific settings can be added deliberately as needed. Arbitrary headers, request bodies, and provider-hosted tools are not accepted.

SettingTypeDefaultDescription
max_tokensint | NoneNoneOutput token limit per response. Leave blank for the provider default.Greater than: 0
temperaturefloat | NoneNoneSampling temperature from 0 to 2. Leave blank for the model default; reasoning models may not support this control.At least: 0At most: 2
top_pfloat | NoneNoneNucleus sampling probability from 0 to 1. Leave blank for the model default.At least: 0At most: 1
parallel_tool_callsbool | NoneNoneAllow multiple tool calls in one response, or use the provider default.
seedint | NoneNoneOptional deterministic sampling seed, where supported by the model.
stop_sequenceslist[str] | NoneNoneStop generation when one of these strings is reached. Enter one string per line.
openai_reasoning_effortOptional[Literal['none', 'minimal', 'low', 'medium', 'high', 'xhigh']]NoneReasoning effort for compatible OpenAI agents. Leave blank for the model default.

DeepSeek

ID deepseek

Use DeepSeek models through its OpenAI-compatible Chat Completions API.

FieldValue
runtimepydantic_ai

DefaultAIProviderCredentialsSchema

Require an explicit API key for the built-in remote providers.

SettingTypeDefaultDescription
api_keypydantic.types.SecretStrRequired—

PydanticAISettings

Allow documented model controls without bypassing the tool/secret boundary.

max_tokens is a per-response output cap, separate from the run's token budget. Provider-specific settings can be added deliberately as needed. Arbitrary headers, request bodies, and provider-hosted tools are not accepted.

SettingTypeDefaultDescription
max_tokensint | NoneNoneOutput token limit per response. Leave blank for the provider default.Greater than: 0
temperaturefloat | NoneNoneSampling temperature from 0 to 2. Leave blank for the model default; reasoning models may not support this control.At least: 0At most: 2
top_pfloat | NoneNoneNucleus sampling probability from 0 to 1. Leave blank for the model default.At least: 0At most: 1
parallel_tool_callsbool | NoneNoneAllow multiple tool calls in one response, or use the provider default.
seedint | NoneNoneOptional deterministic sampling seed, where supported by the model.
stop_sequenceslist[str] | NoneNoneStop generation when one of these strings is reached. Enter one string per line.
openai_reasoning_effortOptional[Literal['none', 'minimal', 'low', 'medium', 'high', 'xhigh']]NoneReasoning effort for compatible OpenAI agents. Leave blank for the model default.

Anthropic

ID anthropic

Use Claude models through the Anthropic Messages API.

FieldValue
runtimepydantic_ai

DefaultAIProviderCredentialsSchema

Require an explicit API key for the built-in remote providers.

SettingTypeDefaultDescription
api_keypydantic.types.SecretStrRequired—

AnthropicSettings

Validate the settings supported by the built-in Anthropic integration.

SettingTypeDefaultDescription
max_tokensint | None4096Output token limit per response. Defaults to 4096 tokens for Anthropic.Greater than: 0
temperaturefloat | NoneNoneSampling temperature from 0 to 2. Leave blank for the model default; reasoning models may not support this control.At least: 0At most: 2
top_pfloat | NoneNoneNucleus sampling probability from 0 to 1. Leave blank for the model default.At least: 0At most: 1
parallel_tool_callsbool | NoneNoneAllow multiple tool calls in one response, or use the provider default.
seedint | NoneNoneOptional deterministic sampling seed, where supported by the model.
stop_sequenceslist[str] | NoneNoneStop generation when one of these strings is reached. Enter one string per line.
openai_reasoning_effortOptional[Literal['none', 'minimal', 'low', 'medium', 'high', 'xhigh']]NoneReasoning effort for compatible OpenAI agents. Leave blank for the model default.

OpenRouter

ID openrouter

Use OpenRouter with a vendor/model identifier. Available tools and settings depend on the selected model.

FieldValue
runtimepydantic_ai

DefaultAIProviderCredentialsSchema

Require an explicit API key for the built-in remote providers.

SettingTypeDefaultDescription
api_keypydantic.types.SecretStrRequired—

PydanticAISettings

Allow documented model controls without bypassing the tool/secret boundary.

max_tokens is a per-response output cap, separate from the run's token budget. Provider-specific settings can be added deliberately as needed. Arbitrary headers, request bodies, and provider-hosted tools are not accepted.

SettingTypeDefaultDescription
max_tokensint | NoneNoneOutput token limit per response. Leave blank for the provider default.Greater than: 0
temperaturefloat | NoneNoneSampling temperature from 0 to 2. Leave blank for the model default; reasoning models may not support this control.At least: 0At most: 2
top_pfloat | NoneNoneNucleus sampling probability from 0 to 1. Leave blank for the model default.At least: 0At most: 1
parallel_tool_callsbool | NoneNoneAllow multiple tool calls in one response, or use the provider default.
seedint | NoneNoneOptional deterministic sampling seed, where supported by the model.
stop_sequenceslist[str] | NoneNoneStop generation when one of these strings is reached. Enter one string per line.
openai_reasoning_effortOptional[Literal['none', 'minimal', 'low', 'medium', 'high', 'xhigh']]NoneReasoning effort for compatible OpenAI agents. Leave blank for the model default.