library(elmer)
chat <- chat_claude()
spec <- type_object(
age = type_number(),
name = type_string()
)
chat$extract_data(
"My name is Susan and I'm 13 years old",
spec = spec
)
#> $name
#> [1] "Susan"
#>
#> $age
#> [1] 13
chat$extract_data(
"My name is Susan and I'm 13 years old",
spec = spec
)
#> Error: Can't find method for generic `as_json(provider, x)`:
#> - provider: <elmer::ProviderClaude>
#> - x : <elmer::ContentJson>
Created on 2024-10-31 with reprex v2.1.1