/
config.go
34 lines (29 loc) · 951 Bytes
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package service
import (
"context"
"github.com/blang/vfs"
)
type PromptConfig struct {
ChatMessages *ChatMessages
PreviousPrompt string
UserPrompt string
UpdateChan chan *ChatMessage
Contexts IContextService
Files IFileService
}
type IContextService interface {
AddContext(ctx context.Context, cancelFn func())
AddContextWithId(ctx context.Context, cancelFn func(), id int64)
CloseContext(ctx context.Context) error
FindContextWithId(id int64) *ContextHolder
CloseContextById(id int64) error
Length() int
}
type IFileService interface {
Append(fileType FileType, msgContent string, originalFileName string, msgId int64, data []byte) (*FileMetadata, error)
Delete(id string) error
Get(id string) (vfs.File, *FileMetadata, error)
GetByMsgId(id int64, fileType FileType) (vfs.File, *FileMetadata, error)
List(fileType FileType) ([]FileMetadata, error)
SaveToOS(id string, destinationPath string) error
}