adapters

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultLLMClient

type DefaultLLMClient struct {
	// contains filtered or unexported fields
}

DefaultLLMClient implements LLMClient using OpenAI

func NewDefaultLLMClient

func NewDefaultLLMClient(apiKey *string, systemPrompt string, model string, baseUrl string, temperature *float32) (*DefaultLLMClient, error)

NewDefaultLLMClient creates a new LLM client using OpenAI with API key from environment

func (*DefaultLLMClient) Classify

func (c *DefaultLLMClient) Classify(ctx context.Context, text string) (string, error)

Classify classifies text into a category label using LLM

type PineconeVectorAdapter

type PineconeVectorAdapter struct {
	// contains filtered or unexported fields
}

PineconeVectorAdapter adapts the Pinecone client to the VectorClient interface

func NewPineconeVectorAdapter

func NewPineconeVectorAdapter(apiKey *string, host *string, namespace string) (*PineconeVectorAdapter, error)

NewPineconeVectorAdapter creates a new adapter for Pinecone

func (*PineconeVectorAdapter) Search

func (a *PineconeVectorAdapter) Search(ctx context.Context, vector []float32, topK int) ([]types.VectorMatch, error)

Search implements VectorClient interface

func (*PineconeVectorAdapter) Upsert

func (a *PineconeVectorAdapter) Upsert(ctx context.Context, id string, vector []float32, metadata map[string]any) error

Upsert implements VectorClient interface

type VoyageEmbeddingAdapter

type VoyageEmbeddingAdapter struct {
	// contains filtered or unexported fields
}

VoyageEmbeddingAdapter adapts the Voyage client to the EmbeddingClient interface

func NewVoyageEmbeddingAdapter

func NewVoyageEmbeddingAdapter(apiKey *string) (*VoyageEmbeddingAdapter, error)

NewVoyageEmbeddingAdapter creates a new adapter for Voyage AI

func (*VoyageEmbeddingAdapter) GenerateEmbedding

func (a *VoyageEmbeddingAdapter) GenerateEmbedding(ctx context.Context, text string) ([]float32, error)

GenerateEmbedding implements EmbeddingClient interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL