Documentation
¶
Index ¶
- Constants
- func CallRAGQuery(inst *instance.Instance, payload []byte, path string, contentType string) (*http.Response, error)
- func CleanInstance(inst *instance.Instance) error
- func Index(inst *instance.Instance, logger logger.Logger, msg IndexMessage) error
- func Query(inst *instance.Instance, logger logger.Logger, query QueryMessage) error
- type ChatConversation
- func (c *ChatConversation) Clone() couchdb.Doc
- func (c *ChatConversation) DocType() string
- func (c *ChatConversation) ID() string
- func (c *ChatConversation) Included() []jsonapi.Object
- func (c *ChatConversation) Links() *jsonapi.LinksList
- func (c *ChatConversation) Relationships() jsonapi.RelationshipMap
- func (c *ChatConversation) Rev() string
- func (c *ChatConversation) SetID(id string)
- func (c *ChatConversation) SetRev(rev string)
- type ChatMessage
- type ChatPayload
- type IndexMessage
- type QueryMessage
- type Source
Constants ¶
View Source
const ( UserRole = "user" AssistantRole = "assistant" Temperature = 0.3 // LLM parameter - Sampling temperature, lower is more deterministic, higher is more creative. TopP = 1 // LLM parameter - Alternative to temperature, take the tokens with the top p probability. LogProbs = false // LLM parameter - Whether to return log probabilities of the output tokens. )
View Source
const BatchSize = 100
BatchSize is the maximal number of documents manipulated at once by the worker.
View Source
const DocTypeVersion = "1"
DocTypeVersion represents the doctype version. Each time this document structure is modified, update this value
Variables ¶
This section is empty.
Functions ¶
func CallRAGQuery ¶
func CleanInstance ¶
Types ¶
type ChatConversation ¶
type ChatConversation struct {
DocID string `json:"_id"`
DocRev string `json:"_rev,omitempty"`
Messages []ChatMessage `json:"messages"`
Metadata *metadata.CozyMetadata `json:"cozyMetadata"`
}
func Chat ¶
func Chat(inst *instance.Instance, payload ChatPayload) (*ChatConversation, error)
func (*ChatConversation) Clone ¶
func (c *ChatConversation) Clone() couchdb.Doc
func (*ChatConversation) DocType ¶
func (c *ChatConversation) DocType() string
func (*ChatConversation) ID ¶
func (c *ChatConversation) ID() string
func (*ChatConversation) Included ¶
func (c *ChatConversation) Included() []jsonapi.Object
func (*ChatConversation) Links ¶
func (c *ChatConversation) Links() *jsonapi.LinksList
func (*ChatConversation) Relationships ¶
func (c *ChatConversation) Relationships() jsonapi.RelationshipMap
func (*ChatConversation) Rev ¶
func (c *ChatConversation) Rev() string
func (*ChatConversation) SetID ¶
func (c *ChatConversation) SetID(id string)
func (*ChatConversation) SetRev ¶
func (c *ChatConversation) SetRev(rev string)
type ChatMessage ¶
type ChatPayload ¶
type IndexMessage ¶
type IndexMessage struct {
Doctype string `json:"doctype"`
}
type QueryMessage ¶
type Source ¶
type Source struct {
ID string `json:"id"`
DocType string `json:"doctype"`
Filename string `json:"filename"`
FileURL string `json:"fileUrl"`
ChunkURL string `json:"chunkUrl"`
Page int `json:"page"`
EmailPreview string `json:"email.preview,omitempty"`
RelationshipID string `json:"relationship_id,omitempty"`
ParentID string `json:"parent_id,omitempty"`
Subject string `json:"email.subject,omitempty"`
Datetime string `json:"datetime,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.