Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

nimarb
Copy link
Contributor

@nimarb nimarb commented Aug 15, 2025

Important

This PR updates the Langfuse Python client with new LLM connections management and enhanced annotation queues, adding new modules, models, and client methods for both sync and async operations.

  • LLM Connections Management:
    • New module llm_connections for managing LLM provider connections (OpenAI, Anthropic, Azure, etc.).
    • Adds LlmAdapter, LlmConnection, PaginatedLlmConnections, UpsertLlmConnectionRequest in llm_connections/types.
    • Implements list() and upsert() methods in llm_connections/client.py for sync and async clients.
  • Enhanced Annotation Queues:
    • Adds CreateAnnotationQueueRequest, AnnotationQueueAssignmentRequest, CreateAnnotationQueueAssignmentResponse, DeleteAnnotationQueueAssignmentResponse in annotation_queues/types.
    • Implements create_queue(), create_queue_assignment(), delete_queue_assignment() in annotation_queues/client.py for sync and async clients.
  • Miscellaneous:
    • Updates MapValue in commons/types/map_value.py to remove float type.
    • Fixes import paths and logical issues in test files (not detailed here).

This description was created by Ellipsis for 3469dcd. You can customize this summary. It will automatically update as commits are pushed.


Disclaimer: Experimental PR review

Greptile Summary

This PR represents a comprehensive auto-generated SDK update that adds significant new functionality to the Langfuse Python client. The changes introduce two major feature areas:

1. LLM Connections Management: A complete new module (langfuse/api/resources/llm_connections/) has been added to enable users to manage connections to various LLM providers (OpenAI, Anthropic, Azure, Bedrock, Google Vertex AI, and Google AI Studio). This includes models for connection configuration, pagination, and upsert operations, along with both sync and async client implementations.

2. Enhanced Annotation Queues: The existing annotation queues functionality has been expanded with new capabilities for queue creation and user assignment management. This includes new request/response models for creating annotation queues directly and managing user assignments within queues.

3. Observation Type Expansion: The observe decorator has been enhanced to support specialized observation types (Agent, Tool, Chain, Retriever, Evaluator, Embedding, Guardrail) beyond the existing Span and Generation types, enabling more granular categorization of AI operations.

The changes follow the established auto-generated patterns throughout the codebase, maintaining consistency in error handling, serialization, and API client structure. All new functionality is exposed through both synchronous and asynchronous client interfaces, and comprehensive API reference documentation has been updated to reflect the new capabilities.

Confidence score: 2/5

  • This PR has critical issues that will cause immediate failures and should not be merged without fixes
  • Score lowered due to broken import paths in test files and a logical flaw in the LlmAdapter enum that will cause runtime errors
  • Pay close attention to langfuse/api/tests/utils/test_http_client.py, langfuse/api/tests/utils/test_query_encoding.py, and langfuse/api/resources/llm_connections/types/llm_adapter.py

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.

22 files reviewed, 1 comment

Edit Code Review Bot Settings | Greptile

@nimarb nimarb merged commit fa5346c into nimar/lfe-6153-generalized-graphs-python Aug 22, 2025
1 check passed
@nimarb nimarb deleted the nimar/update-api-client-pythong branch August 22, 2025 09:09
nimarb added a commit that referenced this pull request Aug 22, 2025
* init commit

* Use as_type

* clean

* cleanup

* cleanup

* todo clarifty case sensitivity

* format

* revert

* add test

* lower case

* fix lint

* format

* types

* cleanup

* fix test

* update

* update

* fix cases

* fix some more types

* update SDK

* fix types

* add type checing isntructions

* restore

* restore 2

* restore

* restore 3

* simplify

* simplift

* simplify

* fix case

* rearrange spans

* restrucure a bit

* cleanup

* make mypy happy

* py3.9 compat

* happy mypy

* cleanup

* a bit more clean

* cleanup

* overload all the things

* overload

* rename spanwrapper to observation wrapper

* don't update events

* fix test

* fix span

* fix test

* langchain

* formatting

* add langchain test

* add core test

* cleanup

* add deprecation warning

* fix types

* change generation like and span like

* fix

* test format

* from review

* format

* add generation-like test

* chore: update auto gen SDK (#1300)

* unrelated changes to generated sdk

* also readme

* reset

* revert

* revert

* fix lint

* fix tests

* embedding correct attrs

* fix typing

* fix bug

* fix mypy
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