PydanticAI GenAI Hub
A Python library providing Pydantic-based model implementations for various LLM providers. It's intended to be used with SAP's Generative AI Hub SDK.
This project is not affiliated with SAP.
Installation
You can install the package with pip:
pip install pydanticai-genai-hub
To install with specific provider support:
# For Anthropic support
pip install "pydanticai-genai-hub[anthropic]"
# For OpenAI support
pip install "pydanticai-genai-hub[openai]"
# For all providers
pip install "pydanticai-genai-hub[all]"
Usage
Anthropic Model
from pydanticai_genai_hub.anthropic import AnthropicModel
model = AnthropicModel(
model_name="anthropic--claude-3.5-sonnet",
)
OpenAI Model
from pydanticai_genai_hub.openai import OpenAIModel
model = OpenAIModel(
model_name="gpt-4o",
)
'Hello World' Example with AWS Bedrock Anthropic
from pydantic_ai import Agent
from pydanticai_genai_hub.anthropic import AnthropicModel
# Initialize the model with SAP GenAI Hub configuration
llm = AnthropicModel(
model_name="anthropic--claude-3.5-sonnet",
)
agent = Agent(
model=llm,
system_prompt='Be concise, reply with one sentence.',
)
result = agent.run_sync('Where does "hello world" come from?')
print(result.data)
"""
The first known use of "hello, world" was in a 1974 textbook about the C programming language.
"""
License
MIT License
Metadata
Release files for pydanticai-genai-hub 0.1.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pydanticai_genai_hub-0.1.10.tar.gz | 15.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pydanticai_genai_hub-0.1.10-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.2 kB
Release files / pydanticai_genai_hub-0.1.10.tar.gz
| Download URL | pydanticai_genai_hub-0.1.10.tar.gz |
|---|---|
| Size | 15.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
726eec2180d40ff33524e36e4fb452f801f2c03bf696bdd815ae7caa50456791
|
|
BLAKE2b-256 checksum How to use checksums |
46333d87ed5f6c45cbd8f3330d2553e603ef27aff4649b75b5efa3f28f1f600a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / pydanticai_genai_hub-0.1.10-py3-none-any.whl
| Download URL | pydanticai_genai_hub-0.1.10-py3-none-any.whl |
|---|---|
| Size | 16.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2097018a81759be248924cce4da97e663f43cdb1623c7d4ec9a679b14e7f4bce
|
|
BLAKE2b-256 checksum How to use checksums |
ac62027bbb0dd81d8e4a6ac0e313ecb8094b12b3ddef41cd0ff064b0a6d93f87
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|