Skip to content

weakRef error regarding the api_key when using chat_portkey() #588

Description

@JsizzleR

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions