nlp

package
v0.0.0-...-0cfe7c7 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client implements the nlp.NLPer interface.

func New

func New(newSession *session.Session, apiKey, bucketName string) *Client

New generates a pointer instance of Client.

func (*Client) GetAnswer

func (c *Client) GetAnswer(ctx context.Context, question, userID string) (*string, error)

GetAnswer implements the nlp.NLPer.GetAnswer method and generates answers to the provided question using OpenAI.

func (*Client) GetSummary

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

GetSummary implements the nlp.NLPer.GetSummary method and generates a summary of the provided text with OpenAI.

func (*Client) SetDocuments

func (c *Client) SetDocuments(ctx context.Context, documents []dct.Document) error

SetDocuments implements the nlp.NLPer.SetDocuments method and stores the provided slice of structs representing the documents.jsonl file in OpenAI.

type NLPer

type NLPer interface {
	GetSummary(ctx context.Context, text string) (*string, error)
	SetDocuments(ctx context.Context, documents []dct.Document) error
	GetAnswer(ctx context.Context, question, userID string) (*string, error)
}

NLPer defines the methods for interacting with the OpenAI natural language processing API.

Jump to

Keyboard shortcuts

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