Back to Prompt Library
implementation

Agent Initialization and Tool Definition

Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.

Linked challenge: Gemini-powered Voice Navigator Agent

Format
Code-aware
Lines
16
Sections
6
Linked challenge
Gemini-powered Voice Navigator Agent

Prompt source

Original prompt text with formatting preserved for inspection.

16 lines
6 sections
No variables
1 code block
Using Google ADK, define the initial agent structure. This should include an agent that can access current location, retrieve map data, and speak. Provide the Python code for initializing the `adk.Agent` and registering a simple `get_current_location` tool and a `speak` tool. Assume you have already set up your Google Cloud project and authenticated.

```python
import adk
from adk import agent_builder
from google.cloud import texttospeech_v1 as tts

def get_current_location():
    # Placeholder for actual location retrieval
    return {"latitude": 34.0195, "longitude": -118.4912}

def speak(text: str):
    # Placeholder for TTS output
    print(f"Agent says: {text}")

builder = agent_builder.AgentBuilder()
builder.add_tool(get_current_location)
builder.add_tool(speak)

# ... continue to build the rest of the agent
```

Adaptation plan

Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.

Keep stable

Hold the task contract and output shape stable so generated implementations remain comparable.

Tune next

Update libraries, interfaces, and environment assumptions to match the stack you actually run.

Verify after

Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.