openai

package
v0.0.0-...-54b38c5 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidResponse = errors.New("invalid response")
	ErrInvalidResult   = errors.New("invalid result")
	ErrBadGateway      = errors.New("bad gateway")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(apiKey string, log *slog.Logger) *Client

func (*Client) NER

func (c *Client) NER(ctx context.Context, text string) (article.NER, error)

NER uses the openAI api to perform named entity recognition of the given text. The returned entity types are person, location and organisation.

func (*Client) Summarize

func (c *Client) Summarize(ctx context.Context, text string) (string, error)

Summarize uses the openAI api to perform a summarization of the given text.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳