Skip to content

Conversation

@hassiebp
Copy link
Contributor

@hassiebp hassiebp commented Feb 28, 2025

Important

Fixes default value in _extract_streamed_openai_response to prevent None from being appended to completion string in openai.py.

  • Behavior:
    • Fixes default value in _extract_streamed_openai_response in openai.py by changing choice.get("text", None) to choice.get("text", "") to prevent None from being appended to completion string.

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


Greptile Summary

Disclaimer: Experimental PR review

This PR adds native environment support across the Langfuse Python SDK, enabling better organization and filtering of telemetry data.

  • Added optional environment field to core data models (Trace, Observation, Score) with consistent validation rules
  • Implemented environment parameter in client initialization with support for both constructor parameter and LANGFUSE_TRACING_ENVIRONMENT environment variable
  • Added environment propagation through all integrations (LangChain, LlamaIndex, OpenAI)
  • Added comprehensive test coverage for environment setting via constructor and environment variables
  • Fixed a bug in OpenAI integration where empty text responses were handled incorrectly

@hassiebp hassiebp force-pushed the hassieb/lfe-3984-fix-completion-stream branch from 23daf2c to df9d180 Compare February 28, 2025 10:57
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.

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

@hassiebp hassiebp changed the title feat(client): add native environment support fix(openai): handle missing text property on streamed completion Feb 28, 2025
@hassiebp hassiebp enabled auto-merge (squash) February 28, 2025 10:58
@hassiebp hassiebp linked an issue Feb 28, 2025 that may be closed by this pull request
@hassiebp hassiebp disabled auto-merge February 28, 2025 11:12
@hassiebp hassiebp merged commit d7d47be into main Feb 28, 2025
6 of 10 checks passed
@hassiebp hassiebp deleted the hassieb/lfe-3984-fix-completion-stream branch February 28, 2025 11:12
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.

bug: Unable to capture output for openai stream=True

2 participants