ai

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

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 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 SearchOpts added in v0.0.5

type SearchOpts struct {
	Language string
	Category string
	Rerank   bool
	Sort     string
	Limit    int
}

type Service

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

func NewService

func NewService(client *Client, gh *github.Client) *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) ([]*SearchHit, error)

Jump to

Keyboard shortcuts

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