Files
Toni Klopfenstein 27e1303857 Kotlin snippets fixes (#1770)
* Migrating from Map to typed data classes in FuncTool and LongRunningTool kotlin examples

* lint cleanup of kotlin snippets

* adding gradle wrapper for kotlin snippets

* cleaning up build file for kotlin

* fixing ktlint_code_style, added focus on included Gradle Wrapper

---------

Co-authored-by: Kristopher Overholt <koverholt@google.com>
2026-05-19 15:29:44 -05:00

21 lines
609 B
Kotlin

package com.google.adk.kt.examples.tools
import com.google.adk.kt.annotations.Param
import com.google.adk.kt.annotations.Tool
// --8<-- [start:required_params]
class WeatherService {
/**
* Retrieves the weather for a city in the specified unit.
*/
@Tool
fun getWeather(
@Param("The city and state, e.g., San Francisco, CA") location: String,
@Param("The temperature unit, either 'Celsius' or 'Fahrenheit'") unit: String,
): String {
// ... function logic ...
return "Weather for $location is sunny in $unit."
}
}
// --8<-- [end:required_params]