Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix(cost-tracking): handle none values in OpenAI schema #1152

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

Merged
merged 1 commit into from
Mar 24, 2025

Conversation

hassiebp
Copy link
Contributor

@hassiebp hassiebp commented Mar 24, 2025

Important

Add annotation queue handling and update OpenAI schema to handle None values in token details.

  • Annotation Queues:
    • Added AnnotationQueuesClient and AsyncAnnotationQueuesClient in client.py.
    • Introduced new types: AnnotationQueue, AnnotationQueueItem, AnnotationQueueObjectType, AnnotationQueueStatus, CreateAnnotationQueueItemRequest, DeleteAnnotationQueueItemResponse, PaginatedAnnotationQueueItems, PaginatedAnnotationQueues, UpdateAnnotationQueueItemRequest.
    • Updated README.md and reference.md with usage examples for new annotation queue methods.
  • OpenAI Schema:
    • Updated OpenAiCompletionUsageSchema and OpenAiResponseUsageSchema to handle None values in token details.
  • Miscellaneous:
    • Updated imports in __init__.py files to include new annotation queue types.

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

Greptile Summary

Disclaimer: Experimental PR review

This PR adds annotation queue functionality and fixes OpenAI usage schema to handle null values in token details, improving cost tracking accuracy and data handling capabilities.

  • Added comprehensive annotation queue support in /langfuse/api/resources/annotation_queues/ with client implementations, models, and types
  • Modified OpenAiResponseUsageSchema and OpenAiCompletionUsageSchema in /langfuse/api/resources/ingestion/types/ to handle optional token details
  • Added new AnnotationQueue and AnnotationQueueItem Pydantic models with proper null handling and datetime serialization
  • Added enum types AnnotationQueueObjectType and AnnotationQueueStatus for type-safe queue item handling
  • Updated API documentation in /langfuse/api/reference.md with detailed examples and parameter specifications

@hassiebp hassiebp linked an issue Mar 24, 2025 that may be closed by this pull request
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.

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

@hassiebp hassiebp merged commit 66f02cb into main Mar 24, 2025
7 of 10 checks passed
@hassiebp hassiebp deleted the hassieb/lfe-4431-openai-usage-schema-null-handling branch March 24, 2025 12:42
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: Error in logs while using langfuse tracing
1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.