yao/agent/search/interfaces/nlp.go
Max f8ba875cd3 Refactor QueryDSL and search types to utilize GOU types directly
- Updated the `QueryDSLGenerator` interface to use `gou.QueryDSL` and `model.Model` types for improved compatibility with Yao's query system.
- Revised the `Request` struct to incorporate GOU types for `Wheres` and `Orders`, enhancing the integration with the GOU QueryDSL format.
- Removed deprecated `QueryWhere` and `QueryOrder` types, streamlining the codebase and reducing redundancy.
- Enhanced documentation in `DESIGN.md` to reflect these changes and provide guidance on using GOU types directly.
2025-12-13 11:56:31 +08:00

22 lines
710 B
Go

package interfaces
import (
"github.com/yaoapp/gou/model"
"github.com/yaoapp/gou/query/gou"
"github.com/yaoapp/yao/agent/search/types"
)
// KeywordExtractor extracts keywords for web search
type KeywordExtractor interface {
// Extract extracts search keywords from user message
Extract(content string, opts *types.KeywordOptions) ([]string, error)
}
// QueryDSLGenerator generates QueryDSL for DB search
type QueryDSLGenerator interface {
// Generate converts natural language to QueryDSL
Generate(query string, models []*model.Model) (*gou.QueryDSL, error)
}
// Note: Embedding is handled by KB collection's own config (embedding provider + model),
// not defined here. See KB handler for details.