agent-starter-pack 0.0.1b0__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.

Files changed (162) hide show
  1. agent_starter_pack-0.0.1b0.dist-info/METADATA +143 -0
  2. agent_starter_pack-0.0.1b0.dist-info/RECORD +162 -0
  3. agent_starter_pack-0.0.1b0.dist-info/WHEEL +4 -0
  4. agent_starter_pack-0.0.1b0.dist-info/entry_points.txt +2 -0
  5. agent_starter_pack-0.0.1b0.dist-info/licenses/LICENSE +201 -0
  6. agents/agentic_rag_vertexai_search/README.md +22 -0
  7. agents/agentic_rag_vertexai_search/app/agent.py +145 -0
  8. agents/agentic_rag_vertexai_search/app/retrievers.py +79 -0
  9. agents/agentic_rag_vertexai_search/app/templates.py +53 -0
  10. agents/agentic_rag_vertexai_search/notebooks/evaluating_langgraph_agent.ipynb +1561 -0
  11. agents/agentic_rag_vertexai_search/template/.templateconfig.yaml +14 -0
  12. agents/agentic_rag_vertexai_search/tests/integration/test_agent.py +57 -0
  13. agents/crewai_coding_crew/README.md +34 -0
  14. agents/crewai_coding_crew/app/agent.py +86 -0
  15. agents/crewai_coding_crew/app/crew/config/agents.yaml +39 -0
  16. agents/crewai_coding_crew/app/crew/config/tasks.yaml +37 -0
  17. agents/crewai_coding_crew/app/crew/crew.py +71 -0
  18. agents/crewai_coding_crew/notebooks/evaluating_crewai_agent.ipynb +1571 -0
  19. agents/crewai_coding_crew/notebooks/evaluating_langgraph_agent.ipynb +1561 -0
  20. agents/crewai_coding_crew/template/.templateconfig.yaml +12 -0
  21. agents/crewai_coding_crew/tests/integration/test_agent.py +47 -0
  22. agents/langgraph_base_react/README.md +9 -0
  23. agents/langgraph_base_react/app/agent.py +73 -0
  24. agents/langgraph_base_react/notebooks/evaluating_langgraph_agent.ipynb +1561 -0
  25. agents/langgraph_base_react/template/.templateconfig.yaml +13 -0
  26. agents/langgraph_base_react/tests/integration/test_agent.py +48 -0
  27. agents/multimodal_live_api/README.md +50 -0
  28. agents/multimodal_live_api/app/agent.py +86 -0
  29. agents/multimodal_live_api/app/server.py +193 -0
  30. agents/multimodal_live_api/app/templates.py +51 -0
  31. agents/multimodal_live_api/app/vector_store.py +55 -0
  32. agents/multimodal_live_api/template/.templateconfig.yaml +15 -0
  33. agents/multimodal_live_api/tests/integration/test_server_e2e.py +254 -0
  34. agents/multimodal_live_api/tests/load_test/load_test.py +40 -0
  35. agents/multimodal_live_api/tests/unit/test_server.py +143 -0
  36. src/base_template/.gitignore +197 -0
  37. src/base_template/Makefile +37 -0
  38. src/base_template/README.md +91 -0
  39. src/base_template/app/utils/tracing.py +143 -0
  40. src/base_template/app/utils/typing.py +115 -0
  41. src/base_template/deployment/README.md +123 -0
  42. src/base_template/deployment/cd/deploy-to-prod.yaml +98 -0
  43. src/base_template/deployment/cd/staging.yaml +215 -0
  44. src/base_template/deployment/ci/pr_checks.yaml +51 -0
  45. src/base_template/deployment/terraform/apis.tf +34 -0
  46. src/base_template/deployment/terraform/build_triggers.tf +122 -0
  47. src/base_template/deployment/terraform/dev/apis.tf +42 -0
  48. src/base_template/deployment/terraform/dev/iam.tf +90 -0
  49. src/base_template/deployment/terraform/dev/log_sinks.tf +66 -0
  50. src/base_template/deployment/terraform/dev/providers.tf +29 -0
  51. src/base_template/deployment/terraform/dev/storage.tf +76 -0
  52. src/base_template/deployment/terraform/dev/variables.tf +126 -0
  53. src/base_template/deployment/terraform/dev/vars/env.tfvars +21 -0
  54. src/base_template/deployment/terraform/iam.tf +130 -0
  55. src/base_template/deployment/terraform/locals.tf +50 -0
  56. src/base_template/deployment/terraform/log_sinks.tf +72 -0
  57. src/base_template/deployment/terraform/providers.tf +35 -0
  58. src/base_template/deployment/terraform/service_accounts.tf +42 -0
  59. src/base_template/deployment/terraform/storage.tf +100 -0
  60. src/base_template/deployment/terraform/variables.tf +202 -0
  61. src/base_template/deployment/terraform/vars/env.tfvars +43 -0
  62. src/base_template/pyproject.toml +113 -0
  63. src/base_template/tests/unit/test_utils/test_tracing_exporter.py +140 -0
  64. src/cli/commands/create.py +534 -0
  65. src/cli/commands/setup_cicd.py +730 -0
  66. src/cli/main.py +35 -0
  67. src/cli/utils/__init__.py +35 -0
  68. src/cli/utils/cicd.py +662 -0
  69. src/cli/utils/gcp.py +120 -0
  70. src/cli/utils/logging.py +51 -0
  71. src/cli/utils/template.py +644 -0
  72. src/data_ingestion/README.md +79 -0
  73. src/data_ingestion/data_ingestion_pipeline/components/ingest_data.py +175 -0
  74. src/data_ingestion/data_ingestion_pipeline/components/process_data.py +321 -0
  75. src/data_ingestion/data_ingestion_pipeline/pipeline.py +58 -0
  76. src/data_ingestion/data_ingestion_pipeline/submit_pipeline.py +184 -0
  77. src/data_ingestion/pyproject.toml +17 -0
  78. src/data_ingestion/uv.lock +999 -0
  79. src/deployment_targets/agent_engine/app/agent_engine_app.py +238 -0
  80. src/deployment_targets/agent_engine/app/utils/gcs.py +42 -0
  81. src/deployment_targets/agent_engine/deployment_metadata.json +4 -0
  82. src/deployment_targets/agent_engine/notebooks/intro_reasoning_engine.ipynb +869 -0
  83. src/deployment_targets/agent_engine/tests/integration/test_agent_engine_app.py +120 -0
  84. src/deployment_targets/agent_engine/tests/load_test/.results/.placeholder +0 -0
  85. src/deployment_targets/agent_engine/tests/load_test/.results/report.html +264 -0
  86. src/deployment_targets/agent_engine/tests/load_test/.results/results_exceptions.csv +1 -0
  87. src/deployment_targets/agent_engine/tests/load_test/.results/results_failures.csv +1 -0
  88. src/deployment_targets/agent_engine/tests/load_test/.results/results_stats.csv +3 -0
  89. src/deployment_targets/agent_engine/tests/load_test/.results/results_stats_history.csv +22 -0
  90. src/deployment_targets/agent_engine/tests/load_test/README.md +42 -0
  91. src/deployment_targets/agent_engine/tests/load_test/load_test.py +100 -0
  92. src/deployment_targets/agent_engine/tests/unit/test_dummy.py +22 -0
  93. src/deployment_targets/cloud_run/Dockerfile +29 -0
  94. src/deployment_targets/cloud_run/app/server.py +128 -0
  95. src/deployment_targets/cloud_run/deployment/terraform/artifact_registry.tf +22 -0
  96. src/deployment_targets/cloud_run/deployment/terraform/dev/service_accounts.tf +20 -0
  97. src/deployment_targets/cloud_run/tests/integration/test_server_e2e.py +192 -0
  98. src/deployment_targets/cloud_run/tests/load_test/.results/.placeholder +0 -0
  99. src/deployment_targets/cloud_run/tests/load_test/README.md +79 -0
  100. src/deployment_targets/cloud_run/tests/load_test/load_test.py +85 -0
  101. src/deployment_targets/cloud_run/tests/unit/test_server.py +142 -0
  102. src/deployment_targets/cloud_run/uv.lock +6952 -0
  103. src/frontends/live_api_react/frontend/package-lock.json +19405 -0
  104. src/frontends/live_api_react/frontend/package.json +56 -0
  105. src/frontends/live_api_react/frontend/public/favicon.ico +0 -0
  106. src/frontends/live_api_react/frontend/public/index.html +62 -0
  107. src/frontends/live_api_react/frontend/public/robots.txt +3 -0
  108. src/frontends/live_api_react/frontend/src/App.scss +189 -0
  109. src/frontends/live_api_react/frontend/src/App.test.tsx +25 -0
  110. src/frontends/live_api_react/frontend/src/App.tsx +205 -0
  111. src/frontends/live_api_react/frontend/src/components/audio-pulse/AudioPulse.tsx +64 -0
  112. src/frontends/live_api_react/frontend/src/components/audio-pulse/audio-pulse.scss +68 -0
  113. src/frontends/live_api_react/frontend/src/components/control-tray/ControlTray.tsx +217 -0
  114. src/frontends/live_api_react/frontend/src/components/control-tray/control-tray.scss +201 -0
  115. src/frontends/live_api_react/frontend/src/components/logger/Logger.tsx +241 -0
  116. src/frontends/live_api_react/frontend/src/components/logger/logger.scss +133 -0
  117. src/frontends/live_api_react/frontend/src/components/logger/mock-logs.ts +151 -0
  118. src/frontends/live_api_react/frontend/src/components/side-panel/SidePanel.tsx +161 -0
  119. src/frontends/live_api_react/frontend/src/components/side-panel/side-panel.scss +285 -0
  120. src/frontends/live_api_react/frontend/src/contexts/LiveAPIContext.tsx +48 -0
  121. src/frontends/live_api_react/frontend/src/hooks/use-live-api.ts +115 -0
  122. src/frontends/live_api_react/frontend/src/hooks/use-media-stream-mux.ts +23 -0
  123. src/frontends/live_api_react/frontend/src/hooks/use-screen-capture.ts +72 -0
  124. src/frontends/live_api_react/frontend/src/hooks/use-webcam.ts +69 -0
  125. src/frontends/live_api_react/frontend/src/index.css +28 -0
  126. src/frontends/live_api_react/frontend/src/index.tsx +35 -0
  127. src/frontends/live_api_react/frontend/src/multimodal-live-types.ts +242 -0
  128. src/frontends/live_api_react/frontend/src/react-app-env.d.ts +17 -0
  129. src/frontends/live_api_react/frontend/src/reportWebVitals.ts +31 -0
  130. src/frontends/live_api_react/frontend/src/setupTests.ts +21 -0
  131. src/frontends/live_api_react/frontend/src/utils/audio-recorder.ts +111 -0
  132. src/frontends/live_api_react/frontend/src/utils/audio-streamer.ts +270 -0
  133. src/frontends/live_api_react/frontend/src/utils/audioworklet-registry.ts +43 -0
  134. src/frontends/live_api_react/frontend/src/utils/multimodal-live-client.ts +329 -0
  135. src/frontends/live_api_react/frontend/src/utils/store-logger.ts +64 -0
  136. src/frontends/live_api_react/frontend/src/utils/utils.ts +86 -0
  137. src/frontends/live_api_react/frontend/src/utils/worklets/audio-processing.ts +73 -0
  138. src/frontends/live_api_react/frontend/src/utils/worklets/vol-meter.ts +65 -0
  139. src/frontends/live_api_react/frontend/tsconfig.json +25 -0
  140. src/frontends/streamlit/frontend/side_bar.py +213 -0
  141. src/frontends/streamlit/frontend/streamlit_app.py +263 -0
  142. src/frontends/streamlit/frontend/style/app_markdown.py +37 -0
  143. src/frontends/streamlit/frontend/utils/chat_utils.py +67 -0
  144. src/frontends/streamlit/frontend/utils/local_chat_history.py +125 -0
  145. src/frontends/streamlit/frontend/utils/message_editing.py +59 -0
  146. src/frontends/streamlit/frontend/utils/multimodal_utils.py +217 -0
  147. src/frontends/streamlit/frontend/utils/stream_handler.py +282 -0
  148. src/frontends/streamlit/frontend/utils/title_summary.py +77 -0
  149. src/resources/containers/data_processing/Dockerfile +25 -0
  150. src/resources/locks/uv-agentic_rag_vertexai_search-agent_engine.lock +4684 -0
  151. src/resources/locks/uv-agentic_rag_vertexai_search-cloud_run.lock +5799 -0
  152. src/resources/locks/uv-crewai_coding_crew-agent_engine.lock +5509 -0
  153. src/resources/locks/uv-crewai_coding_crew-cloud_run.lock +6688 -0
  154. src/resources/locks/uv-langgraph_base_react-agent_engine.lock +4595 -0
  155. src/resources/locks/uv-langgraph_base_react-cloud_run.lock +5710 -0
  156. src/resources/locks/uv-multimodal_live_api-cloud_run.lock +5665 -0
  157. src/resources/setup_cicd/cicd_variables.tf +36 -0
  158. src/resources/setup_cicd/github.tf +85 -0
  159. src/resources/setup_cicd/providers.tf +39 -0
  160. src/utils/generate_locks.py +135 -0
  161. src/utils/lock_utils.py +82 -0
  162. src/utils/watch_and_rebuild.py +190 -0
@@ -0,0 +1,14 @@
1
+ description: "A RAG agent using Vertex AI Search and LangGraph for document retrieval and Q&A"
2
+ settings:
3
+ requires_data_ingestion: true
4
+ deployment_targets: ["agent_engine", "cloud_run"]
5
+ extra_dependencies: [
6
+ "langchain-google-vertexai~=2.0.7",
7
+ "langchain~=0.3.14",
8
+ "langgraph~=0.2.63",
9
+ "langchain-google-vertexai~=2.0.7",
10
+ "langchain~=0.3.14",
11
+ "langchain-community~=0.3.17",
12
+ "langchain-openai~=0.3.5",
13
+ "langchain-google-community[vertexaisearch]~=2.0.2",
14
+ ]
@@ -0,0 +1,57 @@
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
+ # mypy: disable-error-code="union-attr"
16
+ from unittest.mock import MagicMock, patch
17
+
18
+ from app.agent import agent
19
+
20
+
21
+ @patch(
22
+ "app.agent.retrieve_docs.func",
23
+ return_value=("dummy content", [{"page_content": "Test document content"}]),
24
+ )
25
+ def test_agent_stream(mock_retrieve: MagicMock) -> None:
26
+ """
27
+ Integration test for the agent stream functionality.
28
+ Tests that the agent returns valid streaming responses.
29
+ """
30
+ input_dict = {
31
+ "messages": [
32
+ {"type": "human", "content": "Hi"},
33
+ {"type": "ai", "content": "Hi there!"},
34
+ {
35
+ "type": "human",
36
+ "content": "How to split a string with pattern 'alphabet/alphabet' and not split 'number/number' in same string",
37
+ },
38
+ ]
39
+ }
40
+
41
+ events = [
42
+ message for message, _ in agent.stream(input_dict, stream_mode="messages")
43
+ ]
44
+
45
+ # Verify we get a reasonable number of messages
46
+ assert len(events) > 0, "Expected at least one message"
47
+
48
+ # First message should be an AI message
49
+ assert events[0].type == "AIMessageChunk"
50
+
51
+ # At least one message should have content
52
+ has_content = False
53
+ for event in events:
54
+ if hasattr(event, "content") and event.content:
55
+ has_content = True
56
+ break
57
+ assert has_content, "Expected at least one message with content"
@@ -0,0 +1,34 @@
1
+ # CrewAI Coding Crew Agent
2
+
3
+ This agent combines CrewAI's collaborative AI capabilities with LangGraph to provide an interactive coding assistant that can understand requirements and generate code solutions through conversation.
4
+
5
+ ## Architecture
6
+
7
+ The agent implements a conversational interface using LangGraph that coordinates with a CrewAI development team. The workflow consists of:
8
+
9
+ 1. A conversational agent that:
10
+ - Gathers requirements through natural dialogue
11
+ - Clarifies ambiguities by asking follow-up questions
12
+ - Delegates actual coding work to the CrewAI development team
13
+
14
+ 2. A CrewAI development team consisting of:
15
+ - Senior Engineer: Responsible for implementing the code solution
16
+ - Chief QA Engineer: Evaluates and validates the implemented code
17
+
18
+ ## Key Features
19
+
20
+ - **Interactive Requirements Gathering**: Uses LangGraph to maintain a natural conversation flow while collecting and clarifying coding requirements
21
+ - **Collaborative AI Development**: Leverages CrewAI's multi-agent system to divide work between specialized AI agents
22
+ - **Sequential Processing**: Tasks are processed in order, from requirements gathering to implementation to quality assurance
23
+
24
+ ## How It Works
25
+
26
+ 1. The LangGraph workflow manages the conversation state and determines when to:
27
+ - Continue the conversation to gather more requirements
28
+ - Delegate work to the CrewAI development team
29
+ - Return results to the user
30
+
31
+ 2. When coding is needed, the CrewAI team is activated through a custom tool that:
32
+ - Passes requirements to the Senior Engineer agent
33
+ - Routes the implementation to the QA Engineer for validation
34
+ - Returns the final, validated solution
@@ -0,0 +1,86 @@
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
+ # mypy: disable-error-code="union-attr"
16
+ from langchain_core.messages import BaseMessage
17
+ from langchain_core.runnables import RunnableConfig
18
+ from langchain_core.tools import tool
19
+ from langchain_google_vertexai import ChatVertexAI
20
+ from langgraph.graph import END, MessagesState, StateGraph
21
+ from langgraph.prebuilt import ToolNode
22
+
23
+ from .crew.crew import DevCrew
24
+
25
+ LOCATION = "us-central1"
26
+ LLM = "gemini-2.0-flash-001"
27
+
28
+
29
+ @tool
30
+ def coding_tool(code_instructions: str) -> str:
31
+ """Use this tool to write a python program given a set of requirements and or instructions."""
32
+ inputs = {"code_instructions": code_instructions}
33
+ return DevCrew().crew().kickoff(inputs=inputs)
34
+
35
+
36
+ tools = [coding_tool]
37
+
38
+ # 2. Set up the language model
39
+ llm = ChatVertexAI(
40
+ model=LLM, location=LOCATION, temperature=0, max_tokens=4096, streaming=True
41
+ ).bind_tools(tools)
42
+
43
+
44
+ # 3. Define workflow components
45
+ def should_continue(state: MessagesState) -> str:
46
+ """Determines whether to use the crew or end the conversation."""
47
+ last_message = state["messages"][-1]
48
+ return "dev_crew" if last_message.tool_calls else END
49
+
50
+
51
+ def call_model(state: MessagesState, config: RunnableConfig) -> dict[str, BaseMessage]:
52
+ """Calls the language model and returns the response."""
53
+ system_message = (
54
+ "You are an expert Lead Software Engineer Manager.\n"
55
+ "Your role is to speak to a user and understand what kind of code they need to "
56
+ "build.\n"
57
+ "Part of your task is therefore to gather requirements and clarifying ambiguity "
58
+ "by asking followup questions. Don't ask all the questions together as the user "
59
+ "has a low attention span, rather ask a question at the time.\n"
60
+ "Once the problem to solve is clear, you will call your tool for writing the "
61
+ "solution.\n"
62
+ "Remember, you are an expert in understanding requirements but you cannot code, "
63
+ "use your coding tool to generate a solution. Keep the test cases if any, they "
64
+ "are useful for the user."
65
+ )
66
+
67
+ messages_with_system = [{"type": "system", "content": system_message}] + state[
68
+ "messages"
69
+ ]
70
+ # Forward the RunnableConfig object to ensure the agent is capable of streaming the response.
71
+ response = llm.invoke(messages_with_system, config)
72
+ return {"messages": response}
73
+
74
+
75
+ # 4. Create the workflow graph
76
+ workflow = StateGraph(MessagesState)
77
+ workflow.add_node("agent", call_model)
78
+ workflow.add_node("dev_crew", ToolNode(tools))
79
+ workflow.set_entry_point("agent")
80
+
81
+ # 5. Define graph edges
82
+ workflow.add_conditional_edges("agent", should_continue)
83
+ workflow.add_edge("dev_crew", "agent")
84
+
85
+ # 6. Compile the workflow
86
+ agent = workflow.compile()
@@ -0,0 +1,39 @@
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
+ senior_engineer_agent:
16
+ role: >
17
+ Senior Software Engineer
18
+
19
+
20
+ goal: >
21
+ Create software as needed
22
+
23
+
24
+ backstory: >
25
+ You are a Senior Software Engineer at a leading tech company. You are an expert Python programmer and do your best to produce perfect code.
26
+
27
+
28
+ chief_qa_engineer_agent:
29
+ role: >
30
+ Chief Software Quality Control Engineer
31
+
32
+
33
+ goal: >
34
+ Ensure that the code does the job that it is supposed to do and that it is error free.
35
+
36
+
37
+ backstory: >
38
+ You feel that programmers always do only half the job, so you are super dedicate to make high quality code.
39
+
@@ -0,0 +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
+ code_task:
16
+ description: >
17
+ You are helping writing python code. These are the instructions:
18
+
19
+ Instructions ------------ {code_instructions}
20
+
21
+
22
+ expected_output: >
23
+ Your Final answer must be the full python code, only the python code and nothing else.
24
+
25
+
26
+ evaluate_task:
27
+ description: >
28
+ You are helping writing python code. These are the instructions:
29
+
30
+ Instructions ------------ {code_instructions}
31
+
32
+ You will look over the code to insure that it is complete and does the job that it is supposed to do. You will also check for logic error, syntax errors, missing imports, variable declarations, mismatched brackets and missing test cases. If you find any issue in the code, ask the Senior Software Engineer to fix it by providing them the code and the instructions. Don't fix it yourself.
33
+
34
+
35
+ expected_output: >
36
+ Your Final answer must be the full python code, only the python code and nothing else.
37
+
@@ -0,0 +1,71 @@
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
+ # mypy: disable-error-code="attr-defined"
16
+ from typing import Any
17
+
18
+ from crewai import Agent, Crew, Process, Task
19
+ from crewai.project import CrewBase, agent, crew, task
20
+
21
+
22
+ @CrewBase
23
+ class DevCrew:
24
+ """Developer crew"""
25
+
26
+ agents_config: dict[str, Any]
27
+ tasks_config: dict[str, Any]
28
+
29
+ llm = "vertex_ai/gemini-2.0-flash-001"
30
+
31
+ @agent
32
+ def senior_engineer_agent(self) -> Agent:
33
+ return Agent(
34
+ config=self.agents_config.get("senior_engineer_agent"),
35
+ allow_delegation=False,
36
+ verbose=True,
37
+ llm=self.llm,
38
+ )
39
+
40
+ @agent
41
+ def chief_qa_engineer_agent(self) -> Agent:
42
+ return Agent(
43
+ config=self.agents_config.get("chief_qa_engineer_agent"),
44
+ allow_delegation=True,
45
+ verbose=True,
46
+ llm=self.llm,
47
+ )
48
+
49
+ @task
50
+ def code_task(self) -> Task:
51
+ return Task(
52
+ config=self.tasks_config.get("code_task"),
53
+ agent=self.senior_engineer_agent(),
54
+ )
55
+
56
+ @task
57
+ def evaluate_task(self) -> Task:
58
+ return Task(
59
+ config=self.tasks_config.get("evaluate_task"),
60
+ agent=self.chief_qa_engineer_agent(),
61
+ )
62
+
63
+ @crew
64
+ def crew(self) -> Crew:
65
+ """Creates the Dev Crew"""
66
+ return Crew(
67
+ agents=self.agents,
68
+ tasks=self.tasks,
69
+ process=Process.sequential,
70
+ verbose=True,
71
+ )