Skip to content

OpenAI wrapper should warn on fallback wrapper #614

@kcarnold

Description

@kcarnold

We had code that was using openai.chat.completions.parse (notice, not .beta). This was silently hitting the fallback __getattr__ in the OpenAI wrappers (e.g.,

return getattr(self._original, name)
and similar patterns throughout that file). That meant that we were at best not logging those endpoints, and at worst crashing when we were trying to pass posthog_distinct_id etc. to it.

I'm not sure what the right behavior is, but the silent fallback bit us and led to crashes.

(Should I open a second bug for openai.chat.completions.parse not being wrapped?)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    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