Merge pull request #1088 from trheyi/main
Add uploader configuration and default value in Config
This commit is contained in:
commit
d41ddf464d
3 changed files with 71 additions and 3 deletions
|
|
@ -307,9 +307,13 @@ func (c *Config) UnmarshalJSON(data []byte) error {
|
|||
return err
|
||||
}
|
||||
|
||||
// Set default uploader if not configured
|
||||
if c.Uploader == "" {
|
||||
c.Uploader = "__yao.attachment"
|
||||
}
|
||||
|
||||
// Compute features after parsing and resolving env vars
|
||||
c.Features = c.ComputeFeatures()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,6 +69,9 @@ type Config struct {
|
|||
// FFmpeg configuration (Optional)
|
||||
FFmpeg *FFmpegConfig `json:"ffmpeg,omitempty" yaml:"ffmpeg"`
|
||||
|
||||
// File uploader configuration (Optional)
|
||||
Uploader string `json:"uploader,omitempty" yaml:"uploader"` // Default: "__yao.attachment"
|
||||
|
||||
// Concurrency limits for task processing (Optional)
|
||||
Limits *LimitsConfig `json:"limits,omitempty" yaml:"limits"`
|
||||
|
||||
|
|
|
|||
|
|
@ -620,8 +620,69 @@ func processXgen(process *process.Process) interface{} {
|
|||
}
|
||||
}
|
||||
|
||||
// other providers
|
||||
kbConfig = map[string]interface{}{"features": knowledgebase.Config.Features, "chunkings": chunkings, "embeddings": embeddings, "converters": converters}
|
||||
extractors := []string{}
|
||||
if knowledgebase.Config.Extractors != nil {
|
||||
for _, extractor := range knowledgebase.Config.Extractors {
|
||||
extractors = append(extractors, extractor.ID)
|
||||
}
|
||||
}
|
||||
|
||||
fetchers := []string{}
|
||||
if knowledgebase.Config.Fetchers != nil {
|
||||
for _, fetcher := range knowledgebase.Config.Fetchers {
|
||||
fetchers = append(fetchers, fetcher.ID)
|
||||
}
|
||||
}
|
||||
|
||||
searchers := []string{}
|
||||
if knowledgebase.Config.Searchers != nil {
|
||||
for _, searcher := range knowledgebase.Config.Searchers {
|
||||
searchers = append(searchers, searcher.ID)
|
||||
}
|
||||
}
|
||||
|
||||
rerankers := []string{}
|
||||
if knowledgebase.Config.Rerankers != nil {
|
||||
for _, reranker := range knowledgebase.Config.Rerankers {
|
||||
rerankers = append(rerankers, reranker.ID)
|
||||
}
|
||||
}
|
||||
|
||||
votes := []string{}
|
||||
if knowledgebase.Config.Votes != nil {
|
||||
for _, vote := range knowledgebase.Config.Votes {
|
||||
votes = append(votes, vote.ID)
|
||||
}
|
||||
}
|
||||
|
||||
weights := []string{}
|
||||
if knowledgebase.Config.Weights != nil {
|
||||
for _, weight := range knowledgebase.Config.Weights {
|
||||
weights = append(weights, weight.ID)
|
||||
}
|
||||
}
|
||||
|
||||
scores := []string{}
|
||||
if knowledgebase.Config.Scores != nil {
|
||||
for _, score := range knowledgebase.Config.Scores {
|
||||
scores = append(scores, score.ID)
|
||||
}
|
||||
}
|
||||
|
||||
kbConfig = map[string]interface{}{
|
||||
"features": knowledgebase.Config.Features,
|
||||
"chunkings": chunkings,
|
||||
"embeddings": embeddings,
|
||||
"converters": converters,
|
||||
"extractors": extractors,
|
||||
"fetchers": fetchers,
|
||||
"searchers": searchers,
|
||||
"rerankers": rerankers,
|
||||
"votes": votes,
|
||||
"weights": weights,
|
||||
"scores": scores,
|
||||
"uploader": knowledgebase.Config.Uploader, // Default: "__yao.attachment"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue