raindrop-google-adk 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,90 @@
1
+ .zodprompt-eval.sqlite
2
+ .topicmatch-eval.sqlite
3
+ # Logs
4
+ logs
5
+ *.log
6
+ npm-debug.log*
7
+ yarn-debug.log*
8
+ yarn-error.log*
9
+ pnpm-debug.log*
10
+ lerna-debug.log*
11
+ env/
12
+ temp
13
+ .env*
14
+ node_modules
15
+ dist
16
+ dist-ssr
17
+ *.local
18
+ .env
19
+ .yarn
20
+ .yarnrc.yml
21
+ .pnpm-store
22
+ package-lock.json
23
+ .turbo
24
+ *.tsbuildinfo
25
+ apps/**/secrets/**
26
+ */*/eval-results
27
+ apps/dashboard/eval-results/metadata/
28
+ # Editor directories and files
29
+ .vscode/*
30
+ !.vscode/extensions.json
31
+ !.vscode/settings.json
32
+ !.vscode/tasks.json
33
+ !.vscode/launch.json
34
+ .idea
35
+ .DS_Store
36
+ *.suo
37
+ *.ntvs*
38
+ *.njsproj
39
+ *.sln
40
+ *.sw?
41
+ *bite-sight-prompts.txt
42
+
43
+ # Python files
44
+ *.pyc
45
+ __pycache__/
46
+ .venv/
47
+
48
+ myenv/
49
+
50
+ build/
51
+ dawnai.egg-info/
52
+
53
+ .next/
54
+
55
+ .vercel
56
+
57
+ .extra
58
+
59
+ packages/scripts/local-configs
60
+
61
+ gcp-auth.json
62
+
63
+ .crush/
64
+ mcp.json
65
+
66
+ # Don't commit local dev setup SST state
67
+ infra/.sst
68
+ plans/
69
+ .evals/
70
+ apps/dawn/app/api/internal/evals/
71
+ .sst/
72
+ sample-*.json
73
+ results.txt
74
+
75
+ # Dev logs
76
+ .logs/
77
+ tmp/
78
+
79
+ # Supabase local
80
+ **/supabase/.branches
81
+ **/supabase/.temp
82
+ **/supabase/seeds/
83
+
84
+ # Coding Agents
85
+ .claude/
86
+ **/opencode/
87
+ **/opencode/**
88
+
89
+ .zed/
90
+
@@ -0,0 +1,201 @@
1
+ Metadata-Version: 2.4
2
+ Name: raindrop-google-adk
3
+ Version: 0.0.1
4
+ Summary: Raindrop integration for Google ADK (Agent Development Kit)
5
+ Author-email: Raindrop AI <sdk@raindrop.ai>
6
+ License: MIT
7
+ Requires-Python: >=3.10
8
+ Requires-Dist: raindrop-ai>=0.0.42
9
+ Provides-Extra: adk
10
+ Requires-Dist: google-adk>=1.14.1; extra == 'adk'
11
+ Provides-Extra: dev
12
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
13
+ Requires-Dist: pytest>=8.0; extra == 'dev'
14
+ Requires-Dist: requests>=2.28; extra == 'dev'
15
+ Description-Content-Type: text/markdown
16
+
17
+ # raindrop-google-adk
18
+
19
+ Raindrop integration for [Google ADK](https://github.com/google/adk-python) (Agent Development Kit) — Google's framework for building AI agents powered by Gemini models.
20
+
21
+ Wraps Google ADK `Runner` objects to automatically capture agent invocations, tool calls, and multi-step reasoning, shipping telemetry to Raindrop.
22
+
23
+ ## Installation
24
+
25
+ ```bash
26
+ pip install raindrop-google-adk google-adk
27
+ ```
28
+
29
+ ## Quick Start
30
+
31
+ ```python
32
+ from raindrop_google_adk import setup_google_adk
33
+ from google.adk import Runner
34
+ from google.adk.agents import LlmAgent
35
+ from google.adk.sessions import InMemorySessionService
36
+ from google.genai import types
37
+
38
+ # Enable automatic tracing for all ADK Runner interactions
39
+ rd = setup_google_adk(api_key="your-write-key")
40
+
41
+ # Create your ADK agent as normal
42
+ def get_weather(city: str) -> dict:
43
+ """Get weather for a city."""
44
+ return {"temperature": 72, "condition": "sunny", "city": city}
45
+
46
+ agent = LlmAgent(
47
+ name="weather_assistant",
48
+ tools=[get_weather],
49
+ model="gemini-2.5-flash",
50
+ instruction="You are a helpful assistant that can check weather.",
51
+ )
52
+
53
+ # Create session and runner
54
+ session_service = InMemorySessionService()
55
+ runner = Runner(app_name="weather_app", agent=agent, session_service=session_service)
56
+
57
+ # Use the runner as normal — all interactions are automatically traced
58
+ user_msg = types.Content(
59
+ parts=[types.Part(text="What's the weather in New York?")],
60
+ role="user",
61
+ )
62
+ for event in runner.run(user_id="user123", session_id="session123", new_message=user_msg):
63
+ print(event)
64
+ ```
65
+
66
+ ## What Gets Traced
67
+
68
+ The Google ADK integration automatically captures:
69
+
70
+ - **Runner invocations** — input message, user_id, session_id, app_name
71
+ - **Agent responses** — final output text from the agent
72
+ - **Token usage** — prompt_tokens, completion_tokens, total_tokens from usage metadata
73
+ - **Tool calls** — count of function calls in the response
74
+ - **Model info** — model version when available
75
+ - **Agent identity** — agent name, author from events
76
+ - **Errors** — captured (with error message) and re-raised to the caller
77
+ - **Async support** — both `run()` (sync) and `run_async()` (async) are instrumented
78
+
79
+ ## Configuration
80
+
81
+ ### Auto-instrumentation (recommended)
82
+
83
+ ```python
84
+ from raindrop_google_adk import setup_google_adk
85
+
86
+ rd = setup_google_adk(
87
+ api_key="your-write-key", # Required: your Raindrop API key (or set RAINDROP_API_KEY env var)
88
+ user_id="user-123", # Optional: default user ID for all events
89
+ convo_id="convo-456", # Optional: conversation/thread ID
90
+ )
91
+
92
+ # All Runner.run() and Runner.run_async() calls are now automatically traced
93
+ # Call rd.shutdown() before process exit
94
+ ```
95
+
96
+ ### Manual wrapping
97
+
98
+ ```python
99
+ from raindrop_google_adk import create_raindrop_google_adk
100
+
101
+ rd = create_raindrop_google_adk(
102
+ api_key="your-write-key",
103
+ user_id="user-123",
104
+ )
105
+
106
+ # Wrap a specific runner instance
107
+ wrapped_runner = rd.wrap(runner)
108
+
109
+ # Use wrapped_runner as normal
110
+ for event in wrapped_runner.run(...):
111
+ print(event)
112
+
113
+ rd.shutdown()
114
+ ```
115
+
116
+ ### Class-based API
117
+
118
+ ```python
119
+ from raindrop_google_adk import RaindropGoogleADK
120
+
121
+ rd = RaindropGoogleADK(api_key="your-write-key", user_id="user-123")
122
+
123
+ # Auto-patch all Runner instances
124
+ rd.setup()
125
+
126
+ # Or wrap a specific runner
127
+ wrapped = rd.wrap(runner)
128
+
129
+ # Identify users and track signals
130
+ rd.identify(user_id="user-123", properties={"plan": "pro"})
131
+ rd.track_signal(user_id="user-123", signal_name="thumbs_up")
132
+
133
+ # Cleanup
134
+ rd.shutdown()
135
+ ```
136
+
137
+ ## Async Usage
138
+
139
+ The wrapper supports both sync and async runner usage:
140
+
141
+ ```python
142
+ import asyncio
143
+
144
+ async def main():
145
+ user_msg = types.Content(
146
+ parts=[types.Part(text="What's the weather?")],
147
+ role="user",
148
+ )
149
+ async for event in runner.run_async(
150
+ user_id="user123",
151
+ session_id="session123",
152
+ new_message=user_msg,
153
+ ):
154
+ if event.is_final_response():
155
+ print(event.content.parts[0].text)
156
+
157
+ rd.shutdown()
158
+
159
+ asyncio.run(main())
160
+ ```
161
+
162
+ ## Captured Properties
163
+
164
+ Each event includes the following properties when available:
165
+
166
+ | Property | Description |
167
+ |----------|-------------|
168
+ | `ai.usage.prompt_tokens` | Input token count |
169
+ | `ai.usage.completion_tokens` | Output token count |
170
+ | `ai.usage.total_tokens` | Total token count |
171
+ | `google_adk.app_name` | Runner app name |
172
+ | `google_adk.user_id` | User ID from the runner call |
173
+ | `google_adk.session_id` | Session ID from the runner call |
174
+ | `google_adk.author` | Event author (agent name) |
175
+ | `google_adk.agent_name` | Agent name from the event |
176
+ | `google_adk.tool_calls_count` | Number of tool calls in the run |
177
+ | `google_adk.tool_call_names` | JSON list of tool names called |
178
+ | `google_adk.error` | Whether a Python exception occurred |
179
+ | `google_adk.error_message` | Python exception message if applicable |
180
+ | `google_adk.error_code` | LLM-level error code (e.g. SAFETY, QUOTA) |
181
+ | `google_adk.llm_error_message` | LLM-level error message |
182
+ | `google_adk.agent_branch` | Agent hierarchy path for multi-agent setups |
183
+ | `google_adk.finish_reason` | Why generation stopped (STOP, SAFETY, etc.) |
184
+ | `ai.usage.cached_tokens` | Cached content token count |
185
+ | `ai.usage.thoughts_tokens` | Thinking/reasoning token count |
186
+
187
+ ## Flushing and Shutdown
188
+
189
+ Always call `shutdown()` before your process exits to ensure all telemetry is shipped:
190
+
191
+ ```python
192
+ rd.shutdown() # flush + release resources
193
+ ```
194
+
195
+ ## Testing
196
+
197
+ ```bash
198
+ cd packages/google-adk-python
199
+ pip install -e ".[dev]"
200
+ pytest
201
+ ```
@@ -0,0 +1,185 @@
1
+ # raindrop-google-adk
2
+
3
+ Raindrop integration for [Google ADK](https://github.com/google/adk-python) (Agent Development Kit) — Google's framework for building AI agents powered by Gemini models.
4
+
5
+ Wraps Google ADK `Runner` objects to automatically capture agent invocations, tool calls, and multi-step reasoning, shipping telemetry to Raindrop.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ pip install raindrop-google-adk google-adk
11
+ ```
12
+
13
+ ## Quick Start
14
+
15
+ ```python
16
+ from raindrop_google_adk import setup_google_adk
17
+ from google.adk import Runner
18
+ from google.adk.agents import LlmAgent
19
+ from google.adk.sessions import InMemorySessionService
20
+ from google.genai import types
21
+
22
+ # Enable automatic tracing for all ADK Runner interactions
23
+ rd = setup_google_adk(api_key="your-write-key")
24
+
25
+ # Create your ADK agent as normal
26
+ def get_weather(city: str) -> dict:
27
+ """Get weather for a city."""
28
+ return {"temperature": 72, "condition": "sunny", "city": city}
29
+
30
+ agent = LlmAgent(
31
+ name="weather_assistant",
32
+ tools=[get_weather],
33
+ model="gemini-2.5-flash",
34
+ instruction="You are a helpful assistant that can check weather.",
35
+ )
36
+
37
+ # Create session and runner
38
+ session_service = InMemorySessionService()
39
+ runner = Runner(app_name="weather_app", agent=agent, session_service=session_service)
40
+
41
+ # Use the runner as normal — all interactions are automatically traced
42
+ user_msg = types.Content(
43
+ parts=[types.Part(text="What's the weather in New York?")],
44
+ role="user",
45
+ )
46
+ for event in runner.run(user_id="user123", session_id="session123", new_message=user_msg):
47
+ print(event)
48
+ ```
49
+
50
+ ## What Gets Traced
51
+
52
+ The Google ADK integration automatically captures:
53
+
54
+ - **Runner invocations** — input message, user_id, session_id, app_name
55
+ - **Agent responses** — final output text from the agent
56
+ - **Token usage** — prompt_tokens, completion_tokens, total_tokens from usage metadata
57
+ - **Tool calls** — count of function calls in the response
58
+ - **Model info** — model version when available
59
+ - **Agent identity** — agent name, author from events
60
+ - **Errors** — captured (with error message) and re-raised to the caller
61
+ - **Async support** — both `run()` (sync) and `run_async()` (async) are instrumented
62
+
63
+ ## Configuration
64
+
65
+ ### Auto-instrumentation (recommended)
66
+
67
+ ```python
68
+ from raindrop_google_adk import setup_google_adk
69
+
70
+ rd = setup_google_adk(
71
+ api_key="your-write-key", # Required: your Raindrop API key (or set RAINDROP_API_KEY env var)
72
+ user_id="user-123", # Optional: default user ID for all events
73
+ convo_id="convo-456", # Optional: conversation/thread ID
74
+ )
75
+
76
+ # All Runner.run() and Runner.run_async() calls are now automatically traced
77
+ # Call rd.shutdown() before process exit
78
+ ```
79
+
80
+ ### Manual wrapping
81
+
82
+ ```python
83
+ from raindrop_google_adk import create_raindrop_google_adk
84
+
85
+ rd = create_raindrop_google_adk(
86
+ api_key="your-write-key",
87
+ user_id="user-123",
88
+ )
89
+
90
+ # Wrap a specific runner instance
91
+ wrapped_runner = rd.wrap(runner)
92
+
93
+ # Use wrapped_runner as normal
94
+ for event in wrapped_runner.run(...):
95
+ print(event)
96
+
97
+ rd.shutdown()
98
+ ```
99
+
100
+ ### Class-based API
101
+
102
+ ```python
103
+ from raindrop_google_adk import RaindropGoogleADK
104
+
105
+ rd = RaindropGoogleADK(api_key="your-write-key", user_id="user-123")
106
+
107
+ # Auto-patch all Runner instances
108
+ rd.setup()
109
+
110
+ # Or wrap a specific runner
111
+ wrapped = rd.wrap(runner)
112
+
113
+ # Identify users and track signals
114
+ rd.identify(user_id="user-123", properties={"plan": "pro"})
115
+ rd.track_signal(user_id="user-123", signal_name="thumbs_up")
116
+
117
+ # Cleanup
118
+ rd.shutdown()
119
+ ```
120
+
121
+ ## Async Usage
122
+
123
+ The wrapper supports both sync and async runner usage:
124
+
125
+ ```python
126
+ import asyncio
127
+
128
+ async def main():
129
+ user_msg = types.Content(
130
+ parts=[types.Part(text="What's the weather?")],
131
+ role="user",
132
+ )
133
+ async for event in runner.run_async(
134
+ user_id="user123",
135
+ session_id="session123",
136
+ new_message=user_msg,
137
+ ):
138
+ if event.is_final_response():
139
+ print(event.content.parts[0].text)
140
+
141
+ rd.shutdown()
142
+
143
+ asyncio.run(main())
144
+ ```
145
+
146
+ ## Captured Properties
147
+
148
+ Each event includes the following properties when available:
149
+
150
+ | Property | Description |
151
+ |----------|-------------|
152
+ | `ai.usage.prompt_tokens` | Input token count |
153
+ | `ai.usage.completion_tokens` | Output token count |
154
+ | `ai.usage.total_tokens` | Total token count |
155
+ | `google_adk.app_name` | Runner app name |
156
+ | `google_adk.user_id` | User ID from the runner call |
157
+ | `google_adk.session_id` | Session ID from the runner call |
158
+ | `google_adk.author` | Event author (agent name) |
159
+ | `google_adk.agent_name` | Agent name from the event |
160
+ | `google_adk.tool_calls_count` | Number of tool calls in the run |
161
+ | `google_adk.tool_call_names` | JSON list of tool names called |
162
+ | `google_adk.error` | Whether a Python exception occurred |
163
+ | `google_adk.error_message` | Python exception message if applicable |
164
+ | `google_adk.error_code` | LLM-level error code (e.g. SAFETY, QUOTA) |
165
+ | `google_adk.llm_error_message` | LLM-level error message |
166
+ | `google_adk.agent_branch` | Agent hierarchy path for multi-agent setups |
167
+ | `google_adk.finish_reason` | Why generation stopped (STOP, SAFETY, etc.) |
168
+ | `ai.usage.cached_tokens` | Cached content token count |
169
+ | `ai.usage.thoughts_tokens` | Thinking/reasoning token count |
170
+
171
+ ## Flushing and Shutdown
172
+
173
+ Always call `shutdown()` before your process exits to ensure all telemetry is shipped:
174
+
175
+ ```python
176
+ rd.shutdown() # flush + release resources
177
+ ```
178
+
179
+ ## Testing
180
+
181
+ ```bash
182
+ cd packages/google-adk-python
183
+ pip install -e ".[dev]"
184
+ pytest
185
+ ```
@@ -0,0 +1,32 @@
1
+ [project]
2
+ name = "raindrop-google-adk"
3
+ version = "0.0.1"
4
+ description = "Raindrop integration for Google ADK (Agent Development Kit)"
5
+ readme = "README.md"
6
+ license = {text = "MIT"}
7
+ requires-python = ">=3.10"
8
+ authors = [
9
+ {name = "Raindrop AI", email = "sdk@raindrop.ai"},
10
+ ]
11
+ dependencies = [
12
+ "raindrop-ai>=0.0.42",
13
+ ]
14
+
15
+ [project.optional-dependencies]
16
+ adk = ["google-adk>=1.14.1"]
17
+ dev = ["pytest>=8.0", "pytest-asyncio>=0.23.0", "requests>=2.28"]
18
+
19
+ [tool.pytest.ini_options]
20
+ testpaths = ["tests"]
21
+ python_files = ["test_*.py"]
22
+ python_classes = ["Test*"]
23
+ python_functions = ["test_*"]
24
+ addopts = ["-v", "--tb=short"]
25
+ asyncio_mode = "auto"
26
+
27
+ [build-system]
28
+ requires = ["hatchling"]
29
+ build-backend = "hatchling.build"
30
+
31
+ [tool.hatch.build.targets.wheel]
32
+ packages = ["raindrop_google_adk"]
@@ -0,0 +1,4 @@
1
+ from .wrapper import RaindropGoogleADK, create_raindrop_google_adk, setup_google_adk
2
+
3
+ __version__ = "0.0.1"
4
+ __all__ = ["RaindropGoogleADK", "create_raindrop_google_adk", "setup_google_adk", "__version__"]
File without changes