// Code generated by Fern. DO NOT EDIT.

package prompts

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

// Delete prompt versions. If neither version nor label is specified, all versions of the prompt are deleted.
func (c *Client) Delete(
    ctx context.Context,
    request *api.PromptsDeleteRequest,
    opts ...option.RequestOption,
) error{
    _, err := c.WithRawResponse.Delete(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return err
    }
    return nil
}

// Get a list of prompt names with versions and labels
func (c *Client) List(
    ctx context.Context,
    request *api.PromptsListRequest,
    opts ...option.RequestOption,
) (*api.PromptMetaListResponse, error){
    response, err := c.WithRawResponse.List(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

// Create a new version for the prompt with the given `name`
func (c *Client) Create(
    ctx context.Context,
    request *api.CreatePromptRequest,
    opts ...option.RequestOption,
) (*api.Prompt, error){
    response, err := c.WithRawResponse.Create(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

