agent-starter-pack 0.1.6__py3-none-any.whl → 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of agent-starter-pack might be problematic. Click here for more details.
- {agent_starter_pack-0.1.6.dist-info → agent_starter_pack-0.2.0.dist-info}/METADATA +6 -6
- {agent_starter_pack-0.1.6.dist-info → agent_starter_pack-0.2.0.dist-info}/RECORD +78 -78
- agents/{agentic_rag_vertexai_search → agentic_rag}/README.md +3 -3
- agents/{agentic_rag_vertexai_search → agentic_rag}/app/agent.py +22 -6
- agents/agentic_rag/app/retrievers.py +132 -0
- agents/{agentic_rag_vertexai_search → agentic_rag}/notebooks/evaluating_langgraph_agent.ipynb +3 -3
- agents/{agentic_rag_vertexai_search → agentic_rag}/template/.templateconfig.yaml +3 -5
- agents/crewai_coding_crew/notebooks/evaluating_crewai_agent.ipynb +4 -4
- agents/crewai_coding_crew/notebooks/evaluating_langgraph_agent.ipynb +3 -3
- agents/langgraph_base_react/notebooks/evaluating_langgraph_agent.ipynb +3 -3
- agents/{multimodal_live_api → live_api}/README.md +7 -0
- agents/{multimodal_live_api → live_api}/app/agent.py +3 -11
- agents/{multimodal_live_api → live_api}/app/server.py +3 -2
- agents/{multimodal_live_api → live_api}/template/.templateconfig.yaml +2 -2
- src/base_template/Makefile +12 -7
- src/base_template/README.md +71 -71
- src/base_template/app/utils/tracing.py +3 -1
- src/base_template/app/utils/typing.py +1 -0
- src/base_template/deployment/cd/deploy-to-prod.yaml +10 -4
- src/base_template/deployment/cd/staging.yaml +11 -10
- src/base_template/deployment/ci/pr_checks.yaml +1 -1
- src/base_template/deployment/terraform/apis.tf +6 -0
- src/base_template/deployment/terraform/build_triggers.tf +34 -21
- src/base_template/deployment/terraform/dev/iam.tf +13 -6
- src/base_template/deployment/terraform/dev/log_sinks.tf +25 -28
- src/base_template/deployment/terraform/dev/providers.tf +1 -0
- src/base_template/deployment/terraform/dev/storage.tf +69 -11
- src/base_template/deployment/terraform/dev/variables.tf +50 -53
- src/base_template/deployment/terraform/dev/vars/env.tfvars +13 -11
- src/base_template/deployment/terraform/iam.tf +3 -3
- src/base_template/deployment/terraform/log_sinks.tf +24 -26
- src/base_template/deployment/terraform/providers.tf +2 -0
- src/base_template/deployment/terraform/service_accounts.tf +7 -7
- src/base_template/deployment/terraform/storage.tf +123 -11
- src/base_template/deployment/terraform/variables.tf +49 -70
- src/base_template/deployment/terraform/vars/env.tfvars +12 -17
- src/base_template/pyproject.toml +4 -3
- src/cli/commands/create.py +79 -19
- src/cli/commands/setup_cicd.py +91 -22
- src/cli/main.py +3 -1
- src/cli/utils/__init__.py +9 -2
- src/cli/utils/cicd.py +12 -0
- src/cli/utils/datastores.py +32 -0
- src/cli/utils/gcp.py +4 -6
- src/cli/utils/template.py +127 -45
- src/cli/utils/version.py +87 -0
- src/data_ingestion/README.md +24 -19
- src/data_ingestion/data_ingestion_pipeline/components/ingest_data.py +135 -2
- src/data_ingestion/data_ingestion_pipeline/components/process_data.py +276 -2
- src/data_ingestion/data_ingestion_pipeline/pipeline.py +28 -5
- src/data_ingestion/data_ingestion_pipeline/submit_pipeline.py +49 -14
- src/data_ingestion/pyproject.toml +1 -0
- src/deployment_targets/agent_engine/app/agent_engine_app.py +3 -1
- src/deployment_targets/cloud_run/tests/unit/test_server.py +15 -33
- src/frontends/live_api_react/frontend/package-lock.json +226 -186
- src/frontends/live_api_react/frontend/package.json +1 -1
- src/frontends/streamlit/frontend/utils/stream_handler.py +5 -5
- src/resources/containers/data_processing/Dockerfile +3 -1
- src/resources/locks/{uv-agentic_rag_vertexai_search-agent_engine.lock → uv-agentic_rag-agent_engine.lock} +747 -694
- src/resources/locks/{uv-agentic_rag_vertexai_search-cloud_run.lock → uv-agentic_rag-cloud_run.lock} +944 -806
- src/resources/locks/uv-crewai_coding_crew-agent_engine.lock +651 -694
- src/resources/locks/uv-crewai_coding_crew-cloud_run.lock +813 -789
- src/resources/locks/uv-langgraph_base_react-agent_engine.lock +666 -686
- src/resources/locks/uv-langgraph_base_react-cloud_run.lock +848 -798
- src/resources/locks/{uv-multimodal_live_api-cloud_run.lock → uv-live_api-cloud_run.lock} +856 -791
- src/resources/setup_cicd/cicd_variables.tf +5 -0
- src/resources/setup_cicd/github.tf +4 -2
- src/utils/watch_and_rebuild.py +14 -0
- agents/agentic_rag_vertexai_search/app/retrievers.py +0 -79
- src/deployment_targets/cloud_run/deployment/terraform/artifact_registry.tf +0 -22
- src/deployment_targets/cloud_run/deployment/terraform/dev/service_accounts.tf +0 -20
- {agent_starter_pack-0.1.6.dist-info → agent_starter_pack-0.2.0.dist-info}/WHEEL +0 -0
- {agent_starter_pack-0.1.6.dist-info → agent_starter_pack-0.2.0.dist-info}/entry_points.txt +0 -0
- {agent_starter_pack-0.1.6.dist-info → agent_starter_pack-0.2.0.dist-info}/licenses/LICENSE +0 -0
- /agents/{agentic_rag_vertexai_search → agentic_rag}/app/templates.py +0 -0
- /agents/{agentic_rag_vertexai_search → agentic_rag}/tests/integration/test_agent.py +0 -0
- /agents/{multimodal_live_api → live_api}/app/templates.py +0 -0
- /agents/{multimodal_live_api → live_api}/app/vector_store.py +0 -0
- /agents/{multimodal_live_api → live_api}/tests/integration/test_server_e2e.py +0 -0
- /agents/{multimodal_live_api → live_api}/tests/load_test/load_test.py +0 -0
- /agents/{multimodal_live_api → live_api}/tests/unit/test_server.py +0 -0
|
@@ -40,6 +40,7 @@ def parse_args() -> argparse.Namespace:
|
|
|
40
40
|
parser.add_argument(
|
|
41
41
|
"--region", default=os.getenv("REGION"), help="Vertex AI Pipelines region"
|
|
42
42
|
)
|
|
43
|
+
{%- if cookiecutter.datastore_type == "vertex_ai_search" %}
|
|
43
44
|
parser.add_argument(
|
|
44
45
|
"--data-store-region",
|
|
45
46
|
default=os.getenv("DATA_STORE_REGION"),
|
|
@@ -48,6 +49,23 @@ def parse_args() -> argparse.Namespace:
|
|
|
48
49
|
parser.add_argument(
|
|
49
50
|
"--data-store-id", default=os.getenv("DATA_STORE_ID"), help="Data store ID"
|
|
50
51
|
)
|
|
52
|
+
{%- elif cookiecutter.datastore_type == "vertex_ai_vector_search" %}
|
|
53
|
+
parser.add_argument(
|
|
54
|
+
"--vector-search-index",
|
|
55
|
+
default=os.getenv("VECTOR_SEARCH_INDEX"),
|
|
56
|
+
help="Vector Search Index",
|
|
57
|
+
)
|
|
58
|
+
parser.add_argument(
|
|
59
|
+
"--vector-search-index-endpoint",
|
|
60
|
+
default=os.getenv("VECTOR_SEARCH_INDEX_ENDPOINT"),
|
|
61
|
+
help="Vector Search Index Endpoint",
|
|
62
|
+
)
|
|
63
|
+
parser.add_argument(
|
|
64
|
+
"--vector-search-data-bucket-name",
|
|
65
|
+
default=os.getenv("VECTOR_SEARCH_BUCKET"),
|
|
66
|
+
help="Vector Search Data Bucket Name",
|
|
67
|
+
)
|
|
68
|
+
{%- endif %}
|
|
51
69
|
parser.add_argument(
|
|
52
70
|
"--service-account",
|
|
53
71
|
default=os.getenv("SERVICE_ACCOUNT"),
|
|
@@ -85,12 +103,22 @@ def parse_args() -> argparse.Namespace:
|
|
|
85
103
|
required_params = {
|
|
86
104
|
"project_id": parsed_args.project_id,
|
|
87
105
|
"region": parsed_args.region,
|
|
88
|
-
"data_store_region": parsed_args.data_store_region,
|
|
89
|
-
"data_store_id": parsed_args.data_store_id,
|
|
90
106
|
"service_account": parsed_args.service_account,
|
|
91
107
|
"pipeline_root": parsed_args.pipeline_root,
|
|
92
108
|
"pipeline_name": parsed_args.pipeline_name,
|
|
93
109
|
}
|
|
110
|
+
{%- if cookiecutter.datastore_type == "vertex_ai_search" %}
|
|
111
|
+
required_params["data_store_region"] = parsed_args.data_store_region
|
|
112
|
+
required_params["data_store_id"] = parsed_args.data_store_id
|
|
113
|
+
{%- elif cookiecutter.datastore_type == "vertex_ai_vector_search" %}
|
|
114
|
+
required_params["vector_search_index"] = parsed_args.vector_search_index
|
|
115
|
+
required_params["vector_search_index_endpoint"] = (
|
|
116
|
+
parsed_args.vector_search_index_endpoint
|
|
117
|
+
)
|
|
118
|
+
required_params["vector_search_data_bucket_name"] = (
|
|
119
|
+
parsed_args.vector_search_data_bucket_name
|
|
120
|
+
)
|
|
121
|
+
{%- endif %}
|
|
94
122
|
|
|
95
123
|
for param_name, param_value in required_params.items():
|
|
96
124
|
if param_value is None:
|
|
@@ -118,16 +146,9 @@ if __name__ == "__main__":
|
|
|
118
146
|
# Print configuration
|
|
119
147
|
logging.info("\nConfiguration:")
|
|
120
148
|
logging.info("--------------")
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
logging.info(f"data_store_id: {args.data_store_id}")
|
|
125
|
-
logging.info(f"service_account: {args.service_account}")
|
|
126
|
-
logging.info(f"pipeline_root: {args.pipeline_root}")
|
|
127
|
-
logging.info(f"cron_schedule: {args.cron_schedule}")
|
|
128
|
-
logging.info(f"pipeline_name: {args.pipeline_name}")
|
|
129
|
-
logging.info(f"disable_caching: {args.disable_caching}")
|
|
130
|
-
logging.info(f"schedule_only: {args.schedule_only}")
|
|
149
|
+
# Print all arguments dynamically
|
|
150
|
+
for arg_name, arg_value in vars(args).items():
|
|
151
|
+
logging.info(f"{arg_name}: {arg_value}")
|
|
131
152
|
logging.info("--------------\n")
|
|
132
153
|
|
|
133
154
|
compiler.Compiler().compile(pipeline_func=pipeline, package_path=PIPELINE_FILE_NAME)
|
|
@@ -142,10 +163,24 @@ if __name__ == "__main__":
|
|
|
142
163
|
"parameter_values": {
|
|
143
164
|
"project_id": args.project_id,
|
|
144
165
|
"location": args.region,
|
|
145
|
-
"data_store_region": args.data_store_region,
|
|
146
|
-
"data_store_id": args.data_store_id,
|
|
147
166
|
},
|
|
148
167
|
}
|
|
168
|
+
{%- if cookiecutter.datastore_type == "vertex_ai_search" %}
|
|
169
|
+
pipeline_job_params["parameter_values"]["data_store_region"] = (
|
|
170
|
+
args.data_store_region
|
|
171
|
+
)
|
|
172
|
+
pipeline_job_params["parameter_values"]["data_store_id"] = args.data_store_id
|
|
173
|
+
{%- elif cookiecutter.datastore_type == "vertex_ai_vector_search" %}
|
|
174
|
+
pipeline_job_params["parameter_values"]["vector_search_index"] = (
|
|
175
|
+
args.vector_search_index
|
|
176
|
+
)
|
|
177
|
+
pipeline_job_params["parameter_values"]["vector_search_index_endpoint"] = (
|
|
178
|
+
args.vector_search_index_endpoint
|
|
179
|
+
)
|
|
180
|
+
pipeline_job_params["parameter_values"]["vector_search_data_bucket_name"] = (
|
|
181
|
+
args.vector_search_data_bucket_name
|
|
182
|
+
)
|
|
183
|
+
{%- endif %}
|
|
149
184
|
|
|
150
185
|
# Create pipeline job instance
|
|
151
186
|
job = aiplatform.PipelineJob(**pipeline_job_params)
|
|
@@ -215,7 +215,9 @@ if __name__ == "__main__":
|
|
|
215
215
|
help="GCP project ID (defaults to application default credentials)",
|
|
216
216
|
)
|
|
217
217
|
parser.add_argument(
|
|
218
|
-
"--location",
|
|
218
|
+
"--location",
|
|
219
|
+
default="us-central1",
|
|
220
|
+
help="GCP region (defaults to us-central1)",
|
|
219
221
|
)
|
|
220
222
|
parser.add_argument(
|
|
221
223
|
"--agent-name",
|
|
@@ -12,16 +12,15 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
import importlib.util
|
|
16
15
|
import json
|
|
17
16
|
import logging
|
|
18
17
|
import os
|
|
18
|
+
import sys
|
|
19
19
|
from collections.abc import Generator
|
|
20
20
|
from unittest.mock import MagicMock, patch
|
|
21
21
|
|
|
22
22
|
import pytest
|
|
23
23
|
from fastapi.testclient import TestClient
|
|
24
|
-
from google.auth import exceptions as google_auth_exceptions
|
|
25
24
|
from google.auth.credentials import Credentials
|
|
26
25
|
from langchain_core.messages import HumanMessage
|
|
27
26
|
|
|
@@ -65,36 +64,14 @@ def sample_input_chat() -> InputChat:
|
|
|
65
64
|
)
|
|
66
65
|
|
|
67
66
|
|
|
68
|
-
@pytest.fixture(autouse=True)
|
|
69
|
-
def mock_dependencies() -> Generator[None, None, None]:
|
|
70
|
-
"""
|
|
71
|
-
Mock Vertex AI dependencies for testing.
|
|
72
|
-
Patches VertexAIEmbeddings (if defined) and ChatVertexAI.
|
|
73
|
-
"""
|
|
74
|
-
patches = []
|
|
75
|
-
try:
|
|
76
|
-
try:
|
|
77
|
-
importlib.util.find_spec("app.agent.VertexAIEmbeddings")
|
|
78
|
-
except (ModuleNotFoundError, google_auth_exceptions.DefaultCredentialsError):
|
|
79
|
-
pass
|
|
80
|
-
else:
|
|
81
|
-
patches.append(patch("app.agent.VertexAIEmbeddings"))
|
|
82
|
-
patches.append(patch("app.agent.ChatVertexAI"))
|
|
83
|
-
|
|
84
|
-
for patch_item in patches:
|
|
85
|
-
mock = patch_item.start()
|
|
86
|
-
mock.return_value = MagicMock()
|
|
87
|
-
|
|
88
|
-
yield
|
|
89
|
-
except google_auth_exceptions.GoogleAuthError:
|
|
90
|
-
yield
|
|
91
|
-
|
|
92
|
-
|
|
93
67
|
def test_redirect_root_to_docs() -> None:
|
|
94
68
|
"""
|
|
95
69
|
Test that the root endpoint (/) redirects to the Swagger UI documentation.
|
|
96
70
|
"""
|
|
97
|
-
|
|
71
|
+
# Mock the agent module before importing server
|
|
72
|
+
mock_agent = MagicMock()
|
|
73
|
+
with patch.dict(sys.modules, {"app.agent": mock_agent}):
|
|
74
|
+
# Now import server after the mock is in place
|
|
98
75
|
from app.server import app
|
|
99
76
|
|
|
100
77
|
client = TestClient(app)
|
|
@@ -109,8 +86,6 @@ async def test_stream_chat_events() -> None:
|
|
|
109
86
|
Test the stream endpoint to ensure it correctly handles
|
|
110
87
|
streaming responses and generates the expected events.
|
|
111
88
|
"""
|
|
112
|
-
from app.server import app
|
|
113
|
-
|
|
114
89
|
input_data = {
|
|
115
90
|
"input": {
|
|
116
91
|
"messages": [
|
|
@@ -124,11 +99,18 @@ async def test_stream_chat_events() -> None:
|
|
|
124
99
|
|
|
125
100
|
mock_events = [{"content": "Mocked response"}, {"content": "Additional response"}]
|
|
126
101
|
|
|
127
|
-
|
|
128
|
-
|
|
102
|
+
# Create a mock agent module
|
|
103
|
+
mock_agent_module = MagicMock()
|
|
104
|
+
mock_agent_module.agent = MagicMock()
|
|
105
|
+
mock_agent_module.agent.stream.return_value = mock_events
|
|
106
|
+
|
|
107
|
+
# Patch the module import
|
|
108
|
+
with patch.dict(sys.modules, {"app.agent": mock_agent_module}):
|
|
109
|
+
# Import server after the mock is in place
|
|
110
|
+
from app.server import app
|
|
129
111
|
|
|
130
112
|
client = TestClient(app)
|
|
131
|
-
response = client.post("stream_messages", json=input_data)
|
|
113
|
+
response = client.post("/stream_messages", json=input_data)
|
|
132
114
|
|
|
133
115
|
assert response.status_code == 200
|
|
134
116
|
|