mirror of
https://github.com/google/ax.git
synced 2026-10-02 03:14:37 +08:00
Remove weather tool and the custom system instructions (#231)
This commit is contained in:
+4
-5
@@ -73,20 +73,19 @@ kubectl port-forward -n ax rs/ax-server 8494:8494
|
||||
|
||||
### 3. Test End-to-End
|
||||
|
||||
Run an execution targeting the port-forwarded server. The default `antigravity`
|
||||
harness has an embedded weather agent that exposes a `get_weather` tool.
|
||||
Run an execution targeting the port-forwarded server.
|
||||
|
||||
```bash
|
||||
ax exec --server=localhost:8494 --input="what's the weather in NYC?"
|
||||
ax exec --server=localhost:8494 --input="hello, who are you?"
|
||||
```
|
||||
|
||||
The server should respond with something like:
|
||||
```text
|
||||
Conversation: fb344a18-3720-4c4f-8a6e-2ce34db975b3
|
||||
|
||||
⏺ what's the weather in NYC?
|
||||
⏺ hello, who are you?
|
||||
|
||||
The weather in New York is sunny with a temperature of 25 degrees Celsius (77 degrees Fahrenheit).
|
||||
I am a helpful assistant. How can I help you today?
|
||||
```
|
||||
*The request is served by the antigravity harness actor running on Substrate.*
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
{
|
||||
"system_instructions": "You are a friendly weather assistant. Use the get_weather tool and reply in one upbeat sentence. If possible, include emojis in your response.",
|
||||
"model": "gemini-3.1-pro-preview"
|
||||
}
|
||||
@@ -37,25 +37,7 @@ from python.proto import content_pb2
|
||||
from google.antigravity import Agent, AgentConfig, LocalAgentConfig
|
||||
from google.antigravity.types import Text, Thought, ToolCall
|
||||
|
||||
# 1. Define the custom weather tool
|
||||
def get_weather(city: str) -> str:
|
||||
"""Retrieves the current weather report for a specified city.
|
||||
|
||||
Args:
|
||||
city (str): The name of the city for which to retrieve the weather report.
|
||||
|
||||
Returns:
|
||||
str: Weather report status and details.
|
||||
"""
|
||||
sys.stderr.write(f"\n[PYTHON TOOL get_weather executed for city: {city}]\n")
|
||||
sys.stderr.flush()
|
||||
c = city.lower()
|
||||
if "new york" in c or "nyc" in c:
|
||||
return "The weather in New York is sunny with a temperature of 25 degrees Celsius (77 degrees Fahrenheit)."
|
||||
elif "san francisco" in c or "sf" in c:
|
||||
return "The weather in San Francisco is foggy with a temperature of 16 degrees Celsius (60.8 degrees Fahrenheit)."
|
||||
else:
|
||||
return f"Weather information for '{city}' is not available."
|
||||
|
||||
class VertexKwargs(TypedDict, total=False):
|
||||
"""Typed subset of LocalAgentConfig kwargs needed to enable Vertex AI.
|
||||
@@ -119,8 +101,7 @@ def _build_default_config() -> LocalAgentConfig:
|
||||
this config.
|
||||
"""
|
||||
return LocalAgentConfig(
|
||||
system_instructions="You are a helpful agent. Use the get_weather tool to answer weather questions.",
|
||||
tools=[get_weather],
|
||||
system_instructions="You are a helpful agent.",
|
||||
**_vertex_kwargs_from_env(),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user