feat(api): update API spec from langfuse/langfuse 3dbec46 #1479
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Important
Add new V2 endpoints for metrics and observations with optimized performance and new features.
metrics_v_2andobservations_v_2modules with optimized performance.MetricsV2ClientandAsyncMetricsV2Clientinmetrics_v_2/client.py.ObservationsV2ClientandAsyncObservationsV2Clientinobservations_v_2/client.py.MetricsV2Responseinmetrics_v_2/types/metrics_v_2_response.py.ObservationsV2ResponseandObservationsV2Metainobservations_v_2/types/.__init__.pyfiles to include new modules and response types.This description was created by
for 49ca980. You can customize this summary. It will automatically update as commits are pushed.
Disclaimer: Experimental PR review
Greptile Summary
Auto-generated API client update adding V2 endpoints for metrics and observations with optimized performance and new features.
Key Changes:
MetricsV2Clientwith optimized query endpoint supporting observations, scores-numeric, and scores-categorical viewsObservationsV2Clientwith cursor-based pagination and flexible field selection viaget_manymethodMetricsV2Response,ObservationsV2Response, andObservationsV2MetaFernLangfuseandAsyncFernLangfuse) to includemetrics_v_2andobservations_v_2attributesConfidence Score: 5/5
Important Files Changed
metrics_v_2andobservations_v_2client attributes to both sync and async clientsget_manyendpointSequence Diagram
sequenceDiagram participant Client participant FernLangfuse participant MetricsV2Client participant ObservationsV2Client participant HTTPClient participant API Note over Client,API: Initialize Client Client->>FernLangfuse: __init__(credentials) FernLangfuse->>MetricsV2Client: Initialize metrics_v_2 FernLangfuse->>ObservationsV2Client: Initialize observations_v_2 Note over Client,API: V2 Metrics Query Client->>FernLangfuse: client.metrics_v_2.metrics(query) FernLangfuse->>MetricsV2Client: metrics(query) MetricsV2Client->>HTTPClient: GET /api/public/v2/metrics HTTPClient->>API: Request with query params API-->>HTTPClient: JSON Response HTTPClient-->>MetricsV2Client: Response data MetricsV2Client-->>FernLangfuse: MetricsV2Response FernLangfuse-->>Client: MetricsV2Response(data) Note over Client,API: V2 Observations Query Client->>FernLangfuse: client.observations_v_2.get_many(filters) FernLangfuse->>ObservationsV2Client: get_many(fields, cursor, filters) ObservationsV2Client->>HTTPClient: GET /api/public/v2/observations HTTPClient->>API: Request with query params API-->>HTTPClient: JSON Response HTTPClient-->>ObservationsV2Client: Response data ObservationsV2Client-->>FernLangfuse: ObservationsV2Response FernLangfuse-->>Client: ObservationsV2Response(data, meta) Note over Client,API: Cursor-based Pagination Client->>FernLangfuse: client.observations_v_2.get_many(cursor=meta.cursor) FernLangfuse->>ObservationsV2Client: get_many(cursor) ObservationsV2Client->>HTTPClient: GET /api/public/v2/observations?cursor=... HTTPClient->>API: Request with cursor API-->>HTTPClient: Next page HTTPClient-->>ObservationsV2Client: Response data ObservationsV2Client-->>FernLangfuse: ObservationsV2Response FernLangfuse-->>Client: ObservationsV2Response(next_page_data, meta)