// Code generated by Fern. DO NOT EDIT.

package metrics

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 metrics from the Langfuse project using a query object.
// 
// Consider using the [v2 metrics endpoint](/api-reference#tag/metricsv2/GET/api/public/v2/metrics) for better performance.
// 
// For more details, see the [Metrics API documentation](https://langfuse.com/docs/metrics/features/metrics-api).
func (c *Client) Metrics(
    ctx context.Context,
    request *api.MetricsMetricsRequest,
    opts ...option.RequestOption,
) (*api.MetricsResponse, error){
    response, err := c.WithRawResponse.Metrics(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

