chat

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterSchema

func RegisterSchema(scaled *config.Scaled, server *server.Server) error

Types

type Chat

type Chat struct {
	// ID of the database.
	ID string `json:"id,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// UserId holds the value of the "userId" field.
	UserId string `json:"userId,omitempty"`
	// Models holds the value of the "models" field.
	Models []string `json:"models,omitempty"`
	// Tags holds the value of the "tags" field.
	Tags []string `json:"tags,omitempty"`
	// History holds the value of the "history" field.
	History typev1.History `json:"history,omitempty"`
	// Messages holds the value of the "messages" field.
	Messages []typev1.Message `json:"messages,omitempty"`
	// CreatedAt holds the value of the "createdAt" field.
	CreatedAt time.Time `json:"createdAt,omitempty"`
}

type Handler

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

func NewHandler

func NewHandler(mgmt *config.Management) Handler

func (*Handler) Create

func (h *Handler) Create(uid string, req NewChatRequest) (*entv1.Chat, error)

func (*Handler) Delete

func (h *Handler) Delete(id string) error

func (*Handler) FindByID

func (h *Handler) FindByID(id, userId string) (*entv1.Chat, error)

func (*Handler) ListAll

func (h *Handler) ListAll() (entv1.Chats, error)

func (*Handler) ListByUser

func (h *Handler) ListByUser(uid string) ([]*entv1.Chat, error)

func (*Handler) Update

func (h *Handler) Update(id string, req UpdateChatRequest) (*entv1.Chat, error)

type NewChatRequest

type NewChatRequest struct {
	History  typev1.History   `json:"history"`
	Messages []typev1.Message `json:"messages"`
	Models   []string         `json:"models,omitempty"`
	Title    string           `json:"title,omitempty"`
	Tags     []string         `json:"tags,omitempty"`
}

type Store

type Store struct {
	empty.Store
	// contains filtered or unexported fields
}

func (*Store) ByID

func (s *Store) ByID(apiOp *types.APIRequest, schema *types.APISchema, id string) (types.APIObject, error)

func (*Store) Create

func (s *Store) Create(apiOp *types.APIRequest, schema *types.APISchema, data types.APIObject) (types.APIObject, error)

func (*Store) Delete

func (s *Store) Delete(apiOp *types.APIRequest, schema *types.APISchema, id string) (types.APIObject, error)

func (*Store) HasEntClient

func (s *Store) HasEntClient() bool

func (*Store) List

func (s *Store) List(apiOp *types.APIRequest, schema *types.APISchema) (types.APIObjectList, error)

func (*Store) Update

func (s *Store) Update(apiOp *types.APIRequest, schema *types.APISchema, data types.APIObject, id string) (types.APIObject, error)

type UpdateChatRequest

type UpdateChatRequest struct {
	Title    string           `json:"title"`
	History  typev1.History   `json:"history"`
	Messages []typev1.Message `json:"messages,omitempty"`
	UserId   string           `json:"userId"`
}

Jump to

Keyboard shortcuts

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