Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: types did not allow openai config vars even though code passes t… #394

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LukFil
Copy link

@LukFil LukFil commented Feb 14, 2025

Problem

OpenAI wrapper does not accept OpenAI config on the type level, even though code passes them correctly.

Changes

Made MonitoringOpenAIConfig extend ClientOptions of OpenAI.

Release info Sub-libraries affected

Bump level

  • Major
  • Minor
  • Patch

Libraries affected

  • All of them
  • posthog-web
  • posthog-node
  • posthog-ai
  • posthog-react-native

Changelog notes

  • Synced types for OpenAI client with code.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR extends OpenAI configuration types to properly support all OpenAI client options while maintaining type safety in the PostHog AI wrapper.

  • Extended MonitoringOpenAIConfig interface in /posthog-ai/src/openai/index.ts to inherit from OpenAI's ClientOptions type
  • Redundant apiKey and baseURL declarations in MonitoringOpenAIConfig should be removed since they're already in ClientOptions
  • Type casting of baseURL to (this as any).baseURL should be refactored to maintain type safety

💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant