openai

package
v0.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

openai implements an API client for OpenAI https://platform.openai.com/docs/api-reference

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*client.Client
}

func New

func New(apiKey string, opts ...client.ClientOpt) (*Client, error)

New creates a new OpenAI API client with the given API key

func (*Client) GetModel

func (c *Client) GetModel(ctx context.Context, name string) (*schema.Model, error)

GetModel returns the model with the given name

func (*Client) ListModels

func (c *Client) ListModels(ctx context.Context) ([]schema.Model, error)

ListModels returns the list of available models

func (*Client) Name

func (*Client) Name() string

Name returns the provider name

func (*Client) Ping

func (*Client) Ping(ctx context.Context) error

Ping checks the connectivity of the client and returns an error if not successful

func (*Client) Self

func (c *Client) Self() llm.Client

Self returns the underlying client implementation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL