blob: 3115f44dc7ce7ffe485ac25cee7ad95098bac2a5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
# Maintainer: Mohamed Amine Zghal (medaminezghal) <medaminezghal at outlook dot com>
_name4=graph
_name3=slim
_name2=evals
_name1=examples
_name0=pydantic-ai
_name00=clai
pkgbase=python-$_name0
pkgname=(python-${_name0//-ai/}-$_name4 python-$_name0-$_name3 python-${_name0//-ai/}-$_name2 python-$_name0-$_name1 python-$_name0 python-$_name00)
pkgver=0.8.0
pkgrel=1
arch=('any')
url='https://github.com/pydantic/pydantic-ai'
license=('MIT')
depends=('python')
makedepends=('python-hatchling' 'python-uv-dynamic-versioning' 'python-build' 'python-installer' 'python-wheel' 'git')
checkdepends=('python-anyio' 'python-asgi-lifespan' 'python-devtools' 'python-dirty-equals' 'python-ddgs' 'python-inline-snapshot' 'python-pytest' 'python-pytest-examples' 'python-pytest-mock' 'python-pytest-recording' 'python-pytest-xdist' 'python-genai-prices' 'ruff' 'deno')
source=("$_name0-$pkgver::git+$url.git#tag=v$pkgver")
sha256sums=('8ad929b9789358cc53a4d563c3cab007f9c7311b123a4948ce5da20c5c6b49db')
prepare(){
cd "$srcdir"/$_name0-$pkgver
sed -i 's/0.00003488/0.00002688/g' tests/models/test_anthropic.py
}
build() {
cd "$srcdir"/$_name0-$pkgver
python -m build --wheel --no-isolation ${_name0//-ai/_}$_name4
python -m build --wheel --no-isolation ${_name0//-/_}_$_name3
python -m build --wheel --no-isolation ${_name0//-ai/_}$_name2
python -m build --wheel --no-isolation $_name1
python -m build --wheel --no-isolation
python -m build --wheel --no-isolation $_name00
}
check() {
local pytest_options=(
-vv
-n auto
# Failed with opentelemetry>=1.35.0
--deselect tests/models/test_instrumented.py::test_instrumented_model_stream
--deselect tests/models/test_instrumented.py::test_instrumented_model_stream_break
--deselect tests/models/test_instrumented.py::test_instrumented_model
-k "not instrumentation_settings_event_mode.py and not instrument3"
)
cd "$srcdir"/$_name0-$pkgver
python -m venv --system-site-packages test-env
ln -sf /usr/bin/ruff test-env/bin/ruff
test-env/bin/python -m installer ${_name0//-ai/_}$_name4/dist/*.whl
test-env/bin/python -m installer ${_name0//-/_}_$_name3/dist/*.whl
rm -rf test-env/bin/pai
test-env/bin/python -m installer ${_name0//-ai/_}$_name2/dist/*.whl
test-env/bin/python -m installer $_name1/dist/*.whl
test-env/bin/python -m installer dist/*.whl
test-env/bin/python -m installer $_name00/dist/*.whl
test-env/bin/python -m pytest "${pytest_options[@]}" tests
}
package_python-pydantic-graph() {
pkgdesc='Graph and state machine librarys.'
depends+=('python-httpx' 'python-logfire-api' 'python-pydantic' 'python-typing-inspection')
url='https://github.com/pydantic/pydantic-ai/tree/main/pydantic_graph'
cd "$srcdir"/$_name0-$pkgver
python -m installer --destdir="$pkgdir" ${_name0//-ai/_}$_name4/dist/*.whl
}
package_python-pydantic-ai-slim() {
pkgdesc='Agent Framework / shim to use Pydantic with LLMs, slim package.'
depends+=('python-griffe' 'python-httpx' 'python-pydantic' 'python-pydantic-graph' 'python-opentelemetry-api' 'python-typing-inspection' 'python-genai-prices')
optdepends=('python-logfire: logfire' 'python-openai: openai' 'python-cohere: cohere' 'python-google-auth: vertexai' 'python-requests: vertexai' 'python-google-genai: google' 'python-anthropic: anthropic' 'python-groq: groq' 'python-mistralai: mistral' 'python-boto3: bedrock' 'python-huggingface-hub: huggingface' 'python-aiohttp: huggingface' 'python-ddgs: duckduckgo' 'python-tavily: tavily' 'python-rich: cli' 'python-prompt-toolkit: cli' 'python-argcomplete: cli' 'python-pyperclip: cli' 'python-mcp: mcp' 'python-pydantic-evals: evals' 'python-fasta2a: a2a' 'python-ag-ui-protocol: ag-ui' 'python-starlette: ag-ui' 'python-tenacity: retries' 'python-temporalio: temporal')
url='https://github.com/pydantic/pydantic-ai/tree/main/pydantic_ai_slim'
cd "$srcdir"/$_name0-$pkgver
python -m installer --destdir="$pkgdir" ${_name0//-/_}_$_name3/dist/*.whl
}
package_python-pydantic-evals() {
pkgdesc='Framework for evaluating stochastic code execution, especially code making use of LLMs.'
depends+=('python-rich' 'python-logfire-api' 'python-pydantic' 'python-pydantic-ai-slim' 'python-anyio' 'python-pyyaml')
optdepends=('python-logfire: logfire')
url='https://github.com/pydantic/pydantic-ai/tree/main/pydantic_evals'
cd "$srcdir"/$_name0-$pkgver
python -m installer --destdir="$pkgdir" ${_name0//-ai/_}$_name2/dist/*.whl
}
package_python-pydantic-ai-examples() {
pkgdesc='Examples of how to use PydanticAI and what it can do.'
depends+=('python-pydantic-ai-slim' 'python-openai' 'python-google-auth' 'python-requests' 'python-groq' 'python-anthropic' 'python-ag-ui-protocol' 'python-starlette' 'python-pydantic-evals' 'python-asyncpg' 'python-fastapi' 'python-logfire' 'python-opentelemetry-instrumentation-asyncpg' 'python-opentelemetry-instrumentation-fastapi' 'python-opentelemetry-instrumentation-sqlite3' 'python-opentelemetry-instrumentation-httpx' 'python-python-multipart' 'python-rich' 'uvicorn' 'python-devtools' 'python-gradio' 'python-mcp' 'python-typer' 'python-dotenv' 'python-modal' 'python-duckdb' 'python-datasets' 'python-pandas')
url='https://github.com/pydantic/pydantic-ai/tree/main/examples'
cd "$srcdir"/$_name0-$pkgver
python -m installer --destdir="$pkgdir" $_name1/dist/*.whl
}
package_python-pydantic-ai() {
pkgdesc='Agent Framework / shim to use Pydantic with LLMs.'
depends+=('python-pydantic-ai-slim' 'python-openai' 'python-google-auth' 'python-requests' 'python-google-genai' 'python-groq' 'python-anthropic' 'python-mistralai' 'python-cohere' 'python-boto3' 'python-huggingface-hub' 'python-aiohttp' 'python-rich' 'python-prompt-toolkit' 'python-argcomplete' 'python-pyperclip' 'python-mcp' 'python-pydantic-evals' 'python-ag-ui-protocol' 'python-starlette' 'python-tenacity' 'python-temporalio')
optdepends=('python-pydantic-ai-examples: examples' 'python-logfire: logfire' 'python-fasta2a: a2a')
url='https://github.com/pydantic/pydantic-ai/'
cd "$srcdir"/$_name0-$pkgver
python -m installer --destdir="$pkgdir" dist/*.whl
}
package_python-clai() {
pkgdesc='PydanticAI CLI: command line interface to chat to LLMs.'
depends+=('python-pydantic-ai')
url='https://github.com/pydantic/pydantic-ai/tree/main/clai'
cd "$srcdir"/$_name0-$pkgver
python -m installer --destdir="$pkgdir" $_name00/dist/*.whl
}
|