Skip to content

Commit 252b835

Browse files
authored
chore(py/genkit): use dotpromptz 0.1.4 from pypi (#3943)
1 parent 90fb2fc commit 252b835

File tree

6 files changed

+378
-186
lines changed

6 files changed

+378
-186
lines changed

py/packages/genkit/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ dependencies = [
4646
"sse-starlette>=2.2.1",
4747
"pillow",
4848
"strenum>=0.4.15; python_version < '3.11'",
49+
"dotpromptz>=0.1.4",
4950
"uvicorn>=0.34.0",
5051
"anyio>=4.9.0",
5152
]

py/plugins/anthropic/pyproject.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
117
[project]
218
authors = [{ name = "Google" }]
319
classifiers = [

py/plugins/firebase/src/genkit/plugins/firebase/tests/test_telemetry.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424

2525
def _create_model_span(
26-
model_name: str = "gemini-pro",
27-
path: str = "/{myflow,t:flow}",
26+
model_name: str = 'gemini-pro',
27+
path: str = '/{myflow,t:flow}',
2828
output: str = '{"usage": {"inputTokens": 100, "outputTokens": 50}}',
2929
is_ok: bool = True,
3030
start_time: int = 1000000000,
@@ -45,30 +45,30 @@ def _create_model_span(
4545
"""
4646
mock_span = MagicMock(spec=ReadableSpan)
4747
mock_span.attributes = {
48-
"genkit:type": "action",
49-
"genkit:metadata:subtype": "model",
50-
"genkit:name": model_name,
51-
"genkit:path": path,
52-
"genkit:output": output,
48+
'genkit:type': 'action',
49+
'genkit:metadata:subtype': 'model',
50+
'genkit:name': model_name,
51+
'genkit:path': path,
52+
'genkit:output': output,
5353
}
5454
mock_span.status.is_ok = is_ok
5555
mock_span.start_time = start_time
5656
mock_span.end_time = end_time
5757
return mock_span
5858

5959

60-
@patch("genkit.plugins.firebase.add_gcp_telemetry")
60+
@patch('genkit.plugins.firebase.add_gcp_telemetry')
6161
def test_firebase_telemetry_delegates_to_gcp(mock_add_gcp_telemetry):
6262
"""Test that Firebase telemetry delegates to GCP telemetry."""
6363
add_firebase_telemetry()
6464
mock_add_gcp_telemetry.assert_called_once_with(force_export=False)
6565

6666

67-
@patch("genkit.plugins.google_cloud.telemetry.metrics._output_tokens")
68-
@patch("genkit.plugins.google_cloud.telemetry.metrics._input_tokens")
69-
@patch("genkit.plugins.google_cloud.telemetry.metrics._latency")
70-
@patch("genkit.plugins.google_cloud.telemetry.metrics._failures")
71-
@patch("genkit.plugins.google_cloud.telemetry.metrics._requests")
67+
@patch('genkit.plugins.google_cloud.telemetry.metrics._output_tokens')
68+
@patch('genkit.plugins.google_cloud.telemetry.metrics._input_tokens')
69+
@patch('genkit.plugins.google_cloud.telemetry.metrics._latency')
70+
@patch('genkit.plugins.google_cloud.telemetry.metrics._failures')
71+
@patch('genkit.plugins.google_cloud.telemetry.metrics._requests')
7272
def test_record_generate_metrics_with_model_action(
7373
mock_requests,
7474
mock_failures,
@@ -91,16 +91,16 @@ def test_record_generate_metrics_with_model_action(
9191

9292
# Create test span using helper
9393
mock_span = _create_model_span(
94-
model_name="gemini-pro",
95-
path="/{myflow,t:flow}",
94+
model_name='gemini-pro',
95+
path='/{myflow,t:flow}',
9696
output='{"usage": {"inputTokens": 100, "outputTokens": 50}}',
9797
)
9898

9999
# Execute
100100
record_generate_metrics(mock_span)
101101

102102
# Verify dimensions
103-
expected_dimensions = {"model": "gemini-pro", "source": "myflow", "error": "none"}
103+
expected_dimensions = {'model': 'gemini-pro', 'source': 'myflow', 'error': 'none'}
104104

105105
# Verify requests counter
106106
mock_request_counter.add.assert_called_once_with(1, expected_dimensions)

py/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
[project]
1818
dependencies = [
19-
"dotpromptz==0.1.3",
19+
"dotpromptz==0.1.4",
2020
"genkit",
2121
"genkit-plugin-anthropic",
2222
"genkit-plugin-dev-local-vectorstore",
Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,37 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
117
[project]
2-
name = "anthropic-hello"
3-
version = "0.1.0"
4-
description = "Anthropic Hello Sample"
5-
requires-python = ">=3.10"
618
dependencies = [
7-
"genkit",
8-
"genkit-plugin-anthropic",
9-
"pydantic>=2.0.0",
10-
"structlog>=24.0.0",
19+
"genkit",
20+
"genkit-plugin-anthropic",
21+
"pydantic>=2.0.0",
22+
"structlog>=24.0.0",
1123
]
24+
description = "Anthropic Hello Sample"
25+
name = "anthropic-hello"
26+
requires-python = ">=3.10"
27+
version = "0.1.0"
1228

1329
[tool.uv.sources]
1430
genkit-plugin-anthropic = { workspace = true }
1531

1632
[build-system]
17-
requires = ["hatchling"]
1833
build-backend = "hatchling.build"
34+
requires = ["hatchling"]
1935

2036
[tool.hatch.build.targets.wheel]
2137
packages = ["src"]

0 commit comments

Comments
 (0)