// Code generated by Fern. DO NOT EDIT.

package observationsv2

import (
    core "pentagi/pkg/observability/langfuse/api/core"
    internal "pentagi/pkg/observability/langfuse/api/internal"
    context "context"
    api "pentagi/pkg/observability/langfuse/api"
    option "pentagi/pkg/observability/langfuse/api/option"
)


type Client struct {
    WithRawResponse *RawClient

    options *core.RequestOptions
    baseURL string
    caller *internal.Caller
}

func NewClient(options *core.RequestOptions) *Client {
    return &Client{
        WithRawResponse: NewRawClient(options),
        options: options,
        baseURL: options.BaseURL,
        caller: internal.NewCaller(
            &internal.CallerParams{
                Client: options.HTTPClient,
                MaxAttempts: options.MaxAttempts,
            },
        ),
    }
}

// Get a list of observations with cursor-based pagination and flexible field selection.
// 
// ## Cursor-based Pagination
// This endpoint uses cursor-based pagination for efficient traversal of large datasets.
// The cursor is returned in the response metadata and should be passed in subsequent requests
// to retrieve the next page of results.
// 
// ## Field Selection
// Use the `fields` parameter to control which observation fields are returned:
// - `core` - Always included: id, traceId, startTime, endTime, projectId, parentObservationId, type
// - `basic` - name, level, statusMessage, version, environment, bookmarked, public, userId, sessionId
// - `time` - completionStartTime, createdAt, updatedAt
// - `io` - input, output
// - `metadata` - metadata (truncated to 200 chars by default, use `expandMetadata` to get full values)
// - `model` - providedModelName, internalModelId, modelParameters
// - `usage` - usageDetails, costDetails, totalCost
// - `prompt` - promptId, promptName, promptVersion
// - `metrics` - latency, timeToFirstToken
// 
// If not specified, `core` and `basic` field groups are returned.
// 
// ## Filters
// Multiple filtering options are available via query parameters or the structured `filter` parameter.
// When using the `filter` parameter, it takes precedence over individual query parameter filters.
func (c *Client) Getmany(
    ctx context.Context,
    request *api.ObservationsV2GetManyRequest,
    opts ...option.RequestOption,
) (*api.ObservationsV2Response, error){
    response, err := c.WithRawResponse.Getmany(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

