This error is received despite several attempts to workaround it using as.character() or str():
@api_key must be <NULL> or <character>, not <weakref>
> library(ellmer)
> Sys.setenv(PORTKEY_API_KEY="asdf")
> chat_portkey()
Using model = "gpt-4o".
Error: <ellmer::ProviderPortkeyAI> object properties are invalid:
- @api_key must be <NULL> or <character>, not <weakref>
The error still occurs when setting the PORTKEY_API_KEY in a .Renviron, or if supplying it directly in the chat_portkey() function with api_key="value".
Thanks for reviewing!
This error is received despite several attempts to workaround it using as.character() or str():
@api_key must be <NULL> or <character>, not <weakref>The error still occurs when setting the PORTKEY_API_KEY in a .Renviron, or if supplying it directly in the chat_portkey() function with api_key="value".
Thanks for reviewing!