8000 chore: include contributing/ folder in autoformat.sh · dev573/adk-python@433c423 · GitHub
[go: up one dir, main page]

Skip to content

Commit 433c423

Browse files
wuliang229copybara-github
authored andcommitted
chore: include contributing/ folder in autoformat.sh
Also formatted the files in that folder in this same commit. PiperOrigin-RevId: 766885306
1 parent e99f87d commit 433c423

File tree

13 files changed

+34
-26
lines changed

13 files changed

+34
-26
lines changed

autoformat.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ echo '---------------------------------------'
4141
isort tests/
4242
echo 'All done! ✨ 🍰 ✨'
4343

44+
echo '---------------------------------------'
45+
echo '| Organizing imports for contributing/...'
46+
echo '---------------------------------------'
47+
48+
isort contributing/
49+
echo 'All done! ✨ 🍰 ✨'
50+
4451
echo '---------------------------------------'
4552
echo '| Auto-formatting src/...'
4653
echo '---------------------------------------'
@@ -52,3 +59,9 @@ echo '| Auto-formatting tests/...'
5259
echo '---------------------------------------'
5360

5461
find -L tests/ -type f -name "*.py" -exec pyink --config pyproject.toml {} +
62+
63+
echo '---------------------------------------'
64+
echo '| Auto-formatting contributing/...'
65+
echo '---------------------------------------'
66+
67+
find -L contributing/ -type f -name "*.py" -exec pyink --config pyproject.toml {} +

contributing/samples/artifact_save_text/agent.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,12 @@
1919

2020

2121
async def log_query(tool_context: ToolContext, query: str):
22-
"""Saves the provided query string as a 'text/plain' artifact named 'query'."""
23-
query_bytes = query.encode('utf-8')
24-
artifact_part = types.Part(
25-
inline_data=types.Blob(
26-
mime_type='text/plain',
27-
data=query_bytes
28-
)
29-
)
30-
await tool_context.save_artifact('query', artifact_part)
22+
"""Saves the provided query string as a 'text/plain' artifact named 'query'."""
23+
query_bytes = query.encode('utf-8')
24+
artifact_part = types.Part(
25+
inline_data=types.Blob(mime_type='text/plain', data=query_bytes)
26+
)
27+
await tool_context.save_artifact('query', artifact_part)
3128

3229

3330
root_agent = Agent(

contributing/samples/bigquery/agent.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from google.adk.tools.bigquery import BigQueryToolset
2020
import google.auth
2121

22-
2322
RUN_WITH_ADC = False
2423

2524

contributing/samples/generate_image/agent.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from google.genai import Client
16-
from google.genai import types
17-
1815
from google.adk import Agent
1916
from google.adk.tools import load_artifacts
2017
from google.adk.tools import ToolContext
18+
from google.genai import Client
19+
from google.genai import types
2120

2221
# Only Vertex AI supports image generation for now.
2322
client = Client()

contributing/samples/google_search_agent/agent.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from google.genai import Client
16-
1715
from google.adk import Agent
1816
from google.adk.tools import google_search
17+
from google.genai import Client
1918

2019
# Only Vertex AI supports image generation for now.
2120
client = Client()

contributing/samples/hello_world/agent.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ async def check_prime(nums: list[int]) -> str:
6565
else f"{', '.join(str(num) for num in primes)} are prime numbers."
6666
)
6767

68+
6869
root_agent = Agent(
6970
model='gemini-2.0-flash',
7071
name='data_processing_agent',

contributing/samples/human_in_loop/main.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,23 @@
1313
# limitations under the License.
1414

1515
import asyncio
16+
import os
17+
from typing import Any
18+
from typing import Union
1619

1720
import agent
1821
from dotenv import load_dotenv
19-
from typing import Any
20-
from typing import Union
2122
from google.adk.agents import Agent
2223
from google.adk.events import Event
2324
from google.adk.runners import Runner
24-
from google.adk.tools import LongRunningFunctionTool
2525
from google.adk.sessions import InMemorySessionService
26+
from google.adk.tools import LongRunningFunctionTool
2627
from google.genai import types
27-
28-
import os
2928
from opentelemetry import trace
3029
from opentelemetry.exporter.cloud_trace import CloudTraceSpanExporter
3130
from opentelemetry.sdk.trace import export
3231
from opentelemetry.sdk.trace import TracerProvider
3332

34-
3533
load_dotenv(override=True)
3634

3735
APP_NAME = "human_in_the_loop"

contributing/samples/jira_agent/agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
# limitations under the License.
1414

1515
from google.adk.agents import Agent
16+
1617
from .tools import jira_tool
1718

1819
root_agent = Agent(
1920
model='gemini-2.0-flash-001',
2021
name='jira_connector_agent',
21-
description="This agent helps search issues in JIRA",
22+
description='This agent helps search issues in JIRA',
2223
instruction="""
2324
To start with, greet the user
2425
First, you will be given a description of what you can do.
@@ -49,5 +50,4 @@
4950
- I currently support only **GET** and **LIST** operations.
5051
""",
5152
tools=jira_tool.get_tools(),
52-
5353
)

contributing/samples/jira_agent/tools.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
jira_tool = ApplicationIntegrationToolset(
1818
project="your-gcp-project-id", # replace with your GCP project ID
1919
location="your-regions", # replace your regions
20-
connection="your-integration-connection-name", #replace with your connection name
20+
connection="your-integration-connection-name", # replace with your connection name
2121
entity_operations={
2222
"Issues": ["GET", "LIST"],
2323
},
@@ -30,5 +30,4 @@
3030
This tool is to call an integration to search for issues in JIRA
3131
3232
""",
33-
3433
)

contributing/samples/mcp_sse_agent/filesystem_server.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import os
1717
from pathlib import Path
1818
import sys
19+
1920
from mcp.server.fastmcp import FastMCP
2021

2122
# Create an MCP server with a name

contributing/samples/mcp_streamablehttp_agent/filesystem_server.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import os
1717
from pathlib import Path
1818
import sys
19+
1920
from mcp.server.fastmcp import FastMCP
2021

2122
# Create an MCP server with a name

contributing/samples/telemetry/agent.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ async def check_prime(nums: list[int]) -> str:
6565
else f"{', '.join(str(num) for num in primes)} are prime numbers."
6666
)
6767

68+
6869
root_agent = Agent(
6970
model='gemini-2.0-flash',
7071
name='data_processing_agent',

contributing/samples/telemetry/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
from opentelemetry.sdk.trace import export
2828
from opentelemetry.sdk.trace import TracerProvider
2929

30-
3130
load_dotenv(override=True)
3231

32+
3333
async < 2851 span class=pl-k>def main():
3434
app_name = 'my_app'
3535
user_id_1 = 'user1'

0 commit comments

Comments
 (0)
0