My sample app has been working with the following code:
func call(arguments: Arguments) async throws -> ToolOutput {
var temp:Int
switch arguments.city {
case .singapore: temp = Int.random(in: 30..<40)
case .china: temp = Int.random(in: 10..<30)
}
let content = GeneratedContent(temp)
let output = ToolOutput(content)
return output
}
However in 26 beta 5, ToolOutput no longer available, please advice what has changed.
That's correct! We deprecated ToolOutput
in beta 5, and replaced it with either String
or GeneratedContent
tool output.
For more, see the Tool's doc: https://developer.apple.com/documentation/foundationmodels/tool