chatgpt

package
v1.10.4 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatGPT

type ChatGPT struct {
	C chan map[int64]string
	// contains filtered or unexported fields
}

func NewChatGPT

func NewChatGPT() *ChatGPT

func (*ChatGPT) Ask

func (t *ChatGPT) Ask(id int64, msg string)

type ChatGPTRequest

type ChatGPTRequest struct {
	Model    string     `json:"model"`
	Messages []*Message `json:"messages"`
}

type ChatGPTResponse

type ChatGPTResponse struct {
	ID      string   `json:"id"`
	Object  string   `json:"object"`
	Created int64    `json:"created"`
	Choices []Choice `json:"choices"`
}

type Choice

type Choice struct {
	Index        int     `json:"index"`
	Message      Message `json:"message"`
	FinishReason string  `json:"finish_reason"`
}

type Message

type Message struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

Jump to

Keyboard shortcuts

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