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(openai): support passing in traceName #489

Merged
merged 2 commits into from
Dec 16, 2024
Merged

Conversation

hassiebp
Copy link
Contributor

@hassiebp hassiebp commented Dec 16, 2024

Important

Add support for traceName in Langfuse configuration for OpenAI SDK tracing, defaulting to generationName if not provided.

  • Behavior:
    • Support for traceName in LangfuseConfig in observeOpenAI.ts and traceMethod.ts.
    • traceName defaults to generationName if not provided.
  • Types:
    • Add traceName to LangfuseNewTraceConfig in types.ts.
  • Functions:
    • Update observeOpenAI() to include traceName in config.
    • Update wrapMethod() to use traceName for tracing.

This description was created by Ellipsis for 78db7d9. It will automatically update as commits are pushed.

Copy link

vercel bot commented Dec 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
langfuse-js ✅ Ready (Inspect) Visit Preview Dec 16, 2024 10:40am

Copy link

@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.

Disclaimer: Experimental PR review

PR Summary

Adds support for custom trace naming in the OpenAI integration by introducing an optional traceName parameter, allowing more flexible trace identification while maintaining backward compatibility.

  • Added optional traceName property to LangfuseNewTraceConfig type in /langfuse/src/openai/types.ts
  • Modified observeOpenAI function to prioritize traceName from config, falling back to generationName in /langfuse/src/openai/observeOpenAI.ts
  • Updated trace creation in /langfuse/src/openai/traceMethod.ts to use the provided traceName when creating new traces

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

Copy link

@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.

Disclaimer: Experimental PR review

PR Summary

(updates since last review)

No major changes found since last review. The previous review accurately covered the key changes related to the traceName parameter implementation across the relevant files.

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

@hassiebp hassiebp merged commit 21ed800 into main Dec 16, 2024
9 checks passed
@hassiebp hassiebp deleted the fix-openai-tracename branch December 16, 2024 10:48
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.

2 participants