Documentation
¶
Index ¶
- type AnalysisServer
- type ArticleServer
- func (s *ArticleServer) GetArticle(_ context.Context, req *protos.GetArticleRequest) (*protos.Article, error)
- func (s *ArticleServer) GetArticleCounts(_ context.Context, filter *protos.ArticleFilter) (*protos.ArticleCountsResponse, error)
- func (s *ArticleServer) ListArticles(_ context.Context, filter *protos.ArticleFilter) (*protos.ListArticlesResponse, error)
- func (s *ArticleServer) MarkFeedArticlesRead(_ context.Context, req *protos.MarkFeedReadRequest) (*emptypb.Empty, error)
- func (s *ArticleServer) UpdateArticle(_ context.Context, req *protos.UpdateArticleRequest) (*emptypb.Empty, error)
- type AutoConfigResult
- type CategoriesServer
- type DigestServer
- func (s *DigestServer) GenerateDigest(req *protos.GenerateDigestRequest, ...) error
- func (s *DigestServer) GetDigest(ctx context.Context, req *protos.GetDigestRequest) (*protos.GetDigestResponse, error)
- func (s *DigestServer) GetDigestArticles(ctx context.Context, req *protos.GetDigestArticlesRequest) (*protos.GetDigestArticlesResponse, error)
- func (s *DigestServer) ListDigests(ctx context.Context, req *protos.ListDigestsRequest) (*protos.ListDigestsResponse, error)
- type FeedsServer
- func (s *FeedsServer) ApplyFeeds(_ context.Context, req *protos.ApplyFeedsRequest) (*protos.ApplyFeedsResponse, error)
- func (s *FeedsServer) AutoConfigFeed(req *protos.AutoConfigFeedRequest, ...) error
- func (s *FeedsServer) DeleteFeed(_ context.Context, req *protos.DeleteFeedRequest) (*emptypb.Empty, error)
- func (s *FeedsServer) DeleteFeeds(_ context.Context, req *protos.DeleteFeedsRequest) (*protos.DeleteFeedsResponse, error)
- func (s *FeedsServer) InspectArticle(_ context.Context, req *protos.InspectArticleRequest) (*protos.InspectArticleResponse, error)
- func (s *FeedsServer) InspectFeed(_ context.Context, req *protos.InspectFeedRequest) (*protos.InspectFeedResponse, error)
- func (s *FeedsServer) ListFeeds(_ context.Context, _ *protos.ListFeedsRequest) (*protos.ListFeedsResponse, error)
- func (s *FeedsServer) RefreshAllFeeds(req *protos.RefreshAllFeedsRequest, ...) error
- func (s *FeedsServer) RefreshFeed(ctx context.Context, req *protos.RefreshFeedRequest) (*protos.RefreshFeedResponse, error)
- func (s *FeedsServer) RegisterFeed(_ context.Context, req *protos.RegisterFeedRequest) (*emptypb.Empty, error)
- type LLMRequest
- type LLMsServer
- func (s *LLMsServer) AnalyzeArticle(ctx context.Context, req *protos.AnalyzeArticleRequest) (*protos.AnalyzeArticleResponse, error)
- func (s *LLMsServer) AnalyzeArticleOneShot(ctx context.Context, req *protos.AnalyzeArticleWithProviderModelRequest, ...) (*protos.AnalyzeArticleWithProviderModelResponse, error)
- func (s *LLMsServer) AnalyzeArticleWithProgress(ctx context.Context, req *protos.AnalyzeArticleWithProviderModelRequest, ...) (*protos.AnalyzeArticleWithProviderModelResponse, error)
- func (s *LLMsServer) AnalyzeArticleWithProviderModel(ctx context.Context, req *protos.AnalyzeArticleWithProviderModelRequest) (*protos.AnalyzeArticleWithProviderModelResponse, error)
- func (s *LLMsServer) GetAnalysisConfig(_ context.Context, _ *protos.GetAnalysisConfigRequest) (*protos.GetAnalysisConfigResponse, error)
- func (s *LLMsServer) GetAvailableModels(_ context.Context, req *protos.GetAvailableModelsRequest) (*protos.ModelsResponse, error)
- func (s *LLMsServer) GetLLMProviders(_ context.Context, _ *protos.GetLLMProvidersRequest) (*protos.GetLLMProvidersResponse, error)
- func (s *LLMsServer) PreviewAnalysisPrompt(_ context.Context, req *protos.PreviewAnalysisPromptRequest) (*protos.PreviewAnalysisPromptResponse, error)
- func (s *LLMsServer) ResolveLLM(_ context.Context, req *protos.ResolveLLMRequest) (*protos.ResolveLLMResponse, error)
- func (s *LLMsServer) SaveLLMProviders(_ context.Context, req *protos.SaveLLMProvidersRequest) (*emptypb.Empty, error)
- func (s *LLMsServer) StreamAnalyzeArticle(req *protos.AnalyzeArticleWithProviderModelRequest, ...) error
- type QueueServer
- func (s *QueueServer) ClearQueue(_ context.Context, _ *emptypb.Empty) (*emptypb.Empty, error)
- func (s *QueueServer) DequeueArticle(_ context.Context, req *protos.DequeueArticleRequest) (*emptypb.Empty, error)
- func (s *QueueServer) EnqueueArticles(_ context.Context, req *protos.EnqueueArticlesRequest) (*protos.EnqueueArticlesResponse, error)
- func (s *QueueServer) GetQueueStatus(_ context.Context, _ *protos.GetQueueStatusRequest) (*protos.GetQueueStatusResponse, error)
- func (s *QueueServer) StartQueue(_ context.Context, _ *emptypb.Empty) (*emptypb.Empty, error)
- func (s *QueueServer) StopQueue(_ context.Context, _ *emptypb.Empty) (*emptypb.Empty, error)
- func (s *QueueServer) StreamQueueProgress(_ *emptypb.Empty, stream protos.QueueService_StreamQueueProgressServer) error
- type ResolvedLLM
- type ServerConfigServer
- func (s *ServerConfigServer) GetConfig(ctx context.Context, req *protos.GetConfigRequest) (*protos.GetConfigResponse, error)
- func (s *ServerConfigServer) SaveConfig(ctx context.Context, req *protos.SaveConfigRequest) (*emptypb.Empty, error)
- func (s *ServerConfigServer) UpdateAnalysisConfig(_ context.Context, req *protos.UpdateAnalysisConfigRequest) (*emptypb.Empty, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalysisServer ¶
type AnalysisServer struct {
protos.UnimplementedAnalysisServiceServer
}
AnalysisServer implements the AnalysisService gRPC service
func NewAnalysisServer ¶
func NewAnalysisServer() *AnalysisServer
NewAnalysisServer creates a new Analysis server instance
func (*AnalysisServer) GetAllArticleAnalyses ¶
func (s *AnalysisServer) GetAllArticleAnalyses(ctx context.Context, req *protos.GetAllArticleAnalysesRequest) (*protos.GetAllArticleAnalysesResponse, error)
GetAllArticleAnalyses retrieves all analysis results for a specific article
type ArticleServer ¶
type ArticleServer struct {
protos.UnimplementedArticleServiceServer
}
ArticleServer implements the ArticleService gRPC service
func NewArticleServer ¶
func NewArticleServer() *ArticleServer
NewArticleServer creates a new article server instance
func (*ArticleServer) GetArticle ¶
func (s *ArticleServer) GetArticle(_ context.Context, req *protos.GetArticleRequest) (*protos.Article, error)
GetArticle implements the GetArticle RPC method
func (*ArticleServer) GetArticleCounts ¶
func (s *ArticleServer) GetArticleCounts(_ context.Context, filter *protos.ArticleFilter) (*protos.ArticleCountsResponse, error)
func (*ArticleServer) ListArticles ¶
func (s *ArticleServer) ListArticles(_ context.Context, filter *protos.ArticleFilter) (*protos.ListArticlesResponse, error)
ListArticles implements the ListArticles RPC method
func (*ArticleServer) MarkFeedArticlesRead ¶
func (s *ArticleServer) MarkFeedArticlesRead(_ context.Context, req *protos.MarkFeedReadRequest) (*emptypb.Empty, error)
func (*ArticleServer) UpdateArticle ¶
func (s *ArticleServer) UpdateArticle(_ context.Context, req *protos.UpdateArticleRequest) (*emptypb.Empty, error)
UpdateArticle implements the UpdateArticle RPC method
type AutoConfigResult ¶ added in v0.2.0
AutoConfigResult is the agent's final output.
type CategoriesServer ¶
type CategoriesServer struct {
protos.UnimplementedCategoriesServiceServer
}
CategoriesServer implements the CategoriesService gRPC service
func NewCategoriesServer ¶
func NewCategoriesServer() *CategoriesServer
NewCategoriesServer creates a new Categories server instance
func (*CategoriesServer) GetOrCreateCategory ¶
func (s *CategoriesServer) GetOrCreateCategory(_ context.Context, req *protos.GetOrCreateCategoryRequest) (*protos.GetOrCreateCategoryResponse, error)
GetOrCreateCategory implements the CategoriesService gRPC service
type DigestServer ¶
type DigestServer struct {
protos.UnimplementedDigestServiceServer
// contains filtered or unexported fields
}
DigestServer implements the DigestService gRPC service
func NewDigestServer ¶
func NewDigestServer(gw *llmgateway.Gateway, llms *LLMsServer) *DigestServer
NewDigestServer creates a new Digest server instance. The gateway is the single chokepoint for LLM calls (dedupe, summary, article analysis during ensureArticlesAnalyzed); llms is reused so we don't re-construct an LLMsServer on every digest.
func (*DigestServer) GenerateDigest ¶
func (s *DigestServer) GenerateDigest(req *protos.GenerateDigestRequest, rawStream protos.DigestService_GenerateDigestServer) error
GenerateDigest generates a new digest, streaming progress events throughout the process
func (*DigestServer) GetDigest ¶
func (s *DigestServer) GetDigest(ctx context.Context, req *protos.GetDigestRequest) (*protos.GetDigestResponse, error)
GetDigest returns a single digest by Id
func (*DigestServer) GetDigestArticles ¶
func (s *DigestServer) GetDigestArticles(ctx context.Context, req *protos.GetDigestArticlesRequest) (*protos.GetDigestArticlesResponse, error)
GetDigestArticles returns articles for a digest
func (*DigestServer) ListDigests ¶
func (s *DigestServer) ListDigests(ctx context.Context, req *protos.ListDigestsRequest) (*protos.ListDigestsResponse, error)
ListDigests retrieves all digests
type FeedsServer ¶
type FeedsServer struct {
protos.UnimplementedFeedsServiceServer
// contains filtered or unexported fields
}
FeedsServer implements the FeedsService gRPC service
func NewFeedsServer ¶
func NewFeedsServer(queue *QueueServer, gw *llmgateway.Gateway) *FeedsServer
NewFeedsServer creates a new feeds server instance. gw powers AutoBuildFeed and may be nil when no LLM gateway is available (autobuild will then error).
func (*FeedsServer) ApplyFeeds ¶
func (s *FeedsServer) ApplyFeeds(_ context.Context, req *protos.ApplyFeedsRequest) (*protos.ApplyFeedsResponse, error)
ApplyFeeds reconciles the stored feeds to match the desired set in the request.
func (*FeedsServer) AutoConfigFeed ¶ added in v0.2.0
func (s *FeedsServer) AutoConfigFeed(req *protos.AutoConfigFeedRequest, stream protos.FeedsService_AutoConfigFeedServer) error
AutoConfigFeed runs the autonomous LLM agent that discovers a feed's selectors (after probing and locking the scraping mode + headers), streaming each step then the final config.
func (*FeedsServer) DeleteFeed ¶
func (s *FeedsServer) DeleteFeed(_ context.Context, req *protos.DeleteFeedRequest) (*emptypb.Empty, error)
func (*FeedsServer) DeleteFeeds ¶
func (s *FeedsServer) DeleteFeeds(_ context.Context, req *protos.DeleteFeedsRequest) (*protos.DeleteFeedsResponse, error)
DeleteFeeds removes the given feeds (by id) from the database.
func (*FeedsServer) InspectArticle ¶ added in v0.2.0
func (s *FeedsServer) InspectArticle(_ context.Context, req *protos.InspectArticleRequest) (*protos.InspectArticleResponse, error)
InspectArticle scrapes a single article URL in the requested mode and, when selectors are supplied, returns the extracted content for selector testing.
func (*FeedsServer) InspectFeed ¶ added in v0.2.0
func (s *FeedsServer) InspectFeed(_ context.Context, req *protos.InspectFeedRequest) (*protos.InspectFeedResponse, error)
InspectFeed probes a feed URL (read-only, pre-registration) and returns its diagnosis plus sample article links for building a feed config.
func (*FeedsServer) ListFeeds ¶
func (s *FeedsServer) ListFeeds(_ context.Context, _ *protos.ListFeedsRequest) (*protos.ListFeedsResponse, error)
ListFeeds implements the ListFeeds RPC method
func (*FeedsServer) RefreshAllFeeds ¶
func (s *FeedsServer) RefreshAllFeeds(req *protos.RefreshAllFeedsRequest, stream protos.FeedsService_RefreshAllFeedsServer) error
func (*FeedsServer) RefreshFeed ¶
func (s *FeedsServer) RefreshFeed(ctx context.Context, req *protos.RefreshFeedRequest) (*protos.RefreshFeedResponse, error)
func (*FeedsServer) RegisterFeed ¶
func (s *FeedsServer) RegisterFeed(_ context.Context, req *protos.RegisterFeedRequest) (*emptypb.Empty, error)
type LLMRequest ¶
type LLMRequest struct {
// ProviderName selects an enabled provider by its config Name (highest priority).
ProviderName string
// ProviderType selects an enabled provider by type (used when ProviderName is empty).
ProviderType string
// Provider is the auto-detect token: it may be a provider type OR a config
// profile name; the server figures out which. Used by the user-facing
// --provider flag. Lower priority than the explicit ProviderName/ProviderType
// fields above (which the internal profile/queue callers set directly).
Provider string
ModelName string // may be "" (use provider default) or "auto"
// Per-call overrides; nil/zero means inherit from ProviderConfig, then fall
// back to the package-level defaults above.
Temperature *float64
MaxRetries *int
Timeout *time.Duration
MaxTokens int
}
LLMRequest describes how to look up and configure a provider for a single call. Zero values mean "use the analysis config default".
type LLMsServer ¶
type LLMsServer struct {
protos.UnimplementedLLMsServiceServer
// contains filtered or unexported fields
}
LLMsServer implements the LLMsService gRPC service
func NewLLMsServer ¶
func NewLLMsServer(gw *llmgateway.Gateway) *LLMsServer
NewLLMsServer creates a new LLMs server instance. The gateway is the single chokepoint for every LLM call the server makes; see pkg/llmgateway.
func (*LLMsServer) AnalyzeArticle ¶
func (s *LLMsServer) AnalyzeArticle(ctx context.Context, req *protos.AnalyzeArticleRequest) (*protos.AnalyzeArticleResponse, error)
AnalyzeArticle analyzes an article using the default model
func (*LLMsServer) AnalyzeArticleOneShot ¶
func (s *LLMsServer) AnalyzeArticleOneShot(ctx context.Context, req *protos.AnalyzeArticleWithProviderModelRequest, onTask func(taskName, status string, taskIndex, totalTasks int, err error)) (*protos.AnalyzeArticleWithProviderModelResponse, error)
func (*LLMsServer) AnalyzeArticleWithProgress ¶
func (s *LLMsServer) AnalyzeArticleWithProgress(ctx context.Context, req *protos.AnalyzeArticleWithProviderModelRequest, onTask func(taskName, status string, taskIndex, totalTasks int, err error)) (*protos.AnalyzeArticleWithProviderModelResponse, error)
AnalyzeArticleWithProgress is like AnalyzeArticleWithProviderModel but invokes the provided callback for each pipeline task start/completion so callers can forward progress events.
func (*LLMsServer) AnalyzeArticleWithProviderModel ¶
func (s *LLMsServer) AnalyzeArticleWithProviderModel(ctx context.Context, req *protos.AnalyzeArticleWithProviderModelRequest) (*protos.AnalyzeArticleWithProviderModelResponse, error)
AnalyzeArticleWithProviderModel analyzes an article using sequential Eino ChatModelAgent calls.
func (*LLMsServer) GetAnalysisConfig ¶
func (s *LLMsServer) GetAnalysisConfig(_ context.Context, _ *protos.GetAnalysisConfigRequest) (*protos.GetAnalysisConfigResponse, error)
GetAnalysisConfig returns the current analysis configuration
func (*LLMsServer) GetAvailableModels ¶
func (s *LLMsServer) GetAvailableModels(_ context.Context, req *protos.GetAvailableModelsRequest) (*protos.ModelsResponse, error)
GetAvailableModels fetches available models from all configured providers concurrently.
func (*LLMsServer) GetLLMProviders ¶
func (s *LLMsServer) GetLLMProviders(_ context.Context, _ *protos.GetLLMProvidersRequest) (*protos.GetLLMProvidersResponse, error)
GetLLMProviders returns the current LLM provider configurations
func (*LLMsServer) PreviewAnalysisPrompt ¶
func (s *LLMsServer) PreviewAnalysisPrompt(_ context.Context, req *protos.PreviewAnalysisPromptRequest) (*protos.PreviewAnalysisPromptResponse, error)
PreviewAnalysisPrompt builds the prompt for an article without sending it to an LLM
func (*LLMsServer) ResolveLLM ¶ added in v0.2.0
func (s *LLMsServer) ResolveLLM(_ context.Context, req *protos.ResolveLLMRequest) (*protos.ResolveLLMResponse, error)
ResolveLLM resolves a provider/model selection to the concrete provider type and model name a run would use, via the same path the actual calls take.
func (*LLMsServer) SaveLLMProviders ¶
func (s *LLMsServer) SaveLLMProviders(_ context.Context, req *protos.SaveLLMProvidersRequest) (*emptypb.Empty, error)
SaveLLMProviders updates the LLM provider configurations
func (*LLMsServer) StreamAnalyzeArticle ¶
func (s *LLMsServer) StreamAnalyzeArticle(req *protos.AnalyzeArticleWithProviderModelRequest, stream protos.LLMsService_StreamAnalyzeArticleServer) error
StreamAnalyzeArticle is the streaming version that sends progress events per task.
type QueueServer ¶
type QueueServer struct {
protos.UnimplementedQueueServiceServer
// contains filtered or unexported fields
}
QueueServer implements the server-side analysis queue.
Concurrency model: the LLM-call cap lives in the Gateway (which llms uses internally). QueueServer keeps its own `workerSem` only to bound how many goroutines it spawns from a large backlog, not to bound LLM calls. That budget is auto-derived from maxConcurrentLLMRequests (4× with a floor of 4) so a 10k-article backlog does not spawn 10k parked goroutines.
func NewQueueServer ¶
func NewQueueServer(llms *LLMsServer, maxConcurrentLLMRequests int) *QueueServer
NewQueueServer creates a new QueueServer with a reference to the LLMs service. The optional maxConcurrentLLMRequests seeds the queue's worker fan-out budget (not the LLM-call cap, which lives in the Gateway).
func (*QueueServer) ClearQueue ¶
func (*QueueServer) DequeueArticle ¶
func (s *QueueServer) DequeueArticle(_ context.Context, req *protos.DequeueArticleRequest) (*emptypb.Empty, error)
func (*QueueServer) EnqueueArticles ¶
func (s *QueueServer) EnqueueArticles(_ context.Context, req *protos.EnqueueArticlesRequest) (*protos.EnqueueArticlesResponse, error)
func (*QueueServer) GetQueueStatus ¶
func (s *QueueServer) GetQueueStatus(_ context.Context, _ *protos.GetQueueStatusRequest) (*protos.GetQueueStatusResponse, error)
func (*QueueServer) StartQueue ¶
func (*QueueServer) StreamQueueProgress ¶
func (s *QueueServer) StreamQueueProgress(_ *emptypb.Empty, stream protos.QueueService_StreamQueueProgressServer) error
type ResolvedLLM ¶
type ResolvedLLM struct {
Provider llmprovider.ChatModelProvider
ProviderType string
ModelName string
Timeout time.Duration
MaxRetries int
}
ResolvedLLM bundles a ready-to-use provider with the resolved identifiers.
func ResolveLLM ¶
func ResolveLLM(req LLMRequest) (*ResolvedLLM, error)
ResolveLLM performs provider lookup, "auto" model resolution, default application, and provider construction in one place.
type ServerConfigServer ¶
type ServerConfigServer struct {
protos.UnimplementedServerConfigServiceServer
}
ServerConfigServer implements the ServerConfigService gRPC service
func NewServerConfigServer ¶
func NewServerConfigServer() *ServerConfigServer
NewServerConfigServer creates a new ServerConfig server instance
func (*ServerConfigServer) GetConfig ¶
func (s *ServerConfigServer) GetConfig(ctx context.Context, req *protos.GetConfigRequest) (*protos.GetConfigResponse, error)
ServerConfigServer implements the ServerConfigService gRPC service
func (*ServerConfigServer) SaveConfig ¶
func (s *ServerConfigServer) SaveConfig(ctx context.Context, req *protos.SaveConfigRequest) (*emptypb.Empty, error)
ServerConfigServer implements the ServerConfigService gRPC service
func (*ServerConfigServer) UpdateAnalysisConfig ¶
func (s *ServerConfigServer) UpdateAnalysisConfig(_ context.Context, req *protos.UpdateAnalysisConfigRequest) (*emptypb.Empty, error)
UpdateAnalysisConfig updates the analysis configuration