infrastructure

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConverDO

func ConverDO(ch *Chat, cs ...*Conversation) (*domain.Chat, error)

func NewChatGTPServer

func NewChatGTPServer(client *openai.Client) domain.ChatGTPService

func NewRepository

func NewRepository(db *sqlx.DB) domain.Repository

Types

type Chat

type Chat struct {
	ID            string    `db:"id"`
	Counts        int       `db:"counts"`
	Current       string    `db:"current"`
	Channel       int       `db:"channel"`
	ChannelUserID string    `db:"channel_user_id"`
	Version       int       `db:"version"`
	CTime         time.Time `db:"ctime"`
	MTime         time.Time `db:"mtime"`
	Deleted       int       `db:"deleted"`
}

func ConvertEntityChat

func ConvertEntityChat(entity *domain.Chat) (*Chat, error)

type Conversation

type Conversation struct {
	ID               sql.NullInt32  `db:"id"`
	ChatID           sql.NullString `db:"chat_id"`
	Prompt           sql.NullString `db:"prompt"`
	Completion       sql.NullString `db:"completion"`
	ChannelMessageID sql.NullString `db:"channel_message_id"`
	CTime            sql.NullTime   `db:"ctime"`
	MTime            sql.NullTime   `db:"mtime"`
}

Jump to

Keyboard shortcuts

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