// Code generated by Fern. DO NOT EDIT.

package observations

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 observation
func (c *Client) Get(
    ctx context.Context,
    request *api.ObservationsGetRequest,
    opts ...option.RequestOption,
) (*api.ObservationsView, error){
    response, err := c.WithRawResponse.Get(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

// Get a list of observations.
// 
// Consider using the [v2 observations endpoint](/api-reference#tag/observationsv2/GET/api/public/v2/observations) for cursor-based pagination and field selection.
func (c *Client) Getmany(
    ctx context.Context,
    request *api.ObservationsGetManyRequest,
    opts ...option.RequestOption,
) (*api.ObservationsViews, error){
    response, err := c.WithRawResponse.Getmany(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

