Documentation
¶
Index ¶
- type ChatApp
- type ChatResponse
- type ChatService
- func (cs *ChatService) ClearEntries() error
- func (cs *ChatService) ClearEntriesByTopic(name string) error
- func (cs *ChatService) CreateThread(t *Thread) error
- func (cs *ChatService) CreateTopic(t *ChatTopic) error
- func (cs *ChatService) DeleteThread(ID uuid.UUID) error
- func (cs *ChatService) DeleteTopic(ID uuid.UUID) error
- func (cs *ChatService) GetChatResponse(ID string) (*ChatResponse, error)
- func (cs *ChatService) GetThread(ID uuid.UUID) (*Thread, error)
- func (cs *ChatService) GetTopic(ID uuid.UUID) (*ChatTopic, error)
- func (cs *ChatService) ListChatResponses() ([]*ChatResponse, error)
- func (cs *ChatService) ListThreads() ([]*Thread, error)
- func (cs *ChatService) ListTopics() ([]*ChatTopic, error)
- func (cs *ChatService) NewChatApp(client *http.Client, chatService *ChatService, scanner *bufio.Scanner, ...) (*ChatApp, error)
- func (cs *ChatService) SaveChatResponse(cr *ChatResponse) error
- func (cs *ChatService) UpdateThread(ID uuid.UUID, t *Thread) error
- func (cs *ChatService) UpdateTopic(ID uuid.UUID, t *ChatTopic) error
- type ChatStore
- type ChatTopic
- type Entry
- type Message
- type OResponse
- type PPLXChatStore
- type Primer
- type Response
- type StromRepo
- func (sr *StromRepo) ClearEntries() error
- func (sr *StromRepo) ClearEntriesByTopic(name string) error
- func (sr *StromRepo) CreateThread(t *Thread) error
- func (sr *StromRepo) CreateTopic(t *ChatTopic) error
- func (sr *StromRepo) DeleteThread(ID uuid.UUID) error
- func (sr *StromRepo) DeleteTopic(ID uuid.UUID) error
- func (sr *StromRepo) GetChatResponse(ID string) (*ChatResponse, error)
- func (sr *StromRepo) GetThread(ID uuid.UUID) (*Thread, error)
- func (sr *StromRepo) GetTopic(ID uuid.UUID) (*ChatTopic, error)
- func (sr *StromRepo) ListChatResponses() ([]*ChatResponse, error)
- func (sr *StromRepo) ListThreads() ([]*Thread, error)
- func (sr *StromRepo) ListTopics() ([]*ChatTopic, error)
- func (sr *StromRepo) SaveChatResponse(cr *ChatResponse) error
- func (sr *StromRepo) UpdateThread(ID uuid.UUID, t *Thread) error
- func (sr *StromRepo) UpdateTopic(ID uuid.UUID, t *ChatTopic) error
- type TEntry
- type TResponse
- type Thread
- type Topic
- type TopicStore
- func (ts *TopicStore) Close() error
- func (ts *TopicStore) RetrieveEntries() ([]TEntry, error)
- func (ts *TopicStore) RetrieveEntriesByTopic(topic string) ([]TEntry, error)
- func (ts *TopicStore) RetrieveTopicByName(name string) (Topic, error)
- func (ts *TopicStore) RetrieveTopics() ([]Topic, error)
- func (ts *TopicStore) SaveEntry(userInput string, aiResponse TResponse, topic Topic) error
- func (ts *TopicStore) SaveTopic(name string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatApp ¶
type ChatResponse ¶
type ChatResponse struct {
ID string `json:"id"`
Model string `json:"model"`
Time string `json:"time"`
UserQuery Message `json:"user_query"`
Object string `json:"object"`
Topic *ChatTopic `json:"topic"`
}
ChatResponse to be received and stored
type ChatService ¶
type ChatService struct {
ChatApp *ChatApp
// contains filtered or unexported fields
}
func NewChatService ¶
func NewChatService(cs PPLXChatStore) *ChatService
func (*ChatService) ClearEntries ¶
func (cs *ChatService) ClearEntries() error
func (*ChatService) ClearEntriesByTopic ¶
func (cs *ChatService) ClearEntriesByTopic(name string) error
func (*ChatService) CreateThread ¶
func (cs *ChatService) CreateThread(t *Thread) error
func (*ChatService) CreateTopic ¶
func (cs *ChatService) CreateTopic(t *ChatTopic) error
func (*ChatService) DeleteThread ¶
func (cs *ChatService) DeleteThread(ID uuid.UUID) error
func (*ChatService) DeleteTopic ¶
func (cs *ChatService) DeleteTopic(ID uuid.UUID) error
func (*ChatService) GetChatResponse ¶
func (cs *ChatService) GetChatResponse(ID string) (*ChatResponse, error)
func (*ChatService) ListChatResponses ¶
func (cs *ChatService) ListChatResponses() ([]*ChatResponse, error)
func (*ChatService) ListThreads ¶
func (cs *ChatService) ListThreads() ([]*Thread, error)
func (*ChatService) ListTopics ¶
func (cs *ChatService) ListTopics() ([]*ChatTopic, error)
func (*ChatService) NewChatApp ¶
func (cs *ChatService) NewChatApp(client *http.Client, chatService *ChatService, scanner *bufio.Scanner, apiKey string, models []string) (*ChatApp, error)
func (*ChatService) SaveChatResponse ¶
func (cs *ChatService) SaveChatResponse(cr *ChatResponse) error
func (*ChatService) UpdateThread ¶
func (cs *ChatService) UpdateThread(ID uuid.UUID, t *Thread) error
func (*ChatService) UpdateTopic ¶
func (cs *ChatService) UpdateTopic(ID uuid.UUID, t *ChatTopic) error
type ChatStore ¶
type ChatStore struct {
// contains filtered or unexported fields
}
func NewChatStore ¶
func (*ChatStore) ClearEntries ¶
func (*ChatStore) RetrieveEntries ¶
type ChatTopic ¶
type ChatTopic struct {
ID uuid.UUID `'json:"id"`
Name string `'json:"name"`
Description string `'json:"description"`
Threads []Thread `'json:"threads"`
}
func NewChatTopic ¶
type Message ¶
type Message struct {
ID uuid.UUID
Model string
Primer Primer
Temprature float64
TopP float64
FreqPen float64
Stream bool
Query string
}
Message is the message to be sent to the chatbot
func NewMessage ¶
type PPLXChatStore ¶
type PPLXChatStore interface {
CreateThread(t *Thread) error
GetThread(ID uuid.UUID) (*Thread, error)
ListThreads() ([]*Thread, error)
UpdateThread(ID uuid.UUID, t *Thread) error
DeleteThread(ID uuid.UUID) error
CreateTopic(t *ChatTopic) error
GetTopic(ID uuid.UUID) (*ChatTopic, error)
ListTopics() ([]*ChatTopic, error)
DeleteTopic(ID uuid.UUID) error
UpdateTopic(ID uuid.UUID, t *ChatTopic) error
SaveChatResponse(cr *ChatResponse) error
GetChatResponse(ID string) (*ChatResponse, error)
ListChatResponses() ([]*ChatResponse, error)
ClearEntries() error
ClearEntriesByTopic(name string) error
}
type Response ¶
type Response struct {
ID string `json:"id"`
Model string `json:"model"`
Created string `json:"created"`
Object string `json:"object"`
Choices []struct {
Message struct {
Role string `json:"role"`
Content string `json:"content"`
} `json:"message"`
FinishReason string `json:"finish_reason"`
} `json:"choices"`
}
type StromRepo ¶
type StromRepo struct {
// contains filtered or unexported fields
}
func NewStromRepo ¶
func (*StromRepo) ClearEntries ¶
func (*StromRepo) ClearEntriesByTopic ¶
func (*StromRepo) CreateThread ¶
func (*StromRepo) CreateTopic ¶
func (*StromRepo) GetChatResponse ¶
func (sr *StromRepo) GetChatResponse(ID string) (*ChatResponse, error)
func (*StromRepo) ListChatResponses ¶
func (sr *StromRepo) ListChatResponses() ([]*ChatResponse, error)
func (*StromRepo) ListThreads ¶
func (*StromRepo) ListTopics ¶
func (*StromRepo) SaveChatResponse ¶
func (sr *StromRepo) SaveChatResponse(cr *ChatResponse) error
type TopicStore ¶
type TopicStore struct {
// contains filtered or unexported fields
}
func NewTopicStore ¶
func NewTopicStore(dbPath string) (*TopicStore, error)
func (*TopicStore) Close ¶
func (ts *TopicStore) Close() error
func (*TopicStore) RetrieveEntries ¶
func (ts *TopicStore) RetrieveEntries() ([]TEntry, error)
func (*TopicStore) RetrieveEntriesByTopic ¶
func (ts *TopicStore) RetrieveEntriesByTopic(topic string) ([]TEntry, error)
func (*TopicStore) RetrieveTopicByName ¶
func (ts *TopicStore) RetrieveTopicByName(name string) (Topic, error)
func (*TopicStore) RetrieveTopics ¶
func (ts *TopicStore) RetrieveTopics() ([]Topic, error)
func (*TopicStore) SaveEntry ¶
func (ts *TopicStore) SaveEntry(userInput string, aiResponse TResponse, topic Topic) error
func (*TopicStore) SaveTopic ¶
func (ts *TopicStore) SaveTopic(name string) error
Click to show internal directories.
Click to hide internal directories.