Skip to content

Commit 6576006

Browse files
committed
feat: update cookbook
1 parent d3c2da8 commit 6576006

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

docs/arc/04-cookbook/weather.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ agent {
2929
- Use multiple function calls if more locations are specified.
3030
"""
3131
}
32-
tools = listOf("get_weather")
32+
tools {
33+
+"get_weather"
34+
}
3335
}
3436
```
3537

@@ -45,7 +47,8 @@ function(
4547
name = "get_weather",
4648
description = "Returns real-time weather information for any location",
4749
params = types(string("location", "a city to obtain the weather for."))
48-
) { (location) ->
50+
) { (arg) ->
51+
val location = arg.toString() // Type conversion required, because arg can be any type depending on the params definition.
4952
val locationSpecified = location != "unknown" && location?.isNotEmpty() == true
5053
val locationToUse = if (locationSpecified) location else memory("weather_location")
5154
if (locationToUse == null) {

0 commit comments

Comments
 (0)