Skip to content

Commit

Permalink
fix: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
kmaphoenix committed Jul 10, 2024
1 parent 926d3fb commit 15b5c97
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
9 changes: 7 additions & 2 deletions data/get_weather_tool.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Sample Tool for Agent Builder."""
import logging
import requests
from google.auth import default as google_default_auth
Expand All @@ -21,7 +22,8 @@ def get_request_params(param, default=None):
request_json = request.get_json(silent=True)
request_args = request.args

return (request_json or {}).get(param, default) or request_args.get(param, default)
return (request_json or {}).get(param, default) or request_args.get(
param, default)

@app.route("/get_weather_grid", methods=["GET", "POST"])
def get_weather_grid():
Expand All @@ -43,7 +45,10 @@ def get_weather_grid():

# just take the weather from the current period
period = data["properties"]["periods"][0]
return {"temperature": period["temperature"], "temperatureUnit": period["temperatureUnit"]}
return {
"temperature": period["temperature"],
"temperatureUnit": period["temperatureUnit"]
}

return {}

Expand Down
21 changes: 5 additions & 16 deletions examples/bot_building_series/genai_agents_101.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,9 @@
"- Functions\n",
"- Data Stores\n",
"\n",
"In this next section, we'll create an 2 `OpenAPI Spec` tools that can do the following:\n",
"- Search for points of interest based on the [Google Places API](https://developers.google.com/maps/documentation/places/web-service/overview)\n",
"In this next section, we'll create an `OpenAPI Spec` tool that can do the following:\n",
"- Find the weather using the [National Weather Service Web API](https://www.weather.gov/documentation/services-web-api)\n",
"\n",
"** NOTE: ** We are using a custom Cloud Run endpoint to host our code here. You will need to define your OpenAPI spec with _your_ endpoint and _your_ endpoint specs based on how it is deployed. You WILL NOT have access to our endpoints!<br>\n",
"\n",
"For more information, see [Vertex Agents Tools](https://cloud.google.com/dialogflow/vertex/docs/concept/tools)"
]
},
Expand Down Expand Up @@ -404,17 +401,9 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"zsh:1: command not found: wget\n"
]
}
],
"outputs": [],
"source": [
"!wget https://raw.githubusercontent.com/GoogleCloudPlatform/dfcx-scrapi/main/data/get_weather_tool.py\n",
"!mv get_weather_tool.py main.py\n",
Expand Down Expand Up @@ -479,8 +468,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Call Create Tools\n",
"For creating the `OpenAPI Spec` tools, we'll use the `build_open_api_tool` helper method to create the proper Tool object, then pass it to the `create_tool` method and capture the result for each tool."
"### Call Create Tool\n",
"For creating the `OpenAPI Spec` tool, we'll use the `build_open_api_tool` helper method to create the proper Tool object, then pass it to the `create_tool` method and capture the result."
]
},
{
Expand Down

0 comments on commit 15b5c97

Please sign in to comment.