Documentation
¶
Index ¶
- func BytesToFloat32(data []byte) []float32
- func CosineSimilarity(a, b []float32) float32
- func Float32ToBytes(data []float32) []byte
- type EmbeddingProvider
- type EmbeddingRequest
- type EmbeddingResponse
- type Message
- type OpenAIProvider
- type SemanticEngine
- type Storage
- type VerificationRequest
- type VerificationResponse
- type Verifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToFloat32 ¶
func CosineSimilarity ¶
func Float32ToBytes ¶
Types ¶
type EmbeddingProvider ¶
type EmbeddingRequest ¶
type EmbeddingResponse ¶
type EmbeddingResponse struct {
Data []struct {
Embedding []float64 `json:"embedding"`
} `json:"data"`
}
type OpenAIProvider ¶
type OpenAIProvider struct {
// contains filtered or unexported fields
}
func NewOpenAIProvider ¶
func NewOpenAIProvider() *OpenAIProvider
func (*OpenAIProvider) CheckSimilarity ¶
type SemanticEngine ¶
type SemanticEngine struct {
Provider EmbeddingProvider
Store Storage
Verifier Verifier
HighThreshold float32
LowThreshold float32
}
func NewSemanticEngine ¶
func NewSemanticEngine(p EmbeddingProvider, s Storage, v Verifier, highThreshold, lowThreshold float32) *SemanticEngine
func (*SemanticEngine) FindSimilar ¶
type VerificationRequest ¶
type VerificationResponse ¶
type VerificationResponse struct {
Choices []struct {
Message Message `json:"message"`
} `json:"choices"`
}
Click to show internal directories.
Click to hide internal directories.