Documentation ¶
Index ¶
- Variables
- func Init(logger *zap.Logger) base.IConnector
- func NewClient(config *structpb.Struct) (*goredis.Client, error)
- func WriteNonSystemMessage(client *goredis.Client, sessionID string, message MultiModalMessageWithTime) error
- func WriteSystemMessage(client *goredis.Client, sessionID string, message MultiModalMessageWithTime) error
- type ChatHistoryRetrieveInput
- type ChatHistoryRetrieveOutput
- type ChatMessageWriteInput
- type ChatMessageWriteOutput
- type ChatMultiModalMessageWriteInput
- type Connector
- type DisableSSL
- type Execution
- type Message
- type MessageWithTime
- type MultiModalContent
- type MultiModalMessage
- type MultiModalMessageWithTime
- type SSLMode
- type SSLModeConfig
- type VerifyFullSSL
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// DefaultLatestK is the default number of latest conversation turns to retrieve
DefaultLatestK = 5
)
Functions ¶
func WriteNonSystemMessage ¶
func WriteNonSystemMessage(client *goredis.Client, sessionID string, message MultiModalMessageWithTime) error
func WriteSystemMessage ¶
func WriteSystemMessage(client *goredis.Client, sessionID string, message MultiModalMessageWithTime) error
WriteSystemMessage writes system message for a given session ID
Types ¶
type ChatHistoryRetrieveOutput ¶
type ChatHistoryRetrieveOutput struct { Messages []*MultiModalMessage `json:"messages"` Status bool `json:"status"` }
ChatHistoryReadOutput is a wrapper struct for the messages associated with a session ID
func RetrieveSessionMessages ¶
func RetrieveSessionMessages(client *goredis.Client, input ChatHistoryRetrieveInput) ChatHistoryRetrieveOutput
RetrieveSessionMessages retrieves the latest K conversation turns from the Redis list for the given session ID
type ChatMessageWriteInput ¶
type ChatMessageWriteOutput ¶
type ChatMessageWriteOutput struct {
Status bool `json:"status"`
}
func WriteMessage ¶
func WriteMessage(client *goredis.Client, input ChatMessageWriteInput) ChatMessageWriteOutput
func WriteMultiModelMessage ¶
func WriteMultiModelMessage(client *goredis.Client, input ChatMultiModalMessageWriteInput) ChatMessageWriteOutput
type ChatMultiModalMessageWriteInput ¶
type ChatMultiModalMessageWriteInput struct { SessionID string `json:"session_id"` MultiModalMessage }
type Connector ¶
func (*Connector) CreateExecution ¶
type DisableSSL ¶
type DisableSSL struct {
Mode SSLMode `json:"mode"`
}
DisableSSL is the struct for disable SSL
type MessageWithTime ¶
type MultiModalContent ¶
type MultiModalMessage ¶
type MultiModalMessage struct { Role string `json:"role"` Content []MultiModalContent `json:"content"` Metadata *map[string]interface{} `json:"metadata,omitempty"` }
type MultiModalMessageWithTime ¶
type MultiModalMessageWithTime struct { MultiModalMessage Timestamp int64 `json:"timestamp"` }
func RetrieveSystemMessage ¶
func RetrieveSystemMessage(client *goredis.Client, sessionID string) (bool, *MultiModalMessageWithTime, error)
RetrieveSystemMessage gets system message based on a given session ID
type SSLModeConfig ¶
SSLConfig is the interface for SSL configuration
type VerifyFullSSL ¶
type VerifyFullSSL struct { Mode SSLMode `json:"mode"` CaCert string `json:"ca_cert"` ClientCert string `json:"client_cert"` ClientKey string `json:"client_key"` }
VerifyFullSSL is the struct for verify-full SSL. It always requires encryption and verification of the identify of the server.
Click to show internal directories.
Click to hide internal directories.