Documentation
¶
Index ¶
- type ConversationDTO
- type Dao
- func (d *Dao) DeleteConversation(ctx context.Context, id string) error
- func (d *Dao) DeleteMessage(ctx context.Context, id string) error
- func (d *Dao) GetConversation(ctx context.Context, id string) (llm.Conversation, error)
- func (d *Dao) GetConversationLastMessage(ctx context.Context, id string) (llm.Message, error)
- func (d *Dao) GetMessage(ctx context.Context, id string) (llm.Message, error)
- func (d *Dao) ListConversations(ctx context.Context) ([]llm.Conversation, error)
- func (d *Dao) ListMessages(ctx context.Context, conversationId string) ([]llm.Message, error)
- func (d *Dao) SaveConversation(ctx context.Context, conversation llm.Conversation) (llm.Conversation, error)
- func (d *Dao) SaveMessage(ctx context.Context, message llm.Message) (llm.Message, error)
- type MessageDTO
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConversationDTO ¶
type ConversationDTO struct { dtoutils.BaseModel UserId string `json:"user_id" db:"user_id"` Name string `json:"name,omitempty" db:"name"` Model string `json:"model,omitempty" db:"model"` Summary string `json:"summary,omitempty" db:"summary"` ExtraInfo string `json:"extra_info,omitempty" db:"extra_info"` }
func (*ConversationDTO) FromLLMConversation ¶
func (c *ConversationDTO) FromLLMConversation(conversation llm.Conversation)
func (ConversationDTO) TableName ¶
func (c ConversationDTO) TableName() string
func (ConversationDTO) ToLLMConversation ¶
func (c ConversationDTO) ToLLMConversation() llm.Conversation
type Dao ¶
type Dao struct {
// contains filtered or unexported fields
}
func (*Dao) DeleteConversation ¶
func (*Dao) GetConversation ¶
func (*Dao) GetConversationLastMessage ¶
func (*Dao) GetMessage ¶
func (*Dao) ListConversations ¶
func (*Dao) ListMessages ¶
func (*Dao) SaveConversation ¶
func (d *Dao) SaveConversation(ctx context.Context, conversation llm.Conversation) (llm.Conversation, error)
type MessageDTO ¶
type MessageDTO struct { dtoutils.BaseModel UserId string `json:"user_id" db:"user_id"` ConversationId string `json:"conversation_id" db:"conversation_id"` Model string `json:"model,omitempty" db:"model"` PromptToken string `json:"prompt_token,omitempty" db:"prompt_token"` CompletionToken string `json:"completion_token,omitempty" db:"completion_token"` Description string `json:"description,omitempty" db:"description"` Request []byte `json:"request,omitempty" db:"request"` Response []byte `json:"response,omitempty" db:"response"` RawResponse []byte `json:"raw_response,omitempty" db:"raw_response"` }
func (*MessageDTO) FromLLMMessage ¶
func (m *MessageDTO) FromLLMMessage(message llm.Message)
func (MessageDTO) TableName ¶
func (m MessageDTO) TableName() string
func (MessageDTO) ToLLMMessage ¶
func (m MessageDTO) ToLLMMessage() llm.Message
type Service ¶
type Service interface { ListModels() []string CreateChatCompletion(ctx context.Context, req llm.ChatCompletionRequest) (llm.ChatCompletionResponse, error) CreateChatCompletionStream(ctx context.Context, req llm.ChatCompletionRequest, respChan chan llm.ChatCompletionStreamResponse, errChan chan error) CreateConversation(ctx context.Context, name string) (llm.Conversation, error) ListConversations(ctx context.Context) ([]llm.Conversation, error) GetConversation(ctx context.Context, id string) (llm.Conversation, error) DeleteConversation(ctx context.Context, id string) error CreateMessageStream(ctx context.Context, conversationId string, req llm.ChatCompletionRequest, respChan chan llm.ChatCompletionStreamResponse, errChan chan error) CreateMessage(ctx context.Context, conversationId string, req llm.ChatCompletionRequest) (llm.Message, error) ListMessages(ctx context.Context, conversationId string) ([]llm.Message, error) GetMessage(ctx context.Context, id string) (llm.Message, error) DeleteMessage(ctx context.Context, id string) error }
Click to show internal directories.
Click to hide internal directories.