Skip to content

Commit 5dd2ed1

Browse files
authored
chore: Ran formatting (#2)
1 parent cb4c958 commit 5dd2ed1

File tree

27 files changed

+210
-237
lines changed

27 files changed

+210
-237
lines changed

.github/actions/spelling/allow.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
AError
2+
ARequest
3+
AStarlette
4+
adk
5+
genai
6+
inmemory
7+
langgraph
8+
lifecycles
9+
oauthoidc
10+
opensource
11+
socio
12+
sse

.github/linters/.jscpd.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{
2-
"ignore": [
3-
"**/.github/**",
4-
"**/.git/**"
5-
],
2+
"ignore": ["**/.github/**", "**/.git/**", "**/tests/**"],
63
"threshold": 3,
74
"reporters": ["html", "markdown"]
85
}

.github/workflows/linter.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ name: Lint Code Base
1414
# Start the job on all push #
1515
#############################
1616
on:
17-
push:
18-
branches-ignore: [main]
19-
# Remove the line above to run when pushing to main
2017
pull_request:
2118
branches: [main]
2219

@@ -31,7 +28,7 @@ jobs:
3128
runs-on: ubuntu-latest
3229
# if on repo to avoid failing runs on forks
3330
if: |
34-
github.repository == 'google/A2A'
31+
github.repository == 'google/a2a-python'
3532
3633
##################
3734
# Load all steps #

.github/workflows/spelling.yaml

Lines changed: 2 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,6 @@
11
name: Check Spelling
22

3-
# Comment management is handled through a secondary job, for details see:
4-
# https://github.com/check-spelling/check-spelling/wiki/Feature%3A-Restricted-Permissions
5-
#
6-
# `jobs.comment-push` runs when a push is made to a repository and the `jobs.spelling` job needs to make a comment
7-
# (in odd cases, it might actually run just to collapse a comment, but that's fairly rare)
8-
# it needs `contents: write` in order to add a comment.
9-
#
10-
# `jobs.comment-pr` runs when a pull_request is made to a repository and the `jobs.spelling` job needs to make a comment
11-
# or collapse a comment (in the case where it had previously made a comment and now no longer needs to show a comment)
12-
# it needs `pull-requests: write` in order to manipulate those comments.
13-
14-
# Updating pull request branches is managed via comment handling.
15-
# For details, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-Update-expect-list
16-
#
17-
# These elements work together to make it happen:
18-
#
19-
# `on.issue_comment`
20-
# This event listens to comments by users asking to update the metadata.
21-
#
22-
# `jobs.update`
23-
# This job runs in response to an issue_comment and will push a new commit
24-
# to update the spelling metadata.
25-
#
26-
# `with.experimental_apply_changes_via_bot`
27-
# Tells the action to support and generate messages that enable it
28-
# to make a commit to update the spelling metadata.
29-
#
30-
# `with.ssh_key`
31-
# In order to trigger workflows when the commit is made, you can provide a
32-
# secret (typically, a write-enabled github deploy key).
33-
#
34-
# For background, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-Update-with-deploy-key
35-
36-
# Sarif reporting
37-
#
38-
# Access to Sarif reports is generally restricted (by GitHub) to members of the repository.
39-
#
40-
# Requires enabling `security-events: write`
41-
# and configuring the action with `use_sarif: 1`
42-
#
43-
# For information on the feature, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-Sarif-output
44-
45-
# Minimal workflow structure:
46-
#
47-
# on:
48-
# push:
49-
# ...
50-
# pull_request_target:
51-
# ...
52-
# jobs:
53-
# # you only want the spelling job, all others should be omitted
54-
# spelling:
55-
# # remove `security-events: write` and `use_sarif: 1`
56-
# # remove `experimental_apply_changes_via_bot: 1`
57-
# ... otherwise adjust the `with:` as you wish
58-
593
on:
60-
push:
61-
branches:
62-
- "**"
63-
tags-ignore:
64-
- "**"
654
pull_request:
665
branches:
676
- "**"
@@ -85,7 +24,7 @@ jobs:
8524
runs-on: ubuntu-latest
8625
# if on repo to avoid failing runs on forks
8726
if: |
88-
github.repository == 'google/A2A'
27+
github.repository == 'google/a2a-python'
8928
&& (contains(github.event_name, 'pull_request') || github.event_name == 'push')
9029
concurrency:
9130
group: spelling-${{ github.event.pull_request.number || github.ref }}
@@ -141,6 +80,6 @@ jobs:
14180
cspell:sql/src/tsql.txt
14281
cspell:terraform/dict/terraform.txt
14382
cspell:typescript/dict/typescript.txt
144-
check_extra_dictionaries: ''
83+
check_extra_dictionaries: ""
14584
only_check_changed_files: true
14685
longest_word: "10"

.vscode/launch.json

Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,31 @@
11
{
2-
"version": "0.2.0",
3-
"configurations": [
4-
{
5-
"name": "Debug HelloWorld Agent",
6-
"type": "debugpy",
7-
"request": "launch",
8-
"program": "${workspaceFolder}/examples/helloworld/__main__.py",
9-
"console": "integratedTerminal",
10-
"justMyCode": false,
11-
"env": {
12-
"PYTHONPATH": "${workspaceFolder}",
13-
},
14-
"cwd": "${workspaceFolder}/examples/helloworld",
15-
"args": [
16-
"--host",
17-
"localhost",
18-
"--port",
19-
"9999"
20-
]
21-
},
22-
{
23-
"name": "Debug Currency Agent",
24-
"type": "debugpy",
25-
"request": "launch",
26-
"program": "${workspaceFolder}/examples/langgraph/__main__.py",
27-
"console": "integratedTerminal",
28-
"justMyCode": false,
29-
"env": {
30-
"PYTHONPATH": "${workspaceFolder}",
31-
},
32-
"cwd": "${workspaceFolder}/examples/langgraph",
33-
"args": [
34-
"--host",
35-
"localhost",
36-
"--port",
37-
"10000"
38-
]
39-
}
40-
]
41-
}
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Debug HelloWorld Agent",
6+
"type": "debugpy",
7+
"request": "launch",
8+
"program": "${workspaceFolder}/examples/helloworld/__main__.py",
9+
"console": "integratedTerminal",
10+
"justMyCode": false,
11+
"env": {
12+
"PYTHONPATH": "${workspaceFolder}"
13+
},
14+
"cwd": "${workspaceFolder}/examples/helloworld",
15+
"args": ["--host", "localhost", "--port", "9999"]
16+
},
17+
{
18+
"name": "Debug Currency Agent",
19+
"type": "debugpy",
20+
"request": "launch",
21+
"program": "${workspaceFolder}/examples/langgraph/__main__.py",
22+
"console": "integratedTerminal",
23+
"justMyCode": false,
24+
"env": {
25+
"PYTHONPATH": "${workspaceFolder}"
26+
},
27+
"cwd": "${workspaceFolder}/examples/langgraph",
28+
"args": ["--host", "localhost", "--port", "10000"]
29+
}
30+
]
31+
}

.vscode/settings.json

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
{
2-
"python.testing.pytestArgs": [
3-
"tests"
4-
],
5-
"python.testing.unittestEnabled": false,
6-
"python.testing.pytestEnabled": true,
2+
"python.testing.pytestArgs": ["tests"],
3+
"python.testing.unittestEnabled": false,
4+
"python.testing.pytestEnabled": true,
5+
"editor.formatOnSave": true,
6+
"[python]": {
7+
"editor.defaultFormatter": "charliermarsh.ruff",
78
"editor.formatOnSave": true,
8-
"[python]": {
9-
"editor.defaultFormatter": "charliermarsh.ruff",
10-
"editor.formatOnSave": true,
11-
"editor.codeActionsOnSave": {
12-
"source.organizeImports": "always"
13-
},
14-
},
15-
"ruff.importStrategy": "fromEnvironment"
16-
}
9+
"editor.codeActionsOnSave": {
10+
"source.organizeImports": "always"
11+
}
12+
},
13+
"ruff.importStrategy": "fromEnvironment"
14+
}

CODE_OF_CONDUCT.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Code of Conduct
32

43
## Our Pledge
@@ -15,22 +14,22 @@ race, religion, or sexual identity and orientation.
1514
Examples of behavior that contributes to creating a positive environment
1615
include:
1716

18-
* Using welcoming and inclusive language
19-
* Being respectful of differing viewpoints and experiences
20-
* Gracefully accepting constructive criticism
21-
* Focusing on what is best for the community
22-
* Showing empathy towards other community members
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
2322

2423
Examples of unacceptable behavior by participants include:
2524

26-
* The use of sexualized language or imagery and unwelcome sexual attention or
27-
advances
28-
* Trolling, insulting/derogatory comments, and personal or political attacks
29-
* Public or private harassment
30-
* Publishing others' private information, such as a physical or electronic
31-
address, without explicit permission
32-
* Other conduct which could reasonably be considered inappropriate in a
33-
professional setting
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
3433

3534
## Our Responsibilities
3635

@@ -61,7 +60,7 @@ negative impact on the project or its community.
6160

6261
We do not believe that all conflict is bad; healthy debate and disagreement
6362
often yield positive results. However, it is never okay to be disrespectful or
64-
to engage in behavior that violates the projects code of conduct.
63+
to engage in behavior that violates the project's code of conduct.
6564

6665
If you see someone violating the code of conduct, you are encouraged to address
6766
the behavior directly with those involved. Many issues can be resolved quickly
@@ -70,8 +69,8 @@ dispute. If you are unable to resolve the matter for any reason, or if the
7069
behavior is threatening or harassing, report it. We are dedicated to providing
7170
an environment where participants feel welcome and safe.
7271

73-
Reports should be directed to *[PROJECT STEWARD NAME(s) AND EMAIL(s)]*, the
74-
Project Steward(s) for *[PROJECT NAME]*. It is the Project Stewards duty to
72+
Reports should be directed to _[PROJECT STEWARD NAME(s) AND EMAIL(s)]_, the
73+
Project Steward(s) for _[PROJECT NAME]_. It is the Project Steward's duty to
7574
receive and address reported violations of the code of conduct. They will then
7675
work with a committee consisting of representatives from the Open Source
7776
Programs Office and the Google Open Source Strategy team. If for any reason you

examples/google_adk/calendar_agent/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This example shows how to create an A2A Server that uses an ADK-based Agent that
88
- [UV](https://docs.astral.sh/uv/)
99
- A Gemini API Key
1010
- A [Google OAuth Client](https://developers.google.com/identity/openid-connect/openid-connect#getcredentials)
11-
- Configure your OAuth client to handle redirect URLs at `localhost:10007/authenticate`
11+
- Configure your OAuth client to handle redirect URLs at `localhost:10007/authenticate`
1212

1313
## Running the example
1414

@@ -24,4 +24,4 @@ echo "GOOGLE_CLIENT_SECRET=your_client_secret_here" >> .env
2424

2525
```
2626
uv run .
27-
```
27+
```

examples/google_adk/calendar_agent/__main__.py

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
import logging
22
import os
3-
import sys
43

54
import click
65
import uvicorn
76

8-
from adk_agent_executor import ADKAgentExecutor
97
from adk_agent import create_agent
8+
from adk_agent_executor import ADKAgentExecutor
109
from dotenv import load_dotenv
10+
from google.adk.artifacts import InMemoryArtifactService
11+
from google.adk.memory.in_memory_memory_service import InMemoryMemoryService
12+
from google.adk.runners import Runner
13+
from google.adk.sessions import InMemorySessionService
14+
from starlette.applications import Starlette
15+
from starlette.requests import Request
16+
from starlette.responses import PlainTextResponse
17+
from starlette.routing import Route
1118

12-
from a2a.server.tasks import InMemoryTaskStore
1319
from a2a.server.apps import A2AStarletteApplication
1420
from a2a.server.request_handlers import DefaultRequestHandler
21+
from a2a.server.tasks import InMemoryTaskStore
1522
from a2a.types import (
1623
AgentAuthentication,
1724
AgentCapabilities,
1825
AgentCard,
1926
AgentSkill,
2027
)
21-
from google.adk.artifacts import InMemoryArtifactService
22-
from google.adk.memory.in_memory_memory_service import InMemoryMemoryService
23-
from google.adk.runners import Runner
24-
from google.adk.sessions import InMemorySessionService
25-
from starlette.applications import Starlette
26-
from starlette.routing import Route
27-
from starlette.requests import Request
28-
from starlette.responses import PlainTextResponse
28+
2929

3030
load_dotenv()
3131

@@ -36,12 +36,15 @@
3636
@click.option('--host', 'host', default='localhost')
3737
@click.option('--port', 'port', default=10007)
3838
def main(host: str, port: int):
39-
# Verify an API key is set. Not required if using Vertex AI APIs, since those can use gcloud credentials.
40-
if not os.getenv('GOOGLE_GENAI_USE_VERTEXAI') == 'TRUE':
41-
if not os.getenv('GOOGLE_API_KEY'):
42-
raise Exception(
43-
'GOOGLE_API_KEY environment variable not set and GOOGLE_GENAI_USE_VERTEXAI is not TRUE.'
44-
)
39+
# Verify an API key is set.
40+
# Not required if using Vertex AI APIs.
41+
if os.getenv('GOOGLE_GENAI_USE_VERTEXAI') != 'TRUE' and not os.getenv(
42+
'GOOGLE_API_KEY'
43+
):
44+
raise ValueError(
45+
'GOOGLE_API_KEY environment variable not set and '
46+
'GOOGLE_GENAI_USE_VERTEXAI is not TRUE.'
47+
)
4548

4649
skill = AgentSkill(
4750
id='check_availability',

0 commit comments

Comments
 (0)