ai

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveCategory

func ResolveCategory(repo *store.Repository, aiTags []string, cats []*store.Category) string

Types

type AnalysisResult

type AnalysisResult struct {
	Summary    string   `json:"summary"`
	Tags       []string `json:"tags"`
	Platforms  []string `json:"platforms"`
	SearchText string   `json:"search_text"`
}

type BatchAnalyzer

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

func NewBatchAnalyzer

func NewBatchAnalyzer(svc *Service, s store.Store, gh *github.Client, concurrency int) *BatchAnalyzer

func (*BatchAnalyzer) Run

func (b *BatchAnalyzer) Run(ctx context.Context, repos []*store.Repository, opts BatchOpts) (*BatchResult, error)

type BatchOpts

type BatchOpts struct {
	Force      bool
	Limit      int
	OnProgress func(done, total int, curName string)
}

type BatchResult

type BatchResult struct {
	Total   int
	Success int
	Failed  int
}

type Client

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

func NewClient

func NewClient(baseURL, apiKey, model string) *Client

func (*Client) Complete

func (c *Client) Complete(ctx context.Context, messages []Message) (string, error)

type EmbeddingClient added in v0.0.6

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

func NewEmbeddingClient added in v0.0.6

func NewEmbeddingClient(baseURL, apiKey, model string) *EmbeddingClient

func (*EmbeddingClient) Dimension added in v0.0.8

func (ec *EmbeddingClient) Dimension() int

func (*EmbeddingClient) Embed added in v0.0.6

func (ec *EmbeddingClient) Embed(ctx context.Context, texts []string) ([][]float64, error)

type Message

type Message struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

type QueryIntent added in v0.0.5

type QueryIntent struct {
	FTSQuery string   `json:"fts_query"`
	Keywords []string `json:"keywords"`
	Language string   `json:"language"`
	Category string   `json:"category"`
	Platform string   `json:"platform"`
	MinStars int      `json:"min_stars"`
	MaxStars int      `json:"max_stars"`
}

type SearchHit

type SearchHit struct {
	Repo  *store.Repository
	Score float64
}

type SearchIndex added in v0.0.9

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

func NewSearchIndex added in v0.0.9

func NewSearchIndex() *SearchIndex

func (*SearchIndex) Load added in v0.0.9

func (idx *SearchIndex) Load(ctx context.Context, st store.Store) error

func (*SearchIndex) Search added in v0.0.9

func (idx *SearchIndex) Search(query string, keywords []string, filters *store.SearchFilters, limit int) []*SearchHit

type SearchMode added in v0.0.6

type SearchMode string
const (
	SearchModeVector    SearchMode = "vector"
	SearchModeAI        SearchMode = "ai"
	SearchModeBasicText SearchMode = "basic_text"
	SearchModeHybrid    SearchMode = "hybrid"
)

type SearchOpts added in v0.0.5

type SearchOpts struct {
	Language       string
	Category       string
	Platform       string
	Tags           []string
	MinStars       int
	MaxStars       int
	Sort           string
	Limit          int
	Analyzed       *bool
	AnalysisFailed *bool
}

type SearchResult added in v0.0.6

type SearchResult struct {
	Hits []*SearchHit
	Mode SearchMode
}

type Service

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

func NewService

func NewService(client *Client, gh *github.Client) *Service

func NewServiceWithEmbedding added in v0.0.6

func NewServiceWithEmbedding(client *Client, gh *github.Client, embeddingClient *EmbeddingClient) *Service

func (*Service) AnalyzeRepository

func (s *Service) AnalyzeRepository(ctx context.Context, repo *store.Repository, readme string, cats []*store.Category) (*AnalysisResult, error)

func (*Service) Search

func (s *Service) Search(ctx context.Context, query string, st store.Store, opts SearchOpts) (*SearchResult, error)

func (*Service) SetSearchIndex added in v0.0.9

func (s *Service) SetSearchIndex(idx *SearchIndex)

Jump to

Keyboard shortcuts

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