feat(client): enhance knowledge file upload with process configuration support
- Updated the `CreateKnowledgeFromFile` function to accept an optional `processConfig` parameter for per-upload parse configuration overrides. - Introduced the `KnowledgeProcessOverrides` type to define various parsing settings, including parser engine rules and chunking configurations. - Modified the API client and related components to handle the new process configuration, improving flexibility in knowledge file uploads. - Updated documentation and API specifications to reflect the new `process_config` parameter in the upload process. - Added a new `UploadConfirmHost` component to facilitate user confirmation for uploads, integrating with the updated upload logic. - Enhanced user experience by providing detailed configuration options during the upload process.
This commit is contained in:
@@ -108,6 +108,25 @@ type GraphRelation struct {
|
||||
Type string `json:"type"`
|
||||
}
|
||||
|
||||
// ParserEngineRule maps a set of file types to a specific parser engine.
|
||||
type ParserEngineRule struct {
|
||||
FileTypes []string `json:"file_types"`
|
||||
Engine string `json:"engine"`
|
||||
}
|
||||
|
||||
// QuestionGenerationConfig controls LLM-generated questions per chunk during parsing.
|
||||
type QuestionGenerationConfig struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
QuestionCount int `json:"question_count"`
|
||||
}
|
||||
|
||||
// ASRConfig represents automatic speech recognition settings for audio files.
|
||||
type ASRConfig struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
ModelID string `json:"model_id"`
|
||||
Language string `json:"language,omitempty"`
|
||||
}
|
||||
|
||||
// UnmarshalJSON keeps backward compatibility for legacy responses that still
|
||||
// use `cos_config` instead of `storage_config`.
|
||||
func (kb *KnowledgeBase) UnmarshalJSON(data []byte) error {
|
||||
|
||||
Reference in New Issue
Block a user