- Modified Schema methods across various providers (chunking, embedding, extractor, fetcher, converters) to accept an additional locale parameter, enhancing localization support. - Updated corresponding test cases to reflect the changes in method signatures and ensure proper functionality with the new locale argument.
43 lines
1.1 KiB
Go
43 lines
1.1 KiB
Go
package factory
|
|
|
|
import (
|
|
"github.com/yaoapp/gou/graphrag/types"
|
|
kbtypes "github.com/yaoapp/yao/kb/types"
|
|
)
|
|
|
|
// Chunking is a factory for chunking providers
|
|
type Chunking interface {
|
|
Make(option *kbtypes.ProviderOption) (types.Chunking, error)
|
|
Options(option *kbtypes.ProviderOption) (*types.ChunkingOptions, error)
|
|
Schema
|
|
}
|
|
|
|
// Converter is a factory for converter providers
|
|
type Converter interface {
|
|
Make(option *kbtypes.ProviderOption) (types.Converter, error)
|
|
AutoDetect(filename, contentTypes string) (bool, int, error)
|
|
Schema
|
|
}
|
|
|
|
// Embedding is a factory for embedding providers
|
|
type Embedding interface {
|
|
Make(options *kbtypes.ProviderOption) (types.Embedding, error)
|
|
Schema
|
|
}
|
|
|
|
// Extractor is a factory for extractor providers
|
|
type Extractor interface {
|
|
Make(option *kbtypes.ProviderOption) (types.Extraction, error)
|
|
Schema
|
|
}
|
|
|
|
// Fetcher is a factory for fetcher providers
|
|
type Fetcher interface {
|
|
Make(option *kbtypes.ProviderOption) (types.Fetcher, error)
|
|
Schema
|
|
}
|
|
|
|
// Schema interface for providers
|
|
type Schema interface {
|
|
Schema(provider *kbtypes.Provider, locale string) (*kbtypes.ProviderSchema, error)
|
|
}
|