agent_k.toolsets.kaggle
Kaggle API toolset for competition discovery and leaderboard access.
agent_k.toolsets.kaggle
Kaggle toolset for AGENT-K agents.
@notice: | Kaggle toolset for AGENT-K agents.
@dev: | See module for implementation details and extension points.
@graph: id: agent_k.toolsets.kaggle provides: - agent_k.toolsets.kaggle:kaggle_toolset - agent_k.toolsets.kaggle:kaggle_search_competitions - agent_k.toolsets.kaggle:kaggle_get_competition - agent_k.toolsets.kaggle:kaggle_get_leaderboard - agent_k.toolsets.kaggle:kaggle_list_datasets pattern: toolset
@similar: - id: agent_k.adapters.kaggle when: "Adapter implementation backing these tools."
@agent-guidance: do: - "Use agent_k.toolsets.kaggle as the canonical home for this capability." do_not: - "Create parallel modules without updating @similar or @graph."
@human-review: last-verified: 2026-01-26 owners: - agent-k-core
(c) Mike Casale 2025. Licensed under the MIT License.
KaggleDeps
dataclass
Bases: BaseDeps
Dependencies for Kaggle toolsets.
@pattern: name: dependency-container rationale: "Groups Kaggle adapter and toolset settings." violations: "Direct adapter access bypasses shared settings."
@collaborators: required: - agent_k.adapters.kaggle:KaggleAdapter - agent_k.ui.agui:EventEmitter optional: - httpx:AsyncClient injection: constructor lifecycle: "Allocated per agent run."
Source code in agent_k/core/deps.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | |
platform_adapter
property
platform_adapter: KaggleAdapter
Expose the Kaggle adapter as a platform adapter.
P
module-attribute
P = ParamSpec('P')
Parameter specification for tool wrapper callables.
ToolResultT
module-attribute
ToolResultT = TypeVar('ToolResultT')
Type variable for tool result payloads.
with_tool_telemetry
with_tool_telemetry(
*,
task_id: str,
tool_type: str,
operation: str,
error_response: Callable[[str], ToolResultT],
result_summary: Callable[[ToolResultT], dict[str, Any]],
) -> Callable[
[Callable[P, Awaitable[ToolResultT]]],
Callable[P, Awaitable[ToolResultT]],
]
Wrap a tool function with standard telemetry and error handling.
Source code in agent_k/toolsets/kaggle.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | |
kaggle_search_competitions
async
kaggle_search_competitions(
ctx: RunContext[Any],
categories: Annotated[
list[str] | None,
Doc("Competition categories to filter."),
] = None,
keywords: Annotated[
list[str] | None, Doc("Keyword filters for search.")
] = None,
min_prize: Annotated[
int | None,
Doc("Minimum prize pool in USD."),
Range(0, 1000000000),
] = None,
active_only: Annotated[
bool, Doc("Only return active competitions.")
] = True,
) -> list[dict[str, Any]]
Search Kaggle for active competitions.
@notice: | Returns metadata for competitions matching search criteria.
@effects: io: - Kaggle API request state: - in-module cache
Source code in agent_k/toolsets/kaggle.py
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | |
kaggle_get_competition
async
kaggle_get_competition(
ctx: RunContext[Any],
competition_id: Annotated[
str, Doc("Competition identifier (slug).")
],
) -> dict[str, Any]
Get detailed information about a specific Kaggle competition.
@notice: | Fetches competition metadata and caches results.
Source code in agent_k/toolsets/kaggle.py
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | |
kaggle_get_leaderboard
async
kaggle_get_leaderboard(
ctx: RunContext[Any],
competition_id: Annotated[
str, Doc("Competition identifier (slug).")
],
limit: Annotated[
int,
Doc("Maximum entries to return."),
Range(1, 1000),
] = 20,
) -> dict[str, Any]
Get the current leaderboard for a competition.
@notice: | Returns leaderboard entries ordered by rank.
Source code in agent_k/toolsets/kaggle.py
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | |
kaggle_list_datasets
async
kaggle_list_datasets(
ctx: RunContext[Any],
competition_id: Annotated[
str, Doc("Competition identifier (slug).")
],
) -> dict[str, Any]
List available datasets for a competition.
@notice: | Returns file metadata for competition datasets.
Source code in agent_k/toolsets/kaggle.py
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | |