diff --git a/agent/assistant/agent.go b/agent/assistant/agent.go index 204d87b1..89807d54 100644 --- a/agent/assistant/agent.go +++ b/agent/assistant/agent.go @@ -16,7 +16,7 @@ import ( // Stream stream the agent // handler is optional, if not provided, a default handler will be used -func (ast *Assistant) Stream(ctx *context.Context, inputMessages []context.Message, options ...*context.Options) (interface{}, error) { +func (ast *Assistant) Stream(ctx *context.Context, inputMessages []context.Message, options ...*context.Options) (*context.Response, error) { // Update logger with assistant ID and start logging ctx.Logger.SetAssistantID(ast.ID) @@ -205,8 +205,8 @@ func (ast *Assistant) Stream(ctx *context.Context, inputMessages []context.Messa // ================================================ // Execute Auto Search (if enabled) // ================================================ - if ast.shouldAutoSearch(ctx, completionMessages, createResponse, opts) { - refCtx := ast.executeAutoSearch(ctx, completionMessages, createResponse, opts) + if intent := ast.shouldAutoSearch(ctx, completionMessages, createResponse, opts); intent != nil { + refCtx := ast.executeAutoSearch(ctx, completionMessages, createResponse, intent, opts) if refCtx != nil && len(refCtx.References) > 0 { completionMessages = ast.injectSearchContext(completionMessages, refCtx) } @@ -376,7 +376,7 @@ func (ast *Assistant) Stream(ctx *context.Context, inputMessages []context.Messa // ================================================ // Execute Next Hook and Process Response // ================================================ - var finalResponse interface{} + var finalResponse *context.Response var nextResponse *context.NextHookResponse = nil if ast.HookScript != nil { diff --git a/agent/assistant/agent_next_test.go b/agent/assistant/agent_next_test.go index 997b19b2..bf3de999 100644 --- a/agent/assistant/agent_next_test.go +++ b/agent/assistant/agent_next_test.go @@ -56,19 +56,18 @@ func TestAgentNextStandard(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, response) - resp := response.(*context.Response) - assert.NotNil(t, resp.Completion) - assert.Nil(t, resp.Next) + assert.NotNil(t, response.Completion) + assert.Nil(t, response.Next) // Verify response structure - assert.Equal(t, "tests.realworld-next", resp.AssistantID) - assert.NotEmpty(t, resp.ContextID) - assert.NotEmpty(t, resp.RequestID) - assert.NotEmpty(t, resp.TraceID) - assert.NotEmpty(t, resp.ChatID) + assert.Equal(t, "tests.realworld-next", response.AssistantID) + assert.NotEmpty(t, response.ContextID) + assert.NotEmpty(t, response.RequestID) + assert.NotEmpty(t, response.TraceID) + assert.NotEmpty(t, response.ChatID) // Verify completion has content - assert.NotNil(t, resp.Completion.Content) + assert.NotNil(t, response.Completion.Content) t.Log("✓ Standard response test passed") } @@ -94,19 +93,18 @@ func TestAgentNextCustomData(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, response) - resp := response.(*context.Response) - assert.NotNil(t, resp.Completion) - assert.NotNil(t, resp.Next) + assert.NotNil(t, response.Completion) + assert.NotNil(t, response.Next) // Verify response structure - assert.Equal(t, "tests.realworld-next", resp.AssistantID) - assert.NotEmpty(t, resp.ContextID) - assert.NotEmpty(t, resp.RequestID) - assert.NotEmpty(t, resp.TraceID) + assert.Equal(t, "tests.realworld-next", response.AssistantID) + assert.NotEmpty(t, response.ContextID) + assert.NotEmpty(t, response.RequestID) + assert.NotEmpty(t, response.TraceID) // Verify custom data structure (from scenarioCustomData) - // resp.Next contains the "data" field value from NextHookResponse - nextData, ok := resp.Next.(map[string]interface{}) + // response.Next contains the "data" field value from NextHookResponse + nextData, ok := response.Next.(map[string]interface{}) assert.True(t, ok, "Next should be a map") assert.Equal(t, "custom_response", nextData["type"]) assert.Equal(t, "This is a custom response from Next Hook", nextData["message"]) @@ -137,21 +135,19 @@ func TestAgentNextDelegate(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, response) - resp := response.(*context.Response) - // Verify response structure - assert.NotEmpty(t, resp.AssistantID) - assert.NotEmpty(t, resp.ContextID) - assert.NotEmpty(t, resp.RequestID) - assert.NotEmpty(t, resp.TraceID) + assert.NotEmpty(t, response.AssistantID) + assert.NotEmpty(t, response.ContextID) + assert.NotEmpty(t, response.RequestID) + assert.NotEmpty(t, response.TraceID) // Verify completion (delegated agent should have returned completion) - assert.NotNil(t, resp.Completion) - assert.NotNil(t, resp.Completion.Content) + assert.NotNil(t, response.Completion) + assert.NotNil(t, response.Completion.Content) // Next should be from the delegated agent // If delegated agent also has Next hook, it will be present - t.Logf("✓ Delegation test passed (delegated to: %s)", resp.AssistantID) + t.Logf("✓ Delegation test passed (delegated to: %s)", response.AssistantID) } // TestAgentNextConditional tests agent with conditional logic in Next Hook @@ -177,18 +173,17 @@ func TestAgentNextConditional(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, response) - resp := response.(*context.Response) - assert.NotNil(t, resp.Next) + assert.NotNil(t, response.Next) // Verify response structure - assert.Equal(t, "tests.realworld-next", resp.AssistantID) - assert.NotEmpty(t, resp.ContextID) - assert.NotEmpty(t, resp.RequestID) - assert.NotEmpty(t, resp.TraceID) + assert.Equal(t, "tests.realworld-next", response.AssistantID) + assert.NotEmpty(t, response.ContextID) + assert.NotEmpty(t, response.RequestID) + assert.NotEmpty(t, response.TraceID) // Verify conditional response structure (from scenarioConditional) - // resp.Next contains the "data" field value from NextHookResponse - nextData, ok := resp.Next.(map[string]interface{}) + // response.Next contains the "data" field value from NextHookResponse + nextData, ok := response.Next.(map[string]interface{}) assert.True(t, ok, "Next should be a map") assert.Equal(t, "Conditional analysis complete", nextData["message"]) assert.Contains(t, nextData, "action") @@ -224,19 +219,18 @@ func TestAgentWithoutNextHook(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, response) - resp := response.(*context.Response) - assert.Nil(t, resp.Next) + assert.Nil(t, response.Next) // Verify response structure - assert.Equal(t, "tests.create", resp.AssistantID) - assert.NotEmpty(t, resp.ContextID) - assert.NotEmpty(t, resp.RequestID) - assert.NotEmpty(t, resp.TraceID) - assert.NotEmpty(t, resp.ChatID) + assert.Equal(t, "tests.create", response.AssistantID) + assert.NotEmpty(t, response.ContextID) + assert.NotEmpty(t, response.RequestID) + assert.NotEmpty(t, response.TraceID) + assert.NotEmpty(t, response.ChatID) // Verify completion - assert.NotNil(t, resp.Completion) - assert.NotNil(t, resp.Completion.Content) + assert.NotNil(t, response.Completion) + assert.NotNil(t, response.Completion.Content) t.Log("✓ No Next Hook test passed") } diff --git a/agent/assistant/assistant.go b/agent/assistant/assistant.go index bd6413e5..7a6825be 100644 --- a/agent/assistant/assistant.go +++ b/agent/assistant/assistant.go @@ -51,7 +51,7 @@ type agentCallerWrapper struct { ast *Assistant } -func (w *agentCallerWrapper) Stream(ctx *agentContext.Context, messages []agentContext.Message, options ...*agentContext.Options) (interface{}, error) { +func (w *agentCallerWrapper) Stream(ctx *agentContext.Context, messages []agentContext.Message, options ...*agentContext.Options) (*agentContext.Response, error) { return w.ast.Stream(ctx, messages, options...) } diff --git a/agent/assistant/next.go b/agent/assistant/next.go index 940d0739..fc6c7c7a 100644 --- a/agent/assistant/next.go +++ b/agent/assistant/next.go @@ -8,7 +8,7 @@ import ( ) // processNextResponse processes the Next hook's response and handles agent delegation or custom data -func (ast *Assistant) processNextResponse(npc *NextProcessContext) (interface{}, error) { +func (ast *Assistant) processNextResponse(npc *NextProcessContext) (*agentContext.Response, error) { // If no Next hook response, return standard response if npc.NextResponse == nil { return ast.buildStandardResponse(npc), nil @@ -42,7 +42,7 @@ func (ast *Assistant) handleDelegation( ctx *agentContext.Context, delegate *agentContext.DelegateConfig, streamHandler func(message.StreamChunkType, []byte) int, -) (interface{}, error) { +) (*agentContext.Response, error) { // Load the target assistant targetAssistant, err := Get(delegate.AgentID) if err != nil { @@ -62,7 +62,7 @@ func (ast *Assistant) handleDelegation( } // buildStandardResponse builds the standard agent response when no custom Next hook processing is needed -func (ast *Assistant) buildStandardResponse(npc *NextProcessContext) interface{} { +func (ast *Assistant) buildStandardResponse(npc *NextProcessContext) *agentContext.Response { return &agentContext.Response{ ContextID: npc.Context.ID, RequestID: npc.Context.RequestID(), diff --git a/agent/assistant/search.go b/agent/assistant/search.go index 7aae5518..c0bc05a2 100644 --- a/agent/assistant/search.go +++ b/agent/assistant/search.go @@ -17,16 +17,32 @@ import ( ) // shouldAutoSearch determines if auto search should be executed -// Returns false if: +// Returns nil if search should be skipped, otherwise returns SearchIntent with types to search +// Search is skipped if: // - opts.Skip.Search is true +// - createResponse.Search is false // - uses.search is "disabled" // - assistant has no search configuration // - needsearch intent detection returns false -func (ast *Assistant) shouldAutoSearch(ctx *context.Context, messages []context.Message, createResponse *context.HookCreateResponse, opts *context.Options) bool { +func (ast *Assistant) shouldAutoSearch(ctx *context.Context, messages []context.Message, createResponse *context.HookCreateResponse, opts *context.Options) *SearchIntent { // Check if search is skipped via options if opts != nil && opts.Skip != nil && opts.Skip.Search { ctx.Logger.Debug("Auto search skipped by opts.Skip.Search") - return false + return nil + } + + // Check createResponse.Search field (highest priority from Create hook) + // Supports: bool | SearchIntent | nil + if createResponse != nil && createResponse.Search != nil { + intent := parseSearchField(createResponse.Search) + if intent != nil { + if !intent.NeedSearch { + ctx.Logger.Info("Auto search disabled by createResponse.Search") + return nil + } + ctx.Logger.Info("Auto search controlled by createResponse.Search: types=%v", intent.SearchTypes) + return intent + } } // Get merged uses configuration @@ -35,57 +51,123 @@ func (ast *Assistant) shouldAutoSearch(ctx *context.Context, messages []context. // Check if search is explicitly disabled if uses != nil && uses.Search == "disabled" { ctx.Logger.Info("Auto search disabled by uses.search=disabled") - return false + return nil } // Check if assistant has search configuration if ast.Search == nil && (uses == nil || uses.Search == "") { - return false + return nil } // Check search intent using __yao.needsearch agent - if !ast.checkSearchIntent(ctx, messages) { + intent := ast.checkSearchIntent(ctx, messages) + if intent == nil || !intent.NeedSearch { ctx.Logger.Info("Auto search skipped: intent detection returned false") - return false + return nil } - // Check if search is enabled (builtin, agent, mcp, or empty means builtin) - return true + return intent +} + +// parseSearchField parses the Search field from HookCreateResponse +// Supports: bool | SearchIntent | map[string]any | nil +func parseSearchField(search any) *SearchIntent { + if search == nil { + return nil + } + + switch v := search.(type) { + case bool: + // bool: true = enable all, false = disable all + if v { + return &SearchIntent{ + NeedSearch: true, + SearchTypes: []string{"web", "kb", "db"}, + Confidence: 1.0, + Reason: "enabled by hook", + } + } + return &SearchIntent{ + NeedSearch: false, + SearchTypes: []string{}, + Confidence: 1.0, + Reason: "disabled by hook", + } + + case *SearchIntent: + // SearchIntent is alias for context.SearchIntent, so this covers both + return v + + case SearchIntent: + return &v + + case map[string]any: + // Parse from map (e.g., from JSON) + intent := &SearchIntent{ + NeedSearch: false, + SearchTypes: []string{}, + Confidence: 0.5, + } + + if needSearch, ok := v["need_search"].(bool); ok { + intent.NeedSearch = needSearch + } + + if types, ok := v["search_types"].([]any); ok { + for _, t := range types { + if typeStr, ok := t.(string); ok { + intent.SearchTypes = append(intent.SearchTypes, typeStr) + } + } + } + + if confidence, ok := v["confidence"].(float64); ok { + intent.Confidence = confidence + } + + if reason, ok := v["reason"].(string); ok { + intent.Reason = reason + } + + return intent + + default: + return nil + } } // checkSearchIntent uses __yao.needsearch agent to determine if search is needed -// Returns true if search is needed, false otherwise -func (ast *Assistant) checkSearchIntent(ctx *context.Context, messages []context.Message) bool { - // Get the last user message - var userQuery string - for i := len(messages) - 1; i >= 0; i-- { - if messages[i].Role == "user" { - if content, ok := messages[i].Content.(string); ok { - userQuery = content - break - } +// Returns SearchIntent with search types and confidence +func (ast *Assistant) checkSearchIntent(ctx *context.Context, messages []context.Message) *SearchIntent { + // Default intent: no search needed (fallback when agent unavailable or fails) + defaultIntent := &SearchIntent{ + NeedSearch: false, + SearchTypes: []string{}, + Confidence: 0, + } + + // Filter out system messages and pass full conversation context + var intentMessages []context.Message + for _, msg := range messages { + if msg.Role != "system" { + intentMessages = append(intentMessages, msg) } } - if userQuery == "" { - return true // No user message, proceed with search + if len(intentMessages) == 0 { + return defaultIntent // No messages, skip search } // Try to get __yao.needsearch agent needsearchAst, err := Get("__yao.needsearch") if err != nil { - ctx.Logger.Debug("__yao.needsearch agent not available: %v, proceeding with search", err) - return true // Agent not available, proceed with search + ctx.Logger.Debug("__yao.needsearch agent not available: %v, skipping search", err) + return defaultIntent // Agent not available, skip search } // === Output: Send loading message === loadingID := ast.sendIntentLoading(ctx) - // Build messages for intent detection - intentMessages := []context.Message{ - {Role: "user", Content: userQuery}, - } - // Call the needsearch agent (Stack will auto-track) // IMPORTANT: Skip search to prevent infinite loop, skip output to prevent JSON showing in UI opts := &context.Options{ @@ -98,58 +180,108 @@ func (ast *Assistant) checkSearchIntent(ctx *context.Context, messages []context result, err := needsearchAst.Stream(ctx, intentMessages, opts) if err != nil { - ctx.Logger.Debug("__yao.needsearch failed: %v, proceeding with search", err) - // === Output: Send done (error case, proceed with search) === - ast.sendIntentDone(ctx, loadingID, true, "") - return true // On error, proceed with search + ctx.Logger.Debug("__yao.needsearch failed: %v, skipping search", err) + // === Output: Send done (error case, skip search) === + ast.sendIntentDone(ctx, loadingID, false, "") + return defaultIntent // On error, skip search } // Parse the result // Next hook returns {data: {need_search: bool, search_types: [], confidence: float}} - if response, ok := result.(*context.Response); ok { - // First try to get from Next hook response - if response.Next != nil { - if nextData, ok := response.Next.(map[string]interface{}); ok { - // Check for data field (from Next hook's {data: result}) - var intentData map[string]interface{} - if data, ok := nextData["data"].(map[string]interface{}); ok { - intentData = data - } else { - intentData = nextData - } - - if needSearch, ok := intentData["need_search"].(bool); ok { - reason, _ := intentData["reason"].(string) - ctx.Logger.Debug("Search intent (from Next): need_search=%v, reason=%s", needSearch, reason) - ast.sendIntentDone(ctx, loadingID, needSearch, reason) - return needSearch - } + // First try to get from Next hook response + if result.Next != nil { + if nextData, ok := result.Next.(map[string]interface{}); ok { + // Check for data field (from Next hook's {data: result}) + var intentData map[string]interface{} + if data, ok := nextData["data"].(map[string]interface{}); ok { + intentData = data + } else { + intentData = nextData } - } - // Fallback: parse from Completion.Content if Next hook didn't process - if response.Completion != nil { - content, ok := response.Completion.Content.(string) - if !ok || content == "" { - ast.sendIntentDone(ctx, loadingID, true, "") - return true + intent := parseSearchIntent(intentData) + if intent != nil { + ctx.Logger.Debug("Search intent (from Next): need_search=%v, types=%v, confidence=%.2f, reason=%s", + intent.NeedSearch, intent.SearchTypes, intent.Confidence, intent.Reason) + ast.sendIntentDone(ctx, loadingID, intent.NeedSearch, intent.Reason) + return intent } - needSearch, reason := parseNeedSearchFromContent(content) - ctx.Logger.Debug("Search intent (from Content): need_search=%v, reason=%s", needSearch, reason) - ast.sendIntentDone(ctx, loadingID, needSearch, reason) - return needSearch } } - // Default: proceed with search if we can't parse the result + // Fallback: parse from Completion.Content if Next hook didn't process + if result.Completion != nil { + content, ok := result.Completion.Content.(string) + if !ok || content == "" { + ast.sendIntentDone(ctx, loadingID, false, "") + return defaultIntent + } + intent := parseSearchIntentFromContent(content) + ctx.Logger.Debug("Search intent (from Content): need_search=%v, types=%v, confidence=%.2f, reason=%s", + intent.NeedSearch, intent.SearchTypes, intent.Confidence, intent.Reason) + ast.sendIntentDone(ctx, loadingID, intent.NeedSearch, intent.Reason) + return intent + } + + // Default: skip search if we can't parse the result // === Output: Send done (default case) === - ast.sendIntentDone(ctx, loadingID, true, "") - return true + ast.sendIntentDone(ctx, loadingID, false, "") + return defaultIntent } -// parseNeedSearchFromContent parses need_search result from LLM completion content +// parseSearchIntent parses SearchIntent from intent data map +func parseSearchIntent(intentData map[string]interface{}) *SearchIntent { + if intentData == nil { + return nil + } + + needSearch, ok := intentData["need_search"].(bool) + if !ok { + return nil + } + + intent := &SearchIntent{ + NeedSearch: needSearch, + SearchTypes: []string{}, + Confidence: 0.5, // Default confidence + } + + // Parse search_types + if types, ok := intentData["search_types"].([]interface{}); ok { + for _, t := range types { + if typeStr, ok := t.(string); ok { + // Validate type + typeStr = strings.ToLower(typeStr) + if typeStr == "web" || typeStr == "kb" || typeStr == "db" { + intent.SearchTypes = append(intent.SearchTypes, typeStr) + } + } + } + } + + // Parse confidence + if confidence, ok := intentData["confidence"].(float64); ok { + intent.Confidence = confidence + } + + // Parse reason + if reason, ok := intentData["reason"].(string); ok { + intent.Reason = reason + } + + return intent +} + +// parseSearchIntentFromContent parses SearchIntent from LLM completion content // Handles JSON wrapped in markdown code blocks -func parseNeedSearchFromContent(content string) (bool, string) { +func parseSearchIntentFromContent(content string) *SearchIntent { + // Default intent: no search needed + defaultIntent := &SearchIntent{ + NeedSearch: false, + SearchTypes: []string{}, + Confidence: 0, + } + // Remove markdown code block if present content = strings.TrimSpace(content) if strings.HasPrefix(content, "```json") { @@ -165,17 +297,16 @@ func parseNeedSearchFromContent(content string) (bool, string) { // Try to parse JSON var result map[string]interface{} if err := json.Unmarshal([]byte(content), &result); err != nil { - // Failed to parse, default to search - return true, "" + // Failed to parse, default to no search + return defaultIntent } - needSearch, ok := result["need_search"].(bool) - if !ok { - return true, "" + intent := parseSearchIntent(result) + if intent == nil { + return defaultIntent } - reason, _ := result["reason"].(string) - return needSearch, reason + return intent } // sendIntentLoading sends the initial intent detection loading message @@ -271,10 +402,11 @@ func (ast *Assistant) getMergedSearchUses(createResponse *context.HookCreateResp return uses } -// executeAutoSearch executes auto search based on configuration +// executeAutoSearch executes auto search based on configuration and intent // Returns ReferenceContext with results and formatted context +// intent specifies which search types to execute (from needsearch agent) // opts is optional, used to check Skip.Keyword -func (ast *Assistant) executeAutoSearch(ctx *context.Context, messages []context.Message, createResponse *context.HookCreateResponse, opts ...*context.Options) *searchTypes.ReferenceContext { +func (ast *Assistant) executeAutoSearch(ctx *context.Context, messages []context.Message, createResponse *context.HookCreateResponse, intent *SearchIntent, opts ...*context.Options) *searchTypes.ReferenceContext { ctx.Logger.Phase("Search") defer ctx.Logger.PhaseComplete("Search") @@ -311,33 +443,23 @@ func (ast *Assistant) executeAutoSearch(ctx *context.Context, messages []context skipKeyword = opts[0].Skip.Keyword } - // Extract keywords for web search if: - // 1. uses.keyword is configured (not empty) - // 2. Skip.Keyword is not true - // 3. Web search is enabled - var extractedKeywords []string - webSearchEnabled := searchConfig != nil && searchConfig.Web != nil - if webSearchEnabled && !skipKeyword && searchUses.Keyword != "" { - extractor := keyword.NewExtractor(searchUses.Keyword, searchConfig.Keyword) - keywords, err := extractor.Extract(ctx, query, nil) - if err != nil { - ctx.Logger.Warn("Keyword extraction failed, using original query: %v", err) - } else if len(keywords) > 0 { - extractedKeywords = keywords - // Use extracted keywords as the search query for web search - optimizedQuery := strings.Join(keywords, " ") - ctx.Logger.Info("Extracted keywords for web search: %s -> %s", truncateString(query, 30), optimizedQuery) - query = optimizedQuery - } + // Build search requests based on configuration and intent + // Keyword extraction is done inside buildSearchRequests for web search + buildOpts := &buildSearchRequestsOptions{ + skipKeyword: skipKeyword, + usesKeyword: searchUses.Keyword, } - - // Build search requests based on configuration - requests := ast.buildSearchRequests(query, searchConfig) + requests, extractedKeywords := ast.buildSearchRequests(ctx, query, searchConfig, intent, buildOpts) if len(requests) == 0 { ctx.Logger.Info("No search requests to execute") return nil } + // Update query if keywords were extracted (for web search) + if len(extractedKeywords) > 0 { + query = keywordsToQuery(extractedKeywords) + } + // === Output: Send loading message === loadingID := ast.sendSearchLoading(ctx) @@ -435,6 +557,52 @@ func (ast *Assistant) sendSearchLoading(ctx *context.Context) string { return msgID } +// sendKeywordLoading sends the keyword extraction loading message +// Returns the message ID for later replacement +func (ast *Assistant) sendKeywordLoading(ctx *context.Context) string { + loadingMsg := i18n.T(ctx.Locale, "search.keyword.loading") + + msg := &message.Message{ + Type: "loading", + Props: map[string]any{ + "message": loadingMsg, + }, + } + + // Send and get message ID + msgID, err := ctx.SendStream(msg) + if err != nil { + ctx.Logger.Warn("Failed to send keyword loading message: %v", err) + return "" + } + + return msgID +} + +// sendKeywordDone replaces keyword loading with done message +func (ast *Assistant) sendKeywordDone(ctx *context.Context, loadingID string, success bool) { + if loadingID == "" { + return + } + + resultMsg := i18n.T(ctx.Locale, "search.keyword.done") + + msg := &message.Message{ + MessageID: loadingID, + Delta: true, + DeltaAction: message.DeltaReplace, + Type: "loading", + Props: map[string]any{ + "message": resultMsg, + "done": true, + }, + } + + if err := ctx.Send(msg); err != nil { + ctx.Logger.Warn("Failed to send keyword done message: %v", err) + } +} + // sendSearchResult replaces loading with result message (without done flag) func (ast *Assistant) sendSearchResult(ctx *context.Context, loadingID string, count int) { if loadingID == "" { @@ -564,22 +732,67 @@ func (ast *Assistant) completeSearchTrace(node traceTypes.Node, resultCount int, }) } -// buildSearchRequests builds search requests based on assistant configuration -func (ast *Assistant) buildSearchRequests(query string, config *searchTypes.Config) []*searchTypes.Request { - var requests []*searchTypes.Request +// buildSearchRequestsOptions contains options for building search requests +type buildSearchRequestsOptions struct { + skipKeyword bool // Skip keyword extraction + usesKeyword string // Keyword extractor config: "builtin", "", "mcp:." +} + +// buildSearchRequests builds search requests based on assistant configuration and intent +// intent specifies which search types to execute (from needsearch agent) +// Returns requests and extracted keywords (if any) +func (ast *Assistant) buildSearchRequests(ctx *context.Context, query string, config *searchTypes.Config, intent *SearchIntent, opts *buildSearchRequestsOptions) ([]*searchTypes.Request, []searchTypes.Keyword) { + var requests []*searchTypes.Request + var extractedKeywords []searchTypes.Keyword + + // Helper to check if a search type is allowed by intent + isTypeAllowed := func(searchType string) bool { + if intent == nil || len(intent.SearchTypes) == 0 { + return true // No intent or empty types means all types allowed + } + for _, t := range intent.SearchTypes { + if t == searchType { + return true + } + } + return false + } + + // Web search - check if web search is configured and allowed by intent + if config != nil && config.Web != nil && isTypeAllowed("web") { + webQuery := query + + // Extract keywords for web search if configured + if opts != nil && !opts.skipKeyword && opts.usesKeyword != "" { + // === Output: Send keyword extraction loading === + keywordLoadingID := ast.sendKeywordLoading(ctx) + + extractor := keyword.NewExtractor(opts.usesKeyword, config.Keyword) + keywords, err := extractor.Extract(ctx, query, nil) + if err != nil { + ctx.Logger.Warn("Keyword extraction failed, using original query: %v", err) + ast.sendKeywordDone(ctx, keywordLoadingID, false) + } else if len(keywords) > 0 { + extractedKeywords = keywords + // Use extracted keywords as the search query for web search + webQuery = keywordsToQuery(keywords) + ctx.Logger.Info("Extracted keywords for web search: %s -> %s", truncateString(query, 30), webQuery) + ast.sendKeywordDone(ctx, keywordLoadingID, true) + } else { + ast.sendKeywordDone(ctx, keywordLoadingID, true) + } + } - // Web search - check if web search is configured - if config != nil && config.Web != nil { requests = append(requests, &searchTypes.Request{ Type: searchTypes.SearchTypeWeb, - Query: query, + Query: webQuery, Source: searchTypes.SourceAuto, Limit: config.Web.MaxResults, }) } - // KB search - check if KB is configured - if ast.KB != nil && len(ast.KB.Collections) > 0 { + // KB search - check if KB is configured and allowed by intent + if ast.KB != nil && len(ast.KB.Collections) > 0 && isTypeAllowed("kb") { limit := 10 threshold := 0.7 if config != nil && config.KB != nil { @@ -589,7 +802,7 @@ func (ast *Assistant) buildSearchRequests(query string, config *searchTypes.Conf } requests = append(requests, &searchTypes.Request{ Type: searchTypes.SearchTypeKB, - Query: query, + Query: query, // KB uses original query for semantic search Source: searchTypes.SourceAuto, Limit: limit, Collections: ast.KB.Collections, @@ -598,22 +811,22 @@ func (ast *Assistant) buildSearchRequests(query string, config *searchTypes.Conf }) } - // DB search - check if DB is configured - if ast.DB != nil && len(ast.DB.Models) > 0 { + // DB search - check if DB is configured and allowed by intent + if ast.DB != nil && len(ast.DB.Models) > 0 && isTypeAllowed("db") { limit := 20 if config != nil && config.DB != nil && config.DB.MaxResults > 0 { limit = config.DB.MaxResults } requests = append(requests, &searchTypes.Request{ Type: searchTypes.SearchTypeDB, - Query: query, + Query: query, // DB uses original query for QueryDSL generation Source: searchTypes.SourceAuto, Limit: limit, Models: ast.DB.Models, }) } - return requests + return requests, extractedKeywords } // injectSearchContext injects search results into messages @@ -709,7 +922,7 @@ func truncateString(s string, maxLen int) string { // SearchExecutionResult holds all data from search execution for storage type SearchExecutionResult struct { Query string // Original query (before keyword optimization) - Keywords []string // Extracted keywords + Keywords []searchTypes.Keyword // Extracted keywords with weights Config map[string]any // Search config used RefCtx *searchTypes.ReferenceContext // Reference context with results Duration int64 // Search duration in ms @@ -717,6 +930,54 @@ type SearchExecutionResult struct { SearchType string // "auto", "web", "kb", "db" } +// keywordsToQuery converts keywords with weights to a search query string +// Keywords are sorted by weight (descending) and joined with spaces +func keywordsToQuery(keywords []searchTypes.Keyword) string { + if len(keywords) == 0 { + return "" + } + + // Sort by weight descending (higher weight first) + sorted := make([]searchTypes.Keyword, len(keywords)) + copy(sorted, keywords) + for i := 0; i < len(sorted)-1; i++ { + for j := i + 1; j < len(sorted); j++ { + if sorted[j].W > sorted[i].W { + sorted[i], sorted[j] = sorted[j], sorted[i] + } + } + } + + // Join keywords + parts := make([]string, len(sorted)) + for i, kw := range sorted { + parts[i] = kw.K + } + return strings.Join(parts, " ") +} + +// keywordsToStrings converts keywords to string slice for storage +func keywordsToStrings(keywords []searchTypes.Keyword) []string { + if len(keywords) == 0 { + return nil + } + result := make([]string, len(keywords)) + for i, kw := range keywords { + result[i] = kw.K + } + return result +} + +// containsSearchType checks if a search type is in the list +func containsSearchType(types []string, searchType string) bool { + for _, t := range types { + if t == searchType { + return true + } + } + return false +} + // saveSearch saves search results to storage // Called after search execution completes (success or failure) func (ast *Assistant) saveSearch(ctx *context.Context, execResult *SearchExecutionResult) { @@ -732,7 +993,7 @@ func (ast *Assistant) saveSearch(ctx *context.Context, execResult *SearchExecuti RequestID: ctx.RequestID(), ChatID: ctx.ChatID, Query: execResult.Query, - Keywords: execResult.Keywords, + Keywords: keywordsToStrings(execResult.Keywords), Config: execResult.Config, Source: execResult.SearchType, Duration: execResult.Duration, diff --git a/agent/assistant/search_auto_disabled_test.go b/agent/assistant/search_auto_disabled_test.go index 5ab7ced6..cc5688c8 100644 --- a/agent/assistant/search_auto_disabled_test.go +++ b/agent/assistant/search_auto_disabled_test.go @@ -77,8 +77,7 @@ func TestSearchAutoDisabled(t *testing.T) { require.NoError(t, err) require.NotNil(t, response) - resp := response.(*context.Response) - assert.NotNil(t, resp.Completion, "should have completion") + assert.NotNil(t, response.Completion, "should have completion") t.Logf("✓ Stream executed without search (disabled)") }) } diff --git a/agent/assistant/search_auto_full_test.go b/agent/assistant/search_auto_full_test.go index 204d46d9..e4bc8e84 100644 --- a/agent/assistant/search_auto_full_test.go +++ b/agent/assistant/search_auto_full_test.go @@ -118,8 +118,7 @@ func TestSearchAutoFull(t *testing.T) { } require.NotNil(t, response) - resp := response.(*context.Response) - assert.NotNil(t, resp.Completion, "should have completion") + assert.NotNil(t, response.Completion, "should have completion") t.Logf("✓ Stream executed with full search config (Web + KB + DB)") }) } diff --git a/agent/assistant/search_auto_hook_disable_test.go b/agent/assistant/search_auto_hook_disable_test.go index fed6c8cd..23c8285f 100644 --- a/agent/assistant/search_auto_hook_disable_test.go +++ b/agent/assistant/search_auto_hook_disable_test.go @@ -101,8 +101,7 @@ func TestSearchAutoHookDisable(t *testing.T) { require.NoError(t, err) require.NotNil(t, response) - resp := response.(*context.Response) - assert.NotNil(t, resp.Completion, "should have completion") + assert.NotNil(t, response.Completion, "should have completion") t.Logf("✓ Stream executed with hook disabling search") }) } diff --git a/agent/assistant/search_auto_keyword_test.go b/agent/assistant/search_auto_keyword_test.go index d5e2a1b0..c6c3d76b 100644 --- a/agent/assistant/search_auto_keyword_test.go +++ b/agent/assistant/search_auto_keyword_test.go @@ -87,8 +87,7 @@ func TestSearchAutoKeyword(t *testing.T) { } require.NotNil(t, response) - resp := response.(*context.Response) - assert.NotNil(t, resp.Completion, "should have completion") + assert.NotNil(t, response.Completion, "should have completion") t.Logf("✓ Stream with keyword extraction executed successfully") }) @@ -127,8 +126,7 @@ func TestSearchAutoKeyword(t *testing.T) { } require.NotNil(t, response) - resp := response.(*context.Response) - assert.NotNil(t, resp.Completion, "should have completion") + assert.NotNil(t, response.Completion, "should have completion") t.Logf("✓ Stream with Skip.Keyword executed successfully") }) } @@ -179,8 +177,7 @@ func TestSearchAutoKeywordNotConfigured(t *testing.T) { } require.NotNil(t, response) - resp := response.(*context.Response) - assert.NotNil(t, resp.Completion, "should have completion") + assert.NotNil(t, response.Completion, "should have completion") t.Logf("✓ Stream without keyword config executed successfully") }) } diff --git a/agent/assistant/search_auto_web_test.go b/agent/assistant/search_auto_web_test.go index 22ec0896..630151e3 100644 --- a/agent/assistant/search_auto_web_test.go +++ b/agent/assistant/search_auto_web_test.go @@ -96,8 +96,7 @@ func TestSearchAutoWeb(t *testing.T) { } require.NotNil(t, response) - resp := response.(*context.Response) - assert.NotNil(t, resp.Completion, "should have completion") + assert.NotNil(t, response.Completion, "should have completion") t.Logf("✓ Stream executed successfully with auto search") }) } diff --git a/agent/assistant/types.go b/agent/assistant/types.go index f5a39b44..3780d4b7 100644 --- a/agent/assistant/types.go +++ b/agent/assistant/types.go @@ -85,6 +85,10 @@ type NextProcessContext struct { CreateResponse *chatctx.HookCreateResponse // Create hook response } +// SearchIntent is an alias for context.SearchIntent +// Used for search intent detection from __yao.needsearch agent +type SearchIntent = chatctx.SearchIntent + // ParsedContent extracts the actual tool return value from MCP ToolContent array // According to MCP protocol: // - Content is []ToolContent array diff --git a/agent/caller/caller.go b/agent/caller/caller.go index fb4d2049..229e5c3f 100644 --- a/agent/caller/caller.go +++ b/agent/caller/caller.go @@ -9,7 +9,7 @@ import ( // AgentCaller interface for calling agents (to avoid circular dependency) // Used by content handlers (vision, audio, etc.) and search handlers (agent mode) type AgentCaller interface { - Stream(ctx *agentContext.Context, messages []agentContext.Message, options ...*agentContext.Options) (interface{}, error) + Stream(ctx *agentContext.Context, messages []agentContext.Message, options ...*agentContext.Options) (*agentContext.Response, error) } // AgentGetterFunc is a function type that gets an agent by ID diff --git a/agent/content/tools.go b/agent/content/tools.go index cc9d7787..b4fc6468 100644 --- a/agent/content/tools.go +++ b/agent/content/tools.go @@ -42,10 +42,10 @@ func CallAgent(ctx *agentContext.Context, agentID string, message agentContext.M // Extract text from agent response // Two formats are supported: - // 1. Custom Hook response (from Next hook) - // 2. Standard Agent Stream response (LLM completion) + // 1. Custom Hook response (from Next hook) - response.Next + // 2. Standard Agent Stream response (LLM completion) - response.Completion - return extractTextFromAgentResponse(response) + return extractTextFromResponse(response) } // CallAgentWithFileInfo calls an agent to process content with file metadata @@ -120,116 +120,63 @@ func CallAgentWithFileInfo(ctx *agentContext.Context, agentID string, message ag return CallAgent(ctx, agentID, message) } -// extractTextFromAgentResponse extracts text from agent response -// Handles two main response formats from agent.Stream(): -// -// 1. Standard Response (No Next Hook or Next Hook returns nil): -// Structure: { completion: { content: "text" | [...ContentPart] } } -// Action: Extract text from completion.content field -// -// 2. Next Hook Response with Custom Data: -// Structure: { next: } -// Action: -// - If next is string → return directly -// - If next is map/object → JSON stringify and return -// - This preserves the complete custom data structure from the hook +// extractTextFromResponse extracts text from agent response +// Now that agent.Stream() returns *agentContext.Response directly, +// we can access fields without type assertions or JSON conversion. // // Priority: -// 1. Check for "next" field (custom hook data) → return complete data -// 2. Check for "completion" field (standard LLM response) → extract text only -// 3. Fallback to direct string or JSON stringify -func extractTextFromAgentResponse(response interface{}) (string, error) { +// 1. Check response.Next (custom hook data) → return complete data +// 2. Check response.Completion (standard LLM response) → extract text only +func extractTextFromResponse(response *agentContext.Response) (string, error) { if response == nil { return "", fmt.Errorf("agent returned nil response") } - // First, try to convert to map if it's a struct - // agent.Stream() may return *agentContext.Response which needs to be converted - var responseMap map[string]interface{} - - // Check if it's already a map - if rm, ok := response.(map[string]interface{}); ok { - responseMap = rm - } else { - // Try to marshal and unmarshal to convert struct to map - jsonBytes, err := jsoniter.Marshal(response) - if err != nil { - // If it's a plain string, return directly - if responseStr, ok := response.(string); ok { - return responseStr, nil - } - return "", fmt.Errorf("failed to serialize agent response: %w", err) - } - - // Unmarshal to map - if err := jsoniter.Unmarshal(jsonBytes, &responseMap); err != nil { - // If unmarshal fails, return the JSON string - return string(jsonBytes), nil - } - } - - // Priority 1: Check for "next" field (custom hook data) - // If Next hook returns custom data, it's stored in the "next" field - // Return the complete custom data structure (preserve hook's intent) - if next, hasNext := responseMap["next"]; hasNext && next != nil { + // Priority 1: Check Next field (custom hook data) + // If Next hook returns custom data, return the complete structure + if response.Next != nil { // If next is a string, return directly - if nextStr, ok := next.(string); ok { + if nextStr, ok := response.Next.(string); ok { return nextStr, nil } // Otherwise, JSON stringify to preserve complete structure - jsonBytes, err := jsoniter.Marshal(next) + jsonBytes, err := jsoniter.Marshal(response.Next) if err != nil { return "", fmt.Errorf("failed to serialize next hook data: %w", err) } return string(jsonBytes), nil } - // Priority 2: Check for "completion" field (standard LLM response) + // Priority 2: Check Completion field (standard LLM response) // Extract text content from the LLM completion - if completion, hasCompletion := responseMap["completion"]; hasCompletion && completion != nil { - if completionMap, ok := completion.(map[string]interface{}); ok { - // Extract content from completion - if content, hasContent := completionMap["content"]; hasContent { - // Content can be string or []ContentPart (multimodal) - switch v := content.(type) { - case string: - // Simple text content - return v, nil - case []interface{}: - // Multimodal content array - extract all text parts - var text string - for _, part := range v { - if partMap, ok := part.(map[string]interface{}); ok { - if partType, _ := partMap["type"].(string); partType == "text" { - if textContent, ok := partMap["text"].(string); ok { - text += textContent - } - } + if response.Completion != nil { + // Content can be string or []ContentPart (multimodal) + switch v := response.Completion.Content.(type) { + case string: + // Simple text content + return v, nil + case []interface{}: + // Multimodal content array - extract all text parts + var text string + for _, part := range v { + if partMap, ok := part.(map[string]interface{}); ok { + if partType, _ := partMap["type"].(string); partType == "text" { + if textContent, ok := partMap["text"].(string); ok { + text += textContent } } - if text != "" { - return text, nil - } - // No text found in content parts - return "", fmt.Errorf("no text content found in completion content parts") } } + if text != "" { + return text, nil + } + // No text found in content parts + return "", fmt.Errorf("no text content found in completion content parts") } } - // Fallback: Try to find a "content" field directly (shouldn't happen normally) - if content, hasContent := responseMap["content"]; hasContent { - if contentStr, ok := content.(string); ok { - return contentStr, nil - } - } - - // Last resort: JSON stringify the entire response - jsonBytes, err := jsoniter.Marshal(response) - if err != nil { - return "", fmt.Errorf("failed to serialize agent response: %w", err) - } - return string(jsonBytes), nil + // No content found + return "", fmt.Errorf("no content found in agent response") } // CallMCPTool calls an MCP tool to process content diff --git a/agent/context/options.go b/agent/context/options.go index b6aa7952..35b84ece 100644 --- a/agent/context/options.go +++ b/agent/context/options.go @@ -16,7 +16,7 @@ func (opts *Options) ToMap() map[string]interface{} { result["mode"] = opts.Mode } if opts.Search != nil { - result["search"] = *opts.Search + result["search"] = opts.Search } if opts.Skip != nil { result["skip"] = opts.Skip @@ -25,6 +25,9 @@ func (opts *Options) ToMap() map[string]interface{} { if opts.DisableGlobalPrompts { result["disable_global_prompts"] = opts.DisableGlobalPrompts } + if opts.Metadata != nil { + result["metadata"] = opts.Metadata + } // Note: Runtime fields (Context, Writer) are not serialized (json:"-") // They should not be included in the map @@ -47,8 +50,9 @@ func OptionsFromMap(m map[string]interface{}) *Options { if mode, ok := m["mode"].(string); ok { opts.Mode = mode } - if search, ok := m["search"].(bool); ok { - opts.Search = &search + // Search supports: bool | SearchIntent | map[string]any | nil + if search := m["search"]; search != nil { + opts.Search = search } if skipMap, ok := m["skip"].(map[string]interface{}); ok { skip := &Skip{} @@ -66,6 +70,9 @@ func OptionsFromMap(m map[string]interface{}) *Options { if disableGlobalPrompts, ok := m["disable_global_prompts"].(bool); ok { opts.DisableGlobalPrompts = disableGlobalPrompts } + if metadata, ok := m["metadata"].(map[string]interface{}); ok { + opts.Metadata = metadata + } // Note: Context and Writer are runtime fields, not restored from map // They should be set by the caller if needed diff --git a/agent/context/types.go b/agent/context/types.go index b41a3e87..025f5eab 100644 --- a/agent/context/types.go +++ b/agent/context/types.go @@ -266,6 +266,15 @@ type Context struct { Metadata map[string]interface{} `json:"metadata,omitempty"` // The metadata of the request, it will be used to pass data to the page } +// SearchIntent represents the result of search intent detection +// Used by Create hook to specify fine-grained search behavior +type SearchIntent struct { + NeedSearch bool `json:"need_search"` // Whether search is needed + SearchTypes []string `json:"search_types,omitempty"` // Types of search to perform: "web", "kb", "db" + Confidence float64 `json:"confidence,omitempty"` // Confidence level (0-1) + Reason string `json:"reason,omitempty"` // Reason for the decision +} + // Options represents the options for the context type Options struct { @@ -284,11 +293,17 @@ type Options struct { // Disable global prompts, default is false DisableGlobalPrompts bool `json:"disable_global_prompts,omitempty"` // Temporarily disable global prompts for this request - // Search mode, default is true - Search *bool `json:"search,omitempty"` // Search mode, default is true + // Search controls search behavior, supports multiple types: + // - bool: true = enable all search types, false = disable all search + // - SearchIntent: fine-grained control with specific types, confidence, etc. + // - nil: use default behavior (determined by __yao.needsearch agent) + Search any `json:"search,omitempty"` // Search mode: bool | SearchIntent | nil // Agent mode, use to select the mode of the request, default is "chat" Mode string `json:"mode,omitempty"` // Agent mode, use to select the mode of the request, default is "chat" + + // Metadata for passing custom data to hooks (e.g., scenario selection) + Metadata map[string]any `json:"metadata,omitempty"` // Custom metadata passed to Create/Next hooks } // Stack represents the call stack node for tracing agent-to-agent calls @@ -369,6 +384,12 @@ type HookCreateResponse struct { // ForceUses controls whether to force using Uses tools even when model has native capabilities ForceUses *bool `json:"force_uses,omitempty"` // Force using Uses tools regardless of model capabilities + + // Search controls search behavior, supports multiple types: + // - bool: true = enable all search types, false = disable all search + // - SearchIntent: fine-grained control with specific types, confidence, etc. + // - nil: use default behavior (determined by __yao.needsearch agent) + Search any `json:"search,omitempty"` // Search mode: bool | SearchIntent | nil } // NextHookPayload payload for the next hook diff --git a/agent/i18n/builtin.go b/agent/i18n/builtin.go index 78a6e6b9..e6aee7bb 100644 --- a/agent/i18n/builtin.go +++ b/agent/i18n/builtin.go @@ -112,6 +112,10 @@ func init() { "search.intent.need_search": "Searching for references...", "search.intent.no_search": "No references needed", + // Keyword Extraction: assistant/search.go - Keyword extraction messages + "search.keyword.loading": "Analyzing conversation...", + "search.keyword.done": "Analysis complete", + // Search: assistant/search.go - Trace labels "search.trace.label": "Search", "search.trace.description": "Search the web and knowledge base for relevant information", @@ -201,6 +205,10 @@ func init() { "search.intent.need_search": "正在查询相关资料...", "search.intent.no_search": "无需查询资料", + // Keyword Extraction: assistant/search.go - Keyword extraction messages + "search.keyword.loading": "正在分析对话内容...", + "search.keyword.done": "分析完成", + // Search: assistant/search.go - Trace labels "search.trace.label": "搜索", "search.trace.description": "搜索网络和知识库获取相关信息", @@ -318,6 +326,10 @@ func init() { "search.intent.need_search": "正在查询相关资料...", "search.intent.no_search": "无需查询资料", + // Keyword Extraction: assistant/search.go - Keyword extraction messages + "search.keyword.loading": "正在分析对话内容...", + "search.keyword.done": "分析完成", + // Search: assistant/search.go - Trace labels "search.trace.label": "搜索", "search.trace.description": "搜索网络和知识库获取相关信息", diff --git a/agent/llm/providers/openai/openai.go b/agent/llm/providers/openai/openai.go index fb46844a..09200f6e 100644 --- a/agent/llm/providers/openai/openai.go +++ b/agent/llm/providers/openai/openai.go @@ -637,11 +637,25 @@ func (p *Provider) streamWithRetry(ctx *context.Context, messages []context.Mess errorDetected := false // Wrap streamHandler to detect JSON error responses + // Note: API error responses are raw JSON without "data: " prefix + // Normal SSE data always starts with "data: " prefix wrappedHandler := func(data []byte) int { dataStr := string(data) + trimmed := strings.TrimSpace(dataStr) - // Detect if this looks like a JSON error response (starts with "{" or contains "error") - if strings.Contains(dataStr, `"error"`) || (strings.TrimSpace(dataStr) == "{" && !errorDetected) { + // Skip empty lines + if trimmed == "" { + return http.HandlerReturnOk + } + + // Normal SSE data starts with "data: " - pass to streamHandler + if strings.HasPrefix(dataStr, "data: ") { + return streamHandler(data) + } + + // Detect if this looks like a JSON error response (raw JSON without "data: " prefix) + // API errors are returned as raw JSON: {"error": {...}} + if strings.HasPrefix(trimmed, "{") && strings.Contains(dataStr, `"error"`) { errorDetected = true } @@ -652,7 +666,7 @@ func (p *Provider) streamWithRetry(ctx *context.Context, messages []context.Mess return http.HandlerReturnOk } - // Otherwise, use normal handler + // Unknown format, pass to streamHandler (it will skip non-SSE data) return streamHandler(data) } diff --git a/agent/load.go b/agent/load.go index 7ff19d21..dd168c5e 100644 --- a/agent/load.go +++ b/agent/load.go @@ -209,10 +209,14 @@ func initAssistant() error { // Set global Uses configuration if agentDSL.Uses != nil { globalUses := &context.Uses{ - Vision: agentDSL.Uses.Vision, - Audio: agentDSL.Uses.Audio, - Search: agentDSL.Uses.Search, - Fetch: agentDSL.Uses.Fetch, + Vision: agentDSL.Uses.Vision, + Audio: agentDSL.Uses.Audio, + Search: agentDSL.Uses.Search, + Fetch: agentDSL.Uses.Fetch, + Web: agentDSL.Uses.Web, + Keyword: agentDSL.Uses.Keyword, + QueryDSL: agentDSL.Uses.QueryDSL, + Rerank: agentDSL.Uses.Rerank, } assistant.SetGlobalUses(globalUses) } diff --git a/agent/search/handlers/db/handler.go b/agent/search/handlers/db/handler.go index 4736ff24..a728d39e 100644 --- a/agent/search/handlers/db/handler.go +++ b/agent/search/handlers/db/handler.go @@ -1,8 +1,15 @@ package db import ( + "encoding/json" + "fmt" "time" + "github.com/yaoapp/gou/model" + "github.com/yaoapp/gou/query" + "github.com/yaoapp/gou/query/gou" + agentContext "github.com/yaoapp/yao/agent/context" + "github.com/yaoapp/yao/agent/search/nlp/querydsl" "github.com/yaoapp/yao/agent/search/types" ) @@ -23,8 +30,13 @@ func (h *Handler) Type() types.SearchType { } // Search converts NL to QueryDSL and executes -// TODO: Implement actual QueryDSL generation and model query logic +// Note: This method doesn't have context, use SearchWithContext for full functionality func (h *Handler) Search(req *types.Request) (*types.Result, error) { + return h.SearchWithContext(nil, req) +} + +// SearchWithContext executes DB search with context (required for QueryDSL generation) +func (h *Handler) SearchWithContext(ctx *agentContext.Context, req *types.Request) (*types.Result, error) { start := time.Now() // Validate request @@ -41,13 +53,13 @@ func (h *Handler) Search(req *types.Request) (*types.Result, error) { } // Get models from request or config - models := req.Models - if len(models) == 0 && h.config != nil { - models = h.config.Models + modelIDs := req.Models + if len(modelIDs) == 0 && h.config != nil { + modelIDs = h.config.Models } // If no models specified, return empty result - if len(models) == 0 { + if len(modelIDs) == 0 { return &types.Result{ Type: types.SearchTypeDB, Query: req.Query, @@ -55,6 +67,7 @@ func (h *Handler) Search(req *types.Request) (*types.Result, error) { Items: []*types.ResultItem{}, Total: 0, Duration: time.Since(start).Milliseconds(), + Error: "no models specified", }, nil } @@ -67,27 +80,300 @@ func (h *Handler) Search(req *types.Request) (*types.Result, error) { maxResults = 20 // default } - // TODO: Implement actual DB search - // 1. Get model schemas for specified models - // 2. Generate QueryDSL from natural language query using uses.querydsl mode: - // - "builtin": template-based generation - // - "": delegate to LLM assistant - // - "mcp:.": call external MCP tool - // 3. Execute QueryDSL on each model - // 4. Format results and return + // Context is required for QueryDSL generation + if ctx == nil { + return &types.Result{ + Type: types.SearchTypeDB, + Query: req.Query, + Source: req.Source, + Items: []*types.ResultItem{}, + Total: 0, + Duration: time.Since(start).Milliseconds(), + Error: "context is required for DB search", + }, nil + } - // For now, return empty result (skeleton) - result := &types.Result{ + // 1. Load all models and build combined schema + models := make(map[string]*model.Model) + schemas := make([]map[string]interface{}, 0, len(modelIDs)) + + for _, modelID := range modelIDs { + mod, err := model.Get(modelID) + if err != nil { + continue // Skip non-existent models + } + models[modelID] = mod + schemas = append(schemas, h.buildModelSchema(mod)) + } + + if len(schemas) == 0 { + return &types.Result{ + Type: types.SearchTypeDB, + Query: req.Query, + Source: req.Source, + Items: []*types.ResultItem{}, + Total: 0, + Duration: time.Since(start).Milliseconds(), + Error: "no valid models found", + }, nil + } + + // 2. Generate QueryDSL with all schemas + generator := querydsl.NewGenerator(h.usesQueryDSL, nil) + input := &querydsl.Input{ + Query: req.Query, + ModelIDs: modelIDs, + Scenario: req.Scenario, // Pass scenario: filter, aggregation, join, complex + Limit: maxResults, + } + + // Build schema input: single schema or array of schemas + var schemaInput interface{} + if len(schemas) == 1 { + schemaInput = schemas[0] + } else { + schemaInput = schemas + } + + input.ExtraParams = map[string]interface{}{ + "schema": schemaInput, + } + + result, err := generator.Generate(ctx, input) + if err != nil { + return &types.Result{ + Type: types.SearchTypeDB, + Query: req.Query, + Source: req.Source, + Items: []*types.ResultItem{}, + Total: 0, + Duration: time.Since(start).Milliseconds(), + Error: fmt.Sprintf("QueryDSL generation failed: %v", err), + }, nil + } + + if result == nil || result.DSL == nil { + return &types.Result{ + Type: types.SearchTypeDB, + Query: req.Query, + Source: req.Source, + Items: []*types.ResultItem{}, + Total: 0, + Duration: time.Since(start).Milliseconds(), + Error: "no QueryDSL generated", + }, nil + } + + // 3. Merge preset conditions into generated DSL + h.mergeDSLConditions(result.DSL, req) + + // 4. Execute QueryDSL using gou query engine + records, err := h.executeDSL(result.DSL) + if err != nil { + return &types.Result{ + Type: types.SearchTypeDB, + Query: req.Query, + Source: req.Source, + Items: []*types.ResultItem{}, + Total: 0, + Duration: time.Since(start).Milliseconds(), + Error: fmt.Sprintf("query execution failed: %v", err), + }, nil + } + + // 5. Determine the primary model for result formatting + // Use the "from" table from DSL, or first model + primaryModelID := modelIDs[0] + if result.DSL.From != nil && result.DSL.From.Name != "" { + // Find model by table name + for id, mod := range models { + if mod.MetaData.Table.Name == result.DSL.From.Name { + primaryModelID = id + break + } + } + } + + primaryModel := models[primaryModelID] + if primaryModel == nil { + primaryModel, _ = model.Get(primaryModelID) // May be nil, that's ok + } + + // 6. Convert records to ResultItems + items := h.convertToResultItems(records, primaryModelID, primaryModel, req.Source) + + // Apply limit + if len(items) > maxResults { + items = items[:maxResults] + } + + return &types.Result{ Type: types.SearchTypeDB, Query: req.Query, Source: req.Source, - Items: []*types.ResultItem{}, - Total: 0, + Items: items, + Total: len(items), Duration: time.Since(start).Milliseconds(), + }, nil +} + +// mergeDSLConditions merges preset conditions from request into generated DSL +func (h *Handler) mergeDSLConditions(dsl *gou.QueryDSL, req *types.Request) { + if dsl == nil { + return } - // Store maxResults for later use - _ = maxResults + // Merge preset Wheres (prepend to ensure they take priority) + if len(req.Wheres) > 0 { + dsl.Wheres = append(req.Wheres, dsl.Wheres...) + } - return result, nil + // Merge preset Orders (prepend to ensure they take priority) + if len(req.Orders) > 0 { + dsl.Orders = append(req.Orders, dsl.Orders...) + } + + // Merge preset Select fields + if len(req.Select) > 0 { + // Convert string fields to Expression + selectExprs := make([]gou.Expression, 0, len(req.Select)) + for _, field := range req.Select { + selectExprs = append(selectExprs, gou.Expression{Field: field}) + } + // If DSL has no select, use preset; otherwise merge + if len(dsl.Select) == 0 { + dsl.Select = selectExprs + } else { + // Prepend preset fields + dsl.Select = append(selectExprs, dsl.Select...) + } + } + + // Ensure limit is set + if dsl.Limit == 0 && req.Limit > 0 { + dsl.Limit = req.Limit + } +} + +// buildModelSchema builds a simplified schema for QueryDSL generator +func (h *Handler) buildModelSchema(mod *model.Model) map[string]interface{} { + columns := make([]map[string]interface{}, 0, len(mod.Columns)) + for _, col := range mod.Columns { + colInfo := map[string]interface{}{ + "name": col.Name, + "type": col.Type, + } + if col.Label != "" { + colInfo["label"] = col.Label + } + if col.Description != "" { + colInfo["description"] = col.Description + } + columns = append(columns, colInfo) + } + + return map[string]interface{}{ + "name": mod.MetaData.Table.Name, + "columns": columns, + } +} + +// executeDSL executes the QueryDSL and returns records +func (h *Handler) executeDSL(dsl interface{}) ([]map[string]interface{}, error) { + // Get the default query engine + engine, err := query.Select("default") + if err != nil { + return nil, fmt.Errorf("query engine not found: %w", err) + } + + // Marshal DSL to JSON + dslJSON, err := json.Marshal(dsl) + if err != nil { + return nil, fmt.Errorf("failed to marshal DSL: %w", err) + } + + // Load and execute the query + q, err := engine.Load(json.RawMessage(dslJSON)) + if err != nil { + return nil, fmt.Errorf("failed to load DSL: %w", err) + } + + // Execute query + rawRecords := q.Get(nil) + + // Convert to map[string]interface{} + records := make([]map[string]interface{}, 0, len(rawRecords)) + for _, rec := range rawRecords { + records = append(records, map[string]interface{}(rec)) + } + + return records, nil +} + +// convertToResultItems converts query results to ResultItems +func (h *Handler) convertToResultItems(records []map[string]interface{}, modelID string, mod *model.Model, source types.SourceType) []*types.ResultItem { + items := make([]*types.ResultItem, 0, len(records)) + + primaryKey := "id" + if mod != nil && mod.PrimaryKey != "" { + primaryKey = mod.PrimaryKey + } + + for _, rec := range records { + item := &types.ResultItem{ + Type: types.SearchTypeDB, + Source: source, + Model: modelID, + Data: rec, + } + + // Try to extract title from common fields + item.Title = h.extractTitle(rec, mod) + + // Try to extract content/description + item.Content = h.extractContent(rec, mod) + + // Try to extract record ID + if id, ok := rec[primaryKey]; ok { + item.RecordID = id + } + + items = append(items, item) + } + + return items +} + +// extractTitle tries to extract a title from the record +func (h *Handler) extractTitle(rec map[string]interface{}, mod *model.Model) string { + // Common title fields + titleFields := []string{"title", "name", "subject", "label"} + for _, field := range titleFields { + if val, ok := rec[field]; ok { + if str, ok := val.(string); ok && str != "" { + return str + } + } + } + return "" +} + +// extractContent tries to extract content from the record +func (h *Handler) extractContent(rec map[string]interface{}, mod *model.Model) string { + // Common content fields + contentFields := []string{"content", "description", "summary", "text", "body"} + for _, field := range contentFields { + if val, ok := rec[field]; ok { + if str, ok := val.(string); ok && str != "" { + return str + } + } + } + + // Fallback: serialize first few fields as content + content, _ := json.Marshal(rec) + if len(content) > 500 { + content = content[:500] + } + return string(content) } diff --git a/agent/search/handlers/db/handler_integration_test.go b/agent/search/handlers/db/handler_integration_test.go new file mode 100644 index 00000000..ea807698 --- /dev/null +++ b/agent/search/handlers/db/handler_integration_test.go @@ -0,0 +1,221 @@ +package db_test + +import ( + "testing" + + "github.com/yaoapp/gou/model" + "github.com/yaoapp/gou/query/gou" + "github.com/yaoapp/yao/agent/context" + "github.com/yaoapp/yao/agent/search/handlers/db" + "github.com/yaoapp/yao/agent/search/types" + "github.com/yaoapp/yao/agent/testutils" + oauthTypes "github.com/yaoapp/yao/openapi/oauth/types" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +// ============================================================================ +// Integration Tests - Requires database and models +// ============================================================================ + +func TestHandler_Search_Integration(t *testing.T) { + // Skip if running short tests + if testing.Short() { + t.Skip("Skipping integration test") + } + + // Initialize test environment (loads models, database, query engine, etc.) + testutils.Prepare(t) + defer testutils.Clean(t) + + // Create test context + ctx := newTestContext(t) + + // Verify __yao.role model is loaded + mod := model.Select("__yao.role") + require.NotNil(t, mod, "__yao.role model should be loaded") + + t.Run("search_role_model_with_results", func(t *testing.T) { + // First, ensure there's at least one role in the database + ensureTestRole(t, mod) + + // Create handler with builtin QueryDSL generator + h := db.NewHandler("builtin", &types.DBConfig{ + Models: []string{"__yao.role"}, + MaxResults: 10, + }) + + req := &types.Request{ + Type: types.SearchTypeDB, + Query: "查询所有角色", + Source: types.SourceAuto, + Models: []string{"__yao.role"}, + Scenario: types.ScenarioFilter, + Limit: 10, + } + + result, err := h.SearchWithContext(ctx, req) + require.NoError(t, err) + require.NotNil(t, result) + + // Verify result structure + assert.Equal(t, types.SearchTypeDB, result.Type) + assert.Equal(t, "查询所有角色", result.Query) + assert.Equal(t, types.SourceAuto, result.Source) + assert.GreaterOrEqual(t, result.Duration, int64(0)) + + // Should have results + if result.Error != "" { + t.Logf("Search error: %s", result.Error) + } + assert.Empty(t, result.Error, "Search should not return error") + assert.Greater(t, len(result.Items), 0, "Should have at least one result") + assert.Equal(t, len(result.Items), result.Total) + + // Verify result items + for _, item := range result.Items { + assert.Equal(t, types.SearchTypeDB, item.Type) + assert.Equal(t, types.SourceAuto, item.Source) + assert.Equal(t, "__yao.role", item.Model) + assert.NotNil(t, item.Data, "Data should not be nil") + assert.NotNil(t, item.RecordID, "RecordID should not be nil") + } + }) + + t.Run("search_with_filter_scenario", func(t *testing.T) { + h := db.NewHandler("builtin", nil) + + req := &types.Request{ + Type: types.SearchTypeDB, + Query: "查询系统角色", + Source: types.SourceHook, + Models: []string{"__yao.role"}, + Scenario: types.ScenarioFilter, + Limit: 5, + } + + result, err := h.SearchWithContext(ctx, req) + require.NoError(t, err) + require.NotNil(t, result) + + assert.Equal(t, types.SearchTypeDB, result.Type) + assert.Equal(t, types.SourceHook, result.Source) + assert.LessOrEqual(t, len(result.Items), 5, "Should respect limit") + }) + + t.Run("search_with_preset_wheres", func(t *testing.T) { + h := db.NewHandler("builtin", nil) + + req := &types.Request{ + Type: types.SearchTypeDB, + Query: "查询角色", + Source: types.SourceAuto, + Models: []string{"__yao.role"}, + Wheres: []gou.Where{ + {Condition: gou.Condition{Field: &gou.Expression{Field: "is_active"}, Value: true, OP: "="}}, + }, + Limit: 10, + } + + result, err := h.SearchWithContext(ctx, req) + require.NoError(t, err) + require.NotNil(t, result) + + // All results should have is_active = true (due to preset where) + for _, item := range result.Items { + if data, ok := item.Data["is_active"]; ok { + // is_active could be bool or int depending on driver + switch v := data.(type) { + case bool: + assert.True(t, v) + case int64: + assert.Equal(t, int64(1), v) + case float64: + assert.Equal(t, float64(1), v) + } + } + } + }) + + t.Run("search_nonexistent_model_graceful", func(t *testing.T) { + h := db.NewHandler("builtin", nil) + + req := &types.Request{ + Type: types.SearchTypeDB, + Query: "查询文章", + Source: types.SourceAuto, + Models: []string{"nonexistent_model", "article", "fake_model"}, + Limit: 10, + } + + // Should NOT panic, should return gracefully with error + result, err := h.SearchWithContext(ctx, req) + require.NoError(t, err) + require.NotNil(t, result) + + // Should have error message about no valid models + assert.Equal(t, types.SearchTypeDB, result.Type) + assert.Equal(t, "no valid models found", result.Error) + assert.Empty(t, result.Items) + }) + + t.Run("search_mixed_models_partial_exist", func(t *testing.T) { + h := db.NewHandler("builtin", nil) + + req := &types.Request{ + Type: types.SearchTypeDB, + Query: "查询角色", + Source: types.SourceAuto, + Models: []string{"nonexistent_model", "__yao.role", "fake_model"}, // Only __yao.role exists + Limit: 10, + } + + // Should NOT panic, should work with the existing model + result, err := h.SearchWithContext(ctx, req) + require.NoError(t, err) + require.NotNil(t, result) + + // Should succeed with partial models + assert.Equal(t, types.SearchTypeDB, result.Type) + if result.Error == "" { + // If no error, should have results from __yao.role + assert.GreaterOrEqual(t, len(result.Items), 0) + } + }) +} + +// newTestContext creates a test context with required fields +func newTestContext(t *testing.T) *context.Context { + t.Helper() + authorized := &oauthTypes.AuthorizedInfo{ + UserID: "test-user", + } + chatID := "test-chat-db-search" + ctx := context.New(t.Context(), authorized, chatID) + return ctx +} + +// ensureTestRole ensures there's at least one role in the database for testing +func ensureTestRole(t *testing.T, mod *model.Model) { + t.Helper() + + // Try to find existing roles + rows, err := mod.Get(model.QueryParam{Limit: 1}) + if err == nil && len(rows) > 0 { + return // Already have roles + } + + // Create a test role + _, err = mod.Create(map[string]interface{}{ + "role_id": "test_role", + "name": "Test Role", + "description": "A test role for unit testing", + "is_active": true, + "is_system": false, + "level": 1, + }) + if err != nil { + t.Logf("Note: Could not create test role: %v", err) + } +} diff --git a/agent/search/handlers/db/handler_test.go b/agent/search/handlers/db/handler_test.go index 0ca5e4e5..67a91346 100644 --- a/agent/search/handlers/db/handler_test.go +++ b/agent/search/handlers/db/handler_test.go @@ -4,6 +4,8 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/yaoapp/gou/model" + "github.com/yaoapp/gou/query/gou" "github.com/yaoapp/yao/agent/search/types" ) @@ -38,14 +40,13 @@ func TestHandler_Type(t *testing.T) { assert.Equal(t, types.SearchTypeDB, h.Type()) } -func TestHandler_Search(t *testing.T) { +func TestHandler_Search_Validation(t *testing.T) { tests := []struct { name string usesQueryDSL string config *types.DBConfig req *types.Request expectError string - expectItems int }{ { name: "empty query", @@ -56,7 +57,6 @@ func TestHandler_Search(t *testing.T) { Query: "", }, expectError: "query is required", - expectItems: 0, }, { name: "no models in request or config", @@ -66,92 +66,20 @@ func TestHandler_Search(t *testing.T) { Type: types.SearchTypeDB, Query: "find products under $100", }, - expectError: "", - expectItems: 0, + expectError: "no models specified", }, { - name: "models from config", + name: "context required for DB search", usesQueryDSL: "builtin", config: &types.DBConfig{ - Models: []string{"product"}, - MaxResults: 20, + Models: []string{"product"}, }, - req: &types.Request{ - Type: types.SearchTypeDB, - Query: "find products under $100", - }, - expectError: "", - expectItems: 0, // skeleton returns empty - }, - { - name: "models from request", - usesQueryDSL: "builtin", - config: nil, req: &types.Request{ Type: types.SearchTypeDB, Query: "find products under $100", - Models: []string{"product", "order"}, - }, - expectError: "", - expectItems: 0, // skeleton returns empty - }, - { - name: "with limit", - usesQueryDSL: "builtin", - config: &types.DBConfig{ Models: []string{"product"}, }, - req: &types.Request{ - Type: types.SearchTypeDB, - Query: "find products", - Models: []string{"product"}, - Limit: 5, - }, - expectError: "", - expectItems: 0, // skeleton returns empty - }, - { - name: "with wheres", - usesQueryDSL: "builtin", - config: &types.DBConfig{ - Models: []string{"product"}, - }, - req: &types.Request{ - Type: types.SearchTypeDB, - Query: "find products", - Models: []string{"product"}, - // Wheres would be set here in real usage - }, - expectError: "", - expectItems: 0, // skeleton returns empty - }, - { - name: "agent mode", - usesQueryDSL: "workers.nlp.querydsl", - config: &types.DBConfig{ - Models: []string{"product"}, - }, - req: &types.Request{ - Type: types.SearchTypeDB, - Query: "find products", - Models: []string{"product"}, - }, - expectError: "", - expectItems: 0, // skeleton returns empty - }, - { - name: "mcp mode", - usesQueryDSL: "mcp:nlp.generate_querydsl", - config: &types.DBConfig{ - Models: []string{"product"}, - }, - req: &types.Request{ - Type: types.SearchTypeDB, - Query: "find products", - Models: []string{"product"}, - }, - expectError: "", - expectItems: 0, // skeleton returns empty + expectError: "context is required for DB search", }, } @@ -163,16 +91,8 @@ func TestHandler_Search(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, result) assert.Equal(t, types.SearchTypeDB, result.Type) - assert.Equal(t, tt.req.Query, result.Query) - assert.Equal(t, tt.expectItems, len(result.Items)) - - if tt.expectError != "" { - assert.Equal(t, tt.expectError, result.Error) - } else { - assert.Empty(t, result.Error) - } - - // Duration should be set + assert.Equal(t, tt.expectError, result.Error) + assert.Equal(t, 0, len(result.Items)) assert.GreaterOrEqual(t, result.Duration, int64(0)) }) } @@ -195,21 +115,374 @@ func TestHandler_Search_SourcePreserved(t *testing.T) { } } -func TestHandler_Search_MaxResultsFromConfig(t *testing.T) { - cfg := &types.DBConfig{ - Models: []string{"product"}, - MaxResults: 50, - } - h := NewHandler("builtin", cfg) +func TestHandler_BuildModelSchema(t *testing.T) { + h := NewHandler("builtin", nil) - req := &types.Request{ - Type: types.SearchTypeDB, - Query: "test", - Models: []string{"product"}, - // No limit in request, should use config's MaxResults + // Create a mock model for testing + mod := &model.Model{ + MetaData: model.MetaData{ + Table: model.Table{ + Name: "test_products", + }, + }, + Columns: map[string]*model.Column{ + "id": { + Name: "id", + Type: "ID", + Label: "ID", + }, + "name": { + Name: "name", + Type: "string", + Label: "Name", + Description: "Product name", + }, + "price": { + Name: "price", + Type: "decimal", + Label: "Price", + }, + }, + } + + schema := h.buildModelSchema(mod) + + assert.NotNil(t, schema) + assert.Equal(t, "test_products", schema["name"]) + + columns, ok := schema["columns"].([]map[string]interface{}) + assert.True(t, ok) + assert.Len(t, columns, 3) + + // Verify columns have required fields + for _, col := range columns { + assert.NotEmpty(t, col["name"]) + assert.NotEmpty(t, col["type"]) } - result, err := h.Search(req) - assert.NoError(t, err) - assert.NotNil(t, result) - // Skeleton doesn't actually use maxResults yet, but the test ensures the handler runs +} + +func TestHandler_BuildModelSchema_MultipleModels(t *testing.T) { + h := NewHandler("builtin", nil) + + // Create mock models for testing joins + productMod := &model.Model{ + MetaData: model.MetaData{ + Table: model.Table{Name: "products"}, + }, + Columns: map[string]*model.Column{ + "id": {Name: "id", Type: "ID"}, + "name": {Name: "name", Type: "string"}, + "category_id": {Name: "category_id", Type: "integer"}, + }, + } + + categoryMod := &model.Model{ + MetaData: model.MetaData{ + Table: model.Table{Name: "categories"}, + }, + Columns: map[string]*model.Column{ + "id": {Name: "id", Type: "ID"}, + "name": {Name: "name", Type: "string"}, + }, + } + + productSchema := h.buildModelSchema(productMod) + categorySchema := h.buildModelSchema(categoryMod) + + assert.Equal(t, "products", productSchema["name"]) + assert.Equal(t, "categories", categorySchema["name"]) + + // Verify both schemas can be combined into an array + schemas := []map[string]interface{}{productSchema, categorySchema} + assert.Len(t, schemas, 2) +} + +func TestHandler_ExtractTitle(t *testing.T) { + h := NewHandler("builtin", nil) + mod := &model.Model{} + + tests := []struct { + name string + record map[string]interface{} + expected string + }{ + { + name: "title field", + record: map[string]interface{}{"title": "Test Title", "id": 1}, + expected: "Test Title", + }, + { + name: "name field", + record: map[string]interface{}{"name": "Test Name", "id": 1}, + expected: "Test Name", + }, + { + name: "subject field", + record: map[string]interface{}{"subject": "Test Subject", "id": 1}, + expected: "Test Subject", + }, + { + name: "label field", + record: map[string]interface{}{"label": "Test Label", "id": 1}, + expected: "Test Label", + }, + { + name: "no title field", + record: map[string]interface{}{"id": 1, "price": 100}, + expected: "", + }, + { + name: "empty title", + record: map[string]interface{}{"title": "", "name": "Fallback"}, + expected: "Fallback", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + title := h.extractTitle(tt.record, mod) + assert.Equal(t, tt.expected, title) + }) + } +} + +func TestHandler_ExtractContent(t *testing.T) { + h := NewHandler("builtin", nil) + mod := &model.Model{} + + tests := []struct { + name string + record map[string]interface{} + expectEmpty bool + }{ + { + name: "content field", + record: map[string]interface{}{"content": "Test Content"}, + expectEmpty: false, + }, + { + name: "description field", + record: map[string]interface{}{"description": "Test Description"}, + expectEmpty: false, + }, + { + name: "summary field", + record: map[string]interface{}{"summary": "Test Summary"}, + expectEmpty: false, + }, + { + name: "fallback to JSON", + record: map[string]interface{}{"id": 1, "price": 100}, + expectEmpty: false, // Should return JSON representation + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + content := h.extractContent(tt.record, mod) + if tt.expectEmpty { + assert.Empty(t, content) + } else { + assert.NotEmpty(t, content) + } + }) + } +} + +func TestHandler_ConvertToResultItems(t *testing.T) { + h := NewHandler("builtin", nil) + mod := &model.Model{ + PrimaryKey: "id", + } + + records := []map[string]interface{}{ + { + "id": 1, + "name": "Product 1", + "description": "Description 1", + "price": 99.99, + }, + { + "id": 2, + "title": "Product 2", + "content": "Content 2", + }, + } + + items := h.convertToResultItems(records, "product", mod, types.SourceAuto) + + assert.Len(t, items, 2) + + // First item + assert.Equal(t, types.SearchTypeDB, items[0].Type) + assert.Equal(t, types.SourceAuto, items[0].Source) + assert.Equal(t, "product", items[0].Model) + assert.Equal(t, 1, items[0].RecordID) + assert.Equal(t, "Product 1", items[0].Title) + assert.Equal(t, "Description 1", items[0].Content) + assert.NotNil(t, items[0].Data) + + // Second item + assert.Equal(t, 2, items[1].RecordID) + assert.Equal(t, "Product 2", items[1].Title) + assert.Equal(t, "Content 2", items[1].Content) +} + +func TestHandler_ConvertToResultItems_NilModel(t *testing.T) { + h := NewHandler("builtin", nil) + + records := []map[string]interface{}{ + {"id": 1, "name": "Test"}, + } + + // Should use default primary key "id" when model is nil + items := h.convertToResultItems(records, "test", nil, types.SourceHook) + + assert.Len(t, items, 1) + assert.Equal(t, 1, items[0].RecordID) + assert.Equal(t, "Test", items[0].Title) +} + +func TestHandler_Search_ScenarioTypes(t *testing.T) { + // Test that all scenario types are valid + scenarios := []types.ScenarioType{ + types.ScenarioFilter, + types.ScenarioAggregation, + types.ScenarioJoin, + types.ScenarioComplex, + } + + for _, scenario := range scenarios { + t.Run(string(scenario), func(t *testing.T) { + h := NewHandler("builtin", &types.DBConfig{Models: []string{"product"}}) + req := &types.Request{ + Type: types.SearchTypeDB, + Query: "test query", + Source: types.SourceAuto, + Models: []string{"product"}, + Scenario: scenario, + } + + // Without context, should return error (but scenario should be preserved in request) + result, err := h.Search(req) + assert.NoError(t, err) + assert.NotNil(t, result) + // Verify request scenario is set correctly + assert.Equal(t, scenario, req.Scenario) + }) + } +} + +func TestScenarioTypeConstants(t *testing.T) { + // Verify scenario type constants match expected values + assert.Equal(t, types.ScenarioType("filter"), types.ScenarioFilter) + assert.Equal(t, types.ScenarioType("aggregation"), types.ScenarioAggregation) + assert.Equal(t, types.ScenarioType("join"), types.ScenarioJoin) + assert.Equal(t, types.ScenarioType("complex"), types.ScenarioComplex) +} + +func TestHandler_MergeDSLConditions(t *testing.T) { + h := NewHandler("builtin", nil) + + t.Run("merge wheres", func(t *testing.T) { + dsl := &gou.QueryDSL{ + From: &gou.Table{Name: "users"}, + Wheres: []gou.Where{ + {Condition: gou.Condition{Field: &gou.Expression{Field: "status"}, Value: "active", OP: "="}}, + }, + } + req := &types.Request{ + Wheres: []gou.Where{ + {Condition: gou.Condition{Field: &gou.Expression{Field: "tenant_id"}, Value: 1, OP: "="}}, + }, + } + + h.mergeDSLConditions(dsl, req) + + // Preset wheres should be prepended + assert.Len(t, dsl.Wheres, 2) + assert.Equal(t, "tenant_id", dsl.Wheres[0].Field.Field) + assert.Equal(t, "status", dsl.Wheres[1].Field.Field) + }) + + t.Run("merge orders", func(t *testing.T) { + dsl := &gou.QueryDSL{ + From: &gou.Table{Name: "products"}, + Orders: gou.Orders{ + {Field: &gou.Expression{Field: "name"}, Sort: "asc"}, + }, + } + req := &types.Request{ + Orders: gou.Orders{ + {Field: &gou.Expression{Field: "created_at"}, Sort: "desc"}, + }, + } + + h.mergeDSLConditions(dsl, req) + + // Preset orders should be prepended + assert.Len(t, dsl.Orders, 2) + assert.Equal(t, "created_at", dsl.Orders[0].Field.Field) + assert.Equal(t, "name", dsl.Orders[1].Field.Field) + }) + + t.Run("merge select fields", func(t *testing.T) { + dsl := &gou.QueryDSL{ + From: &gou.Table{Name: "orders"}, + Select: []gou.Expression{ + {Field: "amount"}, + }, + } + req := &types.Request{ + Select: []string{"id", "status"}, + } + + h.mergeDSLConditions(dsl, req) + + // Preset select should be prepended + assert.Len(t, dsl.Select, 3) + assert.Equal(t, "id", dsl.Select[0].Field) + assert.Equal(t, "status", dsl.Select[1].Field) + assert.Equal(t, "amount", dsl.Select[2].Field) + }) + + t.Run("set limit from request", func(t *testing.T) { + dsl := &gou.QueryDSL{ + From: &gou.Table{Name: "users"}, + Limit: 0, + } + req := &types.Request{ + Limit: 50, + } + + h.mergeDSLConditions(dsl, req) + + assert.Equal(t, 50, dsl.Limit) + }) + + t.Run("preserve dsl limit if set", func(t *testing.T) { + dsl := &gou.QueryDSL{ + From: &gou.Table{Name: "users"}, + Limit: 10, + } + req := &types.Request{ + Limit: 50, + } + + h.mergeDSLConditions(dsl, req) + + // DSL limit should be preserved + assert.Equal(t, 10, dsl.Limit) + }) + + t.Run("nil dsl", func(t *testing.T) { + req := &types.Request{ + Wheres: []gou.Where{ + {Condition: gou.Condition{Field: &gou.Expression{Field: "id"}, Value: 1}}, + }, + } + + // Should not panic + h.mergeDSLConditions(nil, req) + }) } diff --git a/agent/search/handlers/web/agent.go b/agent/search/handlers/web/agent.go index e23c2bc6..0daa84d7 100644 --- a/agent/search/handlers/web/agent.go +++ b/agent/search/handlers/web/agent.go @@ -150,46 +150,20 @@ func (p *AgentProvider) Search(ctx *agentContext.Context, req *types.Request) (* }, nil } -// parseAgentResponse parses the agent response into search result items -// The agent should return a JSON structure with search results -func (p *AgentProvider) parseAgentResponse(response interface{}, source types.SourceType) ([]*types.ResultItem, int, string) { - if response == nil { +// parseAgentResponse parses the agent's *context.Response into search result items +// Now that agent.Stream() returns *context.Response directly, +// we can access fields without type assertions. +// +// The agent returns search results in response.Next field +func (p *AgentProvider) parseAgentResponse(response *agentContext.Response, source types.SourceType) ([]*types.ResultItem, int, string) { + if response == nil || response.Next == nil { return nil, 0, "Agent returned nil response" } - // Try to extract data from response - var data map[string]interface{} - - // Handle different response types - switch v := response.(type) { - case map[string]interface{}: - data = v - case string: - // Try to parse as JSON - if err := json.Unmarshal([]byte(v), &data); err != nil { - return nil, 0, fmt.Sprintf("Failed to parse agent response as JSON: %v", err) - } - default: - // Try to marshal and unmarshal - jsonBytes, err := json.Marshal(response) - if err != nil { - return nil, 0, fmt.Sprintf("Failed to serialize agent response: %v", err) - } - if err := json.Unmarshal(jsonBytes, &data); err != nil { - return nil, 0, fmt.Sprintf("Failed to parse agent response: %v", err) - } - } - - // Check for "next" field (custom hook data) - if next, hasNext := data["next"]; hasNext && next != nil { - if nextMap, ok := next.(map[string]interface{}); ok { - data = nextMap - } else if nextStr, ok := next.(string); ok { - // Try to parse as JSON - if err := json.Unmarshal([]byte(nextStr), &data); err != nil { - return nil, 0, fmt.Sprintf("Failed to parse next hook data: %v", err) - } - } + // Extract data from Next field + data := extractNextData(response.Next) + if data == nil { + return nil, 0, "Failed to extract data from agent response" } // Extract items from data @@ -230,3 +204,34 @@ func (p *AgentProvider) parseAgentResponse(response interface{}, source types.So return items, total, "" } + +// extractNextData extracts the actual data from response.Next field +// Handles nested structures like { "data": { ... } } +func extractNextData(next interface{}) map[string]interface{} { + if next == nil { + return nil + } + + switch v := next.(type) { + case map[string]interface{}: + // Check for "data" wrapper + if data, ok := v["data"].(map[string]interface{}); ok { + return data + } + return v + case string: + // Try to parse as JSON + var data map[string]interface{} + if err := json.Unmarshal([]byte(v), &data); err == nil { + return extractNextData(data) + } + } + // Try to handle other types by converting to JSON and back + if bytes, err := json.Marshal(next); err == nil { + var data map[string]interface{} + if err := json.Unmarshal(bytes, &data); err == nil { + return extractNextData(data) + } + } + return nil +} diff --git a/agent/search/interfaces/handler.go b/agent/search/interfaces/handler.go index 0820f10c..fc44a266 100644 --- a/agent/search/interfaces/handler.go +++ b/agent/search/interfaces/handler.go @@ -1,6 +1,7 @@ package interfaces import ( + "github.com/yaoapp/yao/agent/context" "github.com/yaoapp/yao/agent/search/types" ) @@ -12,3 +13,12 @@ type Handler interface { // Search executes the search and returns results Search(req *types.Request) (*types.Result, error) } + +// ContextHandler extends Handler with context support +// Handlers that need context (e.g., DB handler for QueryDSL generation) should implement this +type ContextHandler interface { + Handler + + // SearchWithContext executes the search with context and returns results + SearchWithContext(ctx *context.Context, req *types.Request) (*types.Result, error) +} diff --git a/agent/search/jsapi_db_test.go b/agent/search/jsapi_db_test.go new file mode 100644 index 00000000..5c315e68 --- /dev/null +++ b/agent/search/jsapi_db_test.go @@ -0,0 +1,191 @@ +package search_test + +import ( + "testing" + + "github.com/yaoapp/gou/model" + "github.com/yaoapp/yao/agent/context" + "github.com/yaoapp/yao/agent/search" + "github.com/yaoapp/yao/agent/search/types" + "github.com/yaoapp/yao/agent/testutils" + oauthTypes "github.com/yaoapp/yao/openapi/oauth/types" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +// ============================================================================ +// DB Search JSAPI Integration Tests +// ============================================================================ + +func TestJSAPI_DB_Integration(t *testing.T) { + // Skip if running short tests + if testing.Short() { + t.Skip("Skipping integration test") + } + + // Initialize test environment (loads models, database, query engine, etc.) + testutils.Prepare(t) + defer testutils.Clean(t) + + // Create test context + ctx := newJSAPITestContext(t) + + // Verify __yao.role model is loaded + mod := model.Select("__yao.role") + require.NotNil(t, mod, "__yao.role model should be loaded") + + // Ensure test data exists + ensureJSAPITestRole(t, mod) + + t.Run("db_search_with_context", func(t *testing.T) { + api := search.NewJSAPI(ctx, &types.Config{ + DB: &types.DBConfig{ + Models: []string{"__yao.role"}, + MaxResults: 10, + }, + }, &search.Uses{QueryDSL: "builtin"}) + + result := api.DB("查询所有角色", map[string]interface{}{ + "models": []interface{}{"__yao.role"}, + "limit": float64(10), + }) + + require.NotNil(t, result) + r, ok := result.(*types.Result) + require.True(t, ok) + + assert.Equal(t, types.SearchTypeDB, r.Type) + assert.Equal(t, "查询所有角色", r.Query) + assert.Equal(t, types.SourceHook, r.Source) + + if r.Error != "" { + t.Logf("Search error: %s", r.Error) + } + assert.Empty(t, r.Error, "Should not have error") + assert.Greater(t, len(r.Items), 0, "Should have results") + }) + + t.Run("db_search_with_scenario", func(t *testing.T) { + api := search.NewJSAPI(ctx, &types.Config{ + DB: &types.DBConfig{ + Models: []string{"__yao.role"}, + MaxResults: 5, + }, + }, &search.Uses{QueryDSL: "builtin"}) + + result := api.DB("查询系统角色", map[string]interface{}{ + "models": []interface{}{"__yao.role"}, + "scenario": "filter", + "limit": float64(5), + }) + + require.NotNil(t, result) + r, ok := result.(*types.Result) + require.True(t, ok) + + assert.Equal(t, types.SearchTypeDB, r.Type) + assert.LessOrEqual(t, len(r.Items), 5, "Should respect limit") + }) + + t.Run("db_search_with_select_fields", func(t *testing.T) { + api := search.NewJSAPI(ctx, &types.Config{ + DB: &types.DBConfig{ + Models: []string{"__yao.role"}, + MaxResults: 10, + }, + }, &search.Uses{QueryDSL: "builtin"}) + + result := api.DB("查询角色名称", map[string]interface{}{ + "models": []interface{}{"__yao.role"}, + "select": []interface{}{"id", "name", "description"}, + "limit": float64(10), + }) + + require.NotNil(t, result) + r, ok := result.(*types.Result) + require.True(t, ok) + + assert.Equal(t, types.SearchTypeDB, r.Type) + if r.Error == "" && len(r.Items) > 0 { + // Verify items have data + for _, item := range r.Items { + assert.NotNil(t, item.Data) + assert.Equal(t, "__yao.role", item.Model) + } + } + }) + + t.Run("db_search_all_with_multiple_types", func(t *testing.T) { + api := search.NewJSAPI(ctx, &types.Config{ + KB: &types.KBConfig{Collections: []string{"docs"}}, + DB: &types.DBConfig{ + Models: []string{"__yao.role"}, + MaxResults: 10, + }, + }, &search.Uses{QueryDSL: "builtin"}) + + requests := []interface{}{ + map[string]interface{}{ + "type": "db", + "query": "查询角色", + "models": []interface{}{"__yao.role"}, + "limit": float64(5), + }, + map[string]interface{}{ + "type": "kb", + "query": "知识库查询", + "collections": []interface{}{"docs"}, + "limit": float64(5), + }, + } + + results := api.All(requests) + require.Len(t, results, 2) + + // DB result + r0, ok := results[0].(*types.Result) + require.True(t, ok) + assert.Equal(t, types.SearchTypeDB, r0.Type) + + // KB result + r1, ok := results[1].(*types.Result) + require.True(t, ok) + assert.Equal(t, types.SearchTypeKB, r1.Type) + }) +} + +// newJSAPITestContext creates a test context for JSAPI tests +func newJSAPITestContext(t *testing.T) *context.Context { + t.Helper() + authorized := &oauthTypes.AuthorizedInfo{ + UserID: "test-user-jsapi", + } + chatID := "test-chat-jsapi-db" + ctx := context.New(t.Context(), authorized, chatID) + return ctx +} + +// ensureJSAPITestRole ensures there's at least one role in the database +func ensureJSAPITestRole(t *testing.T, mod *model.Model) { + t.Helper() + + // Try to find existing roles + rows, err := mod.Get(model.QueryParam{Limit: 1}) + if err == nil && len(rows) > 0 { + return + } + + // Create a test role + _, err = mod.Create(map[string]interface{}{ + "role_id": "jsapi_test_role", + "name": "JSAPI Test Role", + "description": "A test role for JSAPI unit testing", + "is_active": true, + "is_system": false, + "level": 1, + }) + if err != nil { + t.Logf("Note: Could not create test role: %v", err) + } +} diff --git a/agent/search/nlp/keyword/agent.go b/agent/search/nlp/keyword/agent.go index 22f72c08..ae384f91 100644 --- a/agent/search/nlp/keyword/agent.go +++ b/agent/search/nlp/keyword/agent.go @@ -23,8 +23,8 @@ func NewAgentProvider(agentID string) *AgentProvider { } // Extract extracts keywords by calling the target agent -// The agent receives the content and returns extracted keywords -func (p *AgentProvider) Extract(ctx *agentContext.Context, content string, opts *types.KeywordOptions) ([]string, error) { +// The agent receives the content and returns extracted keywords with weights +func (p *AgentProvider) Extract(ctx *agentContext.Context, content string, opts *types.KeywordOptions) ([]types.Keyword, error) { if ctx == nil { return nil, fmt.Errorf("context is required for agent keyword extraction") } @@ -64,73 +64,64 @@ func (p *AgentProvider) Extract(ctx *agentContext.Context, content string, opts }, } - result, err := agent.Stream(ctx, messages, options) + response, err := agent.Stream(ctx, messages, options) if err != nil { return nil, fmt.Errorf("agent call failed: %w", err) } - // Debug: log the result type and value - // fmt.Printf("DEBUG Agent result type: %T, value: %+v\n", result, result) - - // Parse the result - return p.parseResult(result) + // Parse the result from response.Next + return p.parseResponse(response) } -// parseResult extracts keywords from the agent's response -// The agent should return data in NextHookResponse format: { data: { keywords: [...] } } -// The Stream() response wraps this in: { next: { data: { keywords: [...] } } } -func (p *AgentProvider) parseResult(result interface{}) ([]string, error) { - if result == nil { - return []string{}, nil +// parseResponse extracts keywords from the agent's *context.Response +// Now that agent.Stream() returns *context.Response directly, +// we can access fields without type assertions. +// +// The agent returns keywords in response.Next field as {data: {keywords: [{k, w}, ...]}} +func (p *AgentProvider) parseResponse(response *agentContext.Response) ([]types.Keyword, error) { + if response == nil || response.Next == nil { + return []types.Keyword{}, nil + } + + return p.parseNextData(response.Next) +} + +// parseNextData extracts keywords from Next hook data +// Expected format: {data: {keywords: [{k: "keyword", w: 0.9}, ...]}} +func (p *AgentProvider) parseNextData(next interface{}) ([]types.Keyword, error) { + if next == nil { + return []types.Keyword{}, nil } // Try to convert to map first (most common case) var data map[string]interface{} - switch v := result.(type) { + switch v := next.(type) { case map[string]interface{}: data = v case string: // Try to parse as JSON if err := json.Unmarshal([]byte(v), &data); err != nil { - // Not a JSON object, try as array - var keywords []string + // Not a JSON object, try as array of keywords + var keywords []types.Keyword if err := json.Unmarshal([]byte(v), &keywords); err == nil { return keywords, nil } - // Return as single keyword - return []string{v}, nil + // Return as single keyword with default weight + return []types.Keyword{{K: v, W: 0.5}}, nil } - case []string: + case []types.Keyword: return v, nil case []interface{}: - keywords := make([]string, 0, len(v)) - for _, item := range v { - if s, ok := item.(string); ok { - keywords = append(keywords, s) - } - } - return keywords, nil + return p.extractKeywordsFromArray(v) default: // Try to marshal and unmarshal - jsonBytes, err := json.Marshal(result) + jsonBytes, err := json.Marshal(next) if err != nil { - return []string{}, nil + return []types.Keyword{}, nil } if err := json.Unmarshal(jsonBytes, &data); err != nil { - return []string{}, nil - } - } - - // Check for "next" field (custom hook data from NextHookResponse) - // Stream() returns: { next: { data: { keywords: [...] } } } - if next, hasNext := data["next"]; hasNext && next != nil { - if nextMap, ok := next.(map[string]interface{}); ok { - data = nextMap - } else if nextStr, ok := next.(string); ok { - if err := json.Unmarshal([]byte(nextStr), &data); err != nil { - return []string{}, nil - } + return []types.Keyword{}, nil } } @@ -148,28 +139,48 @@ func (p *AgentProvider) parseResult(result interface{}) ([]string, error) { return p.extractKeywordsFromValue(d) } - return []string{}, nil + return []types.Keyword{}, nil } -// extractKeywordsFromValue extracts string array from various types -func (p *AgentProvider) extractKeywordsFromValue(v interface{}) ([]string, error) { +// extractKeywordsFromValue extracts Keyword array from various types +func (p *AgentProvider) extractKeywordsFromValue(v interface{}) ([]types.Keyword, error) { switch kw := v.(type) { - case []string: + case []types.Keyword: return kw, nil case []interface{}: - keywords := make([]string, 0, len(kw)) - for _, item := range kw { - if s, ok := item.(string); ok { - keywords = append(keywords, s) - } - } - return keywords, nil + return p.extractKeywordsFromArray(kw) case string: - var keywords []string + var keywords []types.Keyword if err := json.Unmarshal([]byte(kw), &keywords); err == nil { return keywords, nil } - return []string{kw}, nil + return []types.Keyword{{K: kw, W: 0.5}}, nil } - return []string{}, nil + return []types.Keyword{}, nil +} + +// extractKeywordsFromArray extracts keywords from []interface{} +// Handles both {k, w} objects and plain strings +func (p *AgentProvider) extractKeywordsFromArray(items []interface{}) ([]types.Keyword, error) { + keywords := make([]types.Keyword, 0, len(items)) + for _, item := range items { + switch v := item.(type) { + case map[string]interface{}: + // Handle {k: "keyword", w: 0.9} format + k, _ := v["k"].(string) + w, _ := v["w"].(float64) + if k != "" { + if w == 0 { + w = 0.5 // Default weight + } + keywords = append(keywords, types.Keyword{K: k, W: w}) + } + case string: + // Plain string, use default weight + if v != "" { + keywords = append(keywords, types.Keyword{K: v, W: 0.5}) + } + } + } + return keywords, nil } diff --git a/agent/search/nlp/keyword/builtin.go b/agent/search/nlp/keyword/builtin.go deleted file mode 100644 index d649c09c..00000000 --- a/agent/search/nlp/keyword/builtin.go +++ /dev/null @@ -1,243 +0,0 @@ -package keyword - -import ( - "regexp" - "sort" - "strings" - "unicode" -) - -// BuiltinExtractor implements simple frequency-based keyword extraction -// This is a lightweight implementation with no external dependencies. -// -// Algorithm: -// 1. Tokenize text (split by whitespace and punctuation) -// 2. Normalize (lowercase, trim) -// 3. Filter stop words and short words -// 4. Count word frequency -// 5. Return top N words by frequency -// -// Limitations: -// - No semantic understanding -// - No phrase extraction (single words only) -// - Basic Chinese support (splits by punctuation, no proper segmentation) -// -// For better results, use Agent or MCP mode with LLM-based extraction. -type BuiltinExtractor struct { - stopWords map[string]bool - minLength int // minimum word length to consider -} - -// Result represents an extracted keyword with its score -type Result struct { - Word string `json:"word"` - Score float64 `json:"score"` // frequency-based score (0-1) -} - -// NewBuiltinExtractor creates a new builtin keyword extractor -func NewBuiltinExtractor() *BuiltinExtractor { - return &BuiltinExtractor{ - stopWords: defaultStopWords, - minLength: 2, - } -} - -// Extract extracts keywords from text using frequency-based algorithm -func (e *BuiltinExtractor) Extract(text string, limit int) []Result { - if text == "" || limit <= 0 { - return []Result{} - } - - // Step 1: Tokenize - tokens := e.tokenize(text) - - // Step 2 & 3: Normalize and filter - var words []string - for _, token := range tokens { - word := e.normalize(token) - if e.shouldKeep(word) { - words = append(words, word) - } - } - - if len(words) == 0 { - return []Result{} - } - - // Step 4: Count frequency - freq := make(map[string]int) - for _, word := range words { - freq[word]++ - } - - // Step 5: Sort by frequency and return top N - type wordFreq struct { - word string - freq int - } - var sorted []wordFreq - for word, count := range freq { - sorted = append(sorted, wordFreq{word, count}) - } - sort.Slice(sorted, func(i, j int) bool { - return sorted[i].freq > sorted[j].freq - }) - - // Calculate max frequency for normalization - maxFreq := 1 - if len(sorted) > 0 { - maxFreq = sorted[0].freq - } - - // Build result with normalized scores - result := make([]Result, 0, limit) - for i := 0; i < len(sorted) && i < limit; i++ { - result = append(result, Result{ - Word: sorted[i].word, - Score: float64(sorted[i].freq) / float64(maxFreq), - }) - } - - return result -} - -// ExtractAsStrings is a convenience method that returns just the keyword strings -func (e *BuiltinExtractor) ExtractAsStrings(text string, limit int) []string { - results := e.Extract(text, limit) - words := make([]string, len(results)) - for i, r := range results { - words[i] = r.Word - } - return words -} - -// tokenize splits text into tokens -// Handles both English (space-separated) and Chinese (character-based with punctuation splits) -func (e *BuiltinExtractor) tokenize(text string) []string { - // Split by whitespace and common punctuation - splitter := regexp.MustCompile(`[\s\p{P}\p{S}]+`) - tokens := splitter.Split(text, -1) - - // Further split mixed Chinese/English text - var result []string - for _, token := range tokens { - if token == "" { - continue - } - // Split Chinese characters as individual tokens (basic approach) - // For proper Chinese segmentation, use Agent/MCP mode - subTokens := e.splitMixedText(token) - result = append(result, subTokens...) - } - - return result -} - -// splitMixedText handles mixed Chinese/English text -// Chinese characters are grouped together, English words stay as-is -func (e *BuiltinExtractor) splitMixedText(text string) []string { - var result []string - var current strings.Builder - var lastType int // 0=none, 1=chinese, 2=other - - for _, r := range text { - currentType := 0 - if unicode.Is(unicode.Han, r) { - currentType = 1 - } else if unicode.IsLetter(r) || unicode.IsDigit(r) { - currentType = 2 - } - - if currentType == 0 { - // Non-word character, flush current - if current.Len() > 0 { - result = append(result, current.String()) - current.Reset() - } - lastType = 0 - continue - } - - if lastType != 0 && lastType != currentType { - // Type changed, flush current - if current.Len() > 0 { - result = append(result, current.String()) - current.Reset() - } - } - - current.WriteRune(r) - lastType = currentType - } - - // Flush remaining - if current.Len() > 0 { - result = append(result, current.String()) - } - - return result -} - -// normalize converts word to lowercase and trims whitespace -func (e *BuiltinExtractor) normalize(word string) string { - return strings.ToLower(strings.TrimSpace(word)) -} - -// shouldKeep checks if a word should be kept (not a stop word, meets length requirement) -func (e *BuiltinExtractor) shouldKeep(word string) bool { - if len(word) < e.minLength { - return false - } - if e.stopWords[word] { - return false - } - // Keep if it contains at least one letter or Chinese character - for _, r := range word { - if unicode.IsLetter(r) { - return true - } - } - return false -} - -// defaultStopWords contains common stop words for English and Chinese -// This is a minimal set to keep the implementation lightweight. -// For comprehensive stop word filtering, use Agent/MCP mode. -var defaultStopWords = map[string]bool{ - // English stop words (most common ~100) - "a": true, "an": true, "the": true, "and": true, "or": true, "but": true, - "is": true, "are": true, "was": true, "were": true, "be": true, "been": true, "being": true, - "have": true, "has": true, "had": true, "do": true, "does": true, "did": true, - "will": true, "would": true, "could": true, "should": true, "may": true, "might": true, - "must": true, "shall": true, "can": true, "need": true, "dare": true, - "i": true, "you": true, "he": true, "she": true, "it": true, "we": true, "they": true, - "me": true, "him": true, "her": true, "us": true, "them": true, - "my": true, "your": true, "his": true, "its": true, "our": true, "their": true, - "mine": true, "yours": true, "hers": true, "ours": true, "theirs": true, - "this": true, "that": true, "these": true, "those": true, - "what": true, "which": true, "who": true, "whom": true, "whose": true, - "where": true, "when": true, "why": true, "how": true, - "all": true, "each": true, "every": true, "both": true, "few": true, "more": true, - "most": true, "other": true, "some": true, "such": true, "no": true, "not": true, - "only": true, "same": true, "so": true, "than": true, "too": true, "very": true, - "just": true, "also": true, "now": true, "here": true, "there": true, - "in": true, "on": true, "at": true, "by": true, "for": true, "with": true, - "about": true, "against": true, "between": true, "into": true, "through": true, - "during": true, "before": true, "after": true, "above": true, "below": true, - "to": true, "from": true, "up": true, "down": true, "out": true, "off": true, - "over": true, "under": true, "again": true, "further": true, "then": true, "once": true, - "as": true, "if": true, "because": true, "until": true, "while": true, - - // Chinese stop words (most common ~50) - "的": true, "了": true, "和": true, "是": true, "就": true, - "都": true, "而": true, "及": true, "与": true, "着": true, - "或": true, "一个": true, "没有": true, "我们": true, "你们": true, - "他们": true, "它们": true, "这个": true, "那个": true, "这些": true, - "那些": true, "这里": true, "那里": true, "什么": true, "怎么": true, - "为什么": true, "哪里": true, "谁": true, "哪个": true, "多少": true, - "在": true, "有": true, "个": true, "中": true, "为": true, - "以": true, "于": true, "上": true, "下": true, "不": true, - "也": true, "很": true, "到": true, "说": true, "要": true, - "会": true, "可以": true, "这": true, "那": true, "但": true, - "如果": true, "因为": true, "所以": true, "虽然": true, "但是": true, -} diff --git a/agent/search/nlp/keyword/builtin_test.go b/agent/search/nlp/keyword/builtin_test.go deleted file mode 100644 index 17b31b5b..00000000 --- a/agent/search/nlp/keyword/builtin_test.go +++ /dev/null @@ -1,137 +0,0 @@ -package keyword - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestBuiltinExtractor_Extract(t *testing.T) { - extractor := NewBuiltinExtractor() - - tests := []struct { - name string - text string - limit int - minCount int // minimum expected keywords - }{ - { - name: "English text", - text: "The quick brown fox jumps over the lazy dog. The fox is very quick.", - limit: 5, - minCount: 3, // fox, quick, etc. - }, - { - name: "Chinese text", - text: "人工智能技术正在快速发展,机器学习和深度学习是人工智能的核心技术", - limit: 5, - minCount: 2, - }, - { - name: "Mixed text", - text: "AI人工智能 machine learning 机器学习 deep learning 深度学习", - limit: 10, - minCount: 3, - }, - { - name: "Empty text", - text: "", - limit: 5, - minCount: 0, - }, - { - name: "Only stop words", - text: "the a an is are was were", - limit: 5, - minCount: 0, - }, - { - name: "Technical query", - text: "How to implement a search engine with Elasticsearch and Redis caching?", - limit: 5, - minCount: 3, // search, engine, elasticsearch, redis, caching - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - results := extractor.Extract(tt.text, tt.limit) - assert.GreaterOrEqual(t, len(results), tt.minCount, "Expected at least %d keywords", tt.minCount) - assert.LessOrEqual(t, len(results), tt.limit, "Should not exceed limit") - - // Check scores are valid - for _, r := range results { - assert.NotEmpty(t, r.Word) - assert.GreaterOrEqual(t, r.Score, 0.0) - assert.LessOrEqual(t, r.Score, 1.0) - } - }) - } -} - -func TestBuiltinExtractor_ExtractAsStrings(t *testing.T) { - extractor := NewBuiltinExtractor() - - text := "Machine learning and deep learning are subfields of artificial intelligence" - keywords := extractor.ExtractAsStrings(text, 5) - - assert.NotEmpty(t, keywords) - assert.LessOrEqual(t, len(keywords), 5) - - // Check that common ML terms are extracted - keywordSet := make(map[string]bool) - for _, k := range keywords { - keywordSet[k] = true - } - assert.True(t, keywordSet["learning"] || keywordSet["machine"] || keywordSet["artificial"], - "Expected at least one relevant keyword") -} - -func TestBuiltinExtractor_StopWords(t *testing.T) { - extractor := NewBuiltinExtractor() - - // Test that stop words are filtered - text := "the quick brown fox is very lazy" - results := extractor.Extract(text, 10) - - for _, r := range results { - assert.NotEqual(t, "the", r.Word) - assert.NotEqual(t, "is", r.Word) - assert.NotEqual(t, "very", r.Word) - } -} - -func TestBuiltinExtractor_Frequency(t *testing.T) { - extractor := NewBuiltinExtractor() - - // Word "search" appears 3 times, should rank higher - text := "search engine optimization, search ranking, search results" - results := extractor.Extract(text, 3) - - assert.NotEmpty(t, results) - // "search" should be the top keyword - assert.Equal(t, "search", results[0].Word) - assert.Equal(t, 1.0, results[0].Score) // highest frequency = 1.0 -} - -func TestBuiltinExtractor_ZeroLimit(t *testing.T) { - extractor := NewBuiltinExtractor() - - results := extractor.Extract("some text here", 0) - assert.Empty(t, results) -} - -func TestBuiltinExtractor_ChineseStopWords(t *testing.T) { - extractor := NewBuiltinExtractor() - - // Test that Chinese stop words are filtered - text := "这是一个关于人工智能的文章" - results := extractor.Extract(text, 10) - - for _, r := range results { - assert.NotEqual(t, "这", r.Word) - assert.NotEqual(t, "是", r.Word) - assert.NotEqual(t, "一个", r.Word) - assert.NotEqual(t, "的", r.Word) - } -} diff --git a/agent/search/nlp/keyword/extractor.go b/agent/search/nlp/keyword/extractor.go index 7a5c6ba9..83a3ee23 100644 --- a/agent/search/nlp/keyword/extractor.go +++ b/agent/search/nlp/keyword/extractor.go @@ -1,19 +1,21 @@ // Package keyword provides keyword extraction for web search optimization // Supports three modes via uses.keyword configuration: -// - "builtin": Simple frequency-based extraction (no external dependencies) -// - "": Delegate to an LLM-powered assistant for high-quality extraction +// - "builtin" or "": Uses __yao.keyword system agent (LLM-powered) +// - "": Delegate to a custom LLM-powered assistant // - "mcp:.": Call external MCP tool -// -// For production use cases requiring high accuracy, use Agent or MCP mode. package keyword import ( + "fmt" "strings" "github.com/yaoapp/yao/agent/context" "github.com/yaoapp/yao/agent/search/types" ) +// SystemKeywordAgent is the default system agent for keyword extraction +const SystemKeywordAgent = "__yao.keyword" + // Extractor extracts keywords from text // Mode is determined by uses.keyword configuration type Extractor struct { @@ -32,19 +34,20 @@ func NewExtractor(usesKeyword string, cfg *types.KeywordConfig) *Extractor { } // Extract extracts keywords from content based on configured mode -// Returns a list of keywords optimized for search queries -func (e *Extractor) Extract(ctx *context.Context, content string, opts *types.KeywordOptions) ([]string, error) { +// Returns a list of keywords with weights optimized for search queries +func (e *Extractor) Extract(ctx *context.Context, content string, opts *types.KeywordOptions) ([]types.Keyword, error) { // Merge options with config defaults mergedOpts := e.mergeOptions(opts) switch { case e.usesKeyword == "builtin" || e.usesKeyword == "": - return e.builtinExtract(content, mergedOpts) + // Use system keyword agent + return e.agentExtract(ctx, content, SystemKeywordAgent, mergedOpts) case strings.HasPrefix(e.usesKeyword, "mcp:"): return e.mcpExtract(ctx, content, mergedOpts) default: // Assume it's an assistant ID for Agent mode - return e.agentExtract(ctx, content, mergedOpts) + return e.agentExtract(ctx, content, e.usesKeyword, mergedOpts) } } @@ -78,29 +81,24 @@ func (e *Extractor) mergeOptions(opts *types.KeywordOptions) *types.KeywordOptio return result } -// builtinExtract uses simple frequency-based extraction -// This is a lightweight implementation with no external dependencies. -// For better results, use Agent or MCP mode. -func (e *Extractor) builtinExtract(content string, opts *types.KeywordOptions) ([]string, error) { - extractor := NewBuiltinExtractor() - return extractor.ExtractAsStrings(content, opts.MaxKeywords), nil -} - // agentExtract delegates to an LLM-powered assistant // The assistant can understand context and extract semantically relevant keywords -func (e *Extractor) agentExtract(ctx *context.Context, content string, opts *types.KeywordOptions) ([]string, error) { - provider := NewAgentProvider(e.usesKeyword) +func (e *Extractor) agentExtract(ctx *context.Context, content string, agentID string, opts *types.KeywordOptions) ([]types.Keyword, error) { + if ctx == nil { + return nil, fmt.Errorf("context is required for keyword extraction") + } + provider := NewAgentProvider(agentID) return provider.Extract(ctx, content, opts) } // mcpExtract calls an external MCP tool // Format: "mcp:." -func (e *Extractor) mcpExtract(ctx *context.Context, content string, opts *types.KeywordOptions) ([]string, error) { +func (e *Extractor) mcpExtract(ctx *context.Context, content string, opts *types.KeywordOptions) ([]types.Keyword, error) { mcpRef := strings.TrimPrefix(e.usesKeyword, "mcp:") provider, err := NewMCPProvider(mcpRef) if err != nil { - // Fallback to builtin on invalid MCP format - return e.builtinExtract(content, opts) + // Fallback to system agent on invalid MCP format + return e.agentExtract(ctx, content, SystemKeywordAgent, e.mergeOptions(nil)) } return provider.Extract(ctx, content, opts) } diff --git a/agent/search/nlp/keyword/extractor_test.go b/agent/search/nlp/keyword/extractor_test.go index ce29596f..ba91eb93 100644 --- a/agent/search/nlp/keyword/extractor_test.go +++ b/agent/search/nlp/keyword/extractor_test.go @@ -8,56 +8,48 @@ import ( "github.com/yaoapp/yao/agent/search/types" ) -func TestExtractor_BuiltinMode(t *testing.T) { - // Test builtin mode (no external dependencies) +func TestExtractor_BuiltinMode_RequiresContext(t *testing.T) { + // Test builtin mode requires context (now uses __yao.keyword agent) extractor := keyword.NewExtractor("builtin", &types.KeywordConfig{ MaxKeywords: 5, Language: "auto", }) - keywords, err := extractor.Extract(nil, "How to build a search engine with Elasticsearch?", nil) - assert.NoError(t, err) - assert.NotEmpty(t, keywords) - assert.LessOrEqual(t, len(keywords), 5) + // Without context, should return error + _, err := extractor.Extract(nil, "How to build a search engine with Elasticsearch?", nil) + assert.Error(t, err) + assert.Contains(t, err.Error(), "context is required") } -func TestExtractor_EmptyUsesKeyword(t *testing.T) { - // Empty uses.keyword should default to builtin +func TestExtractor_EmptyUsesKeyword_RequiresContext(t *testing.T) { + // Empty uses.keyword should default to __yao.keyword agent extractor := keyword.NewExtractor("", nil) - keywords, err := extractor.Extract(nil, "Machine learning algorithms", nil) - assert.NoError(t, err) - assert.NotEmpty(t, keywords) + // Without context, should return error + _, err := extractor.Extract(nil, "Machine learning algorithms", nil) + assert.Error(t, err) + assert.Contains(t, err.Error(), "context is required") } -func TestExtractor_RuntimeOptionsOverride(t *testing.T) { - // Config has max_keywords=10, but runtime opts override to 3 - extractor := keyword.NewExtractor("builtin", &types.KeywordConfig{ - MaxKeywords: 10, - }) +func TestExtractor_AgentMode_RequiresContext(t *testing.T) { + // Custom agent mode requires context + extractor := keyword.NewExtractor("custom.keyword.agent", nil) - keywords, err := extractor.Extract(nil, "one two three four five six seven eight nine ten", &types.KeywordOptions{ - MaxKeywords: 3, - }) - assert.NoError(t, err) - assert.LessOrEqual(t, len(keywords), 3) + _, err := extractor.Extract(nil, "Test query", nil) + assert.Error(t, err) + assert.Contains(t, err.Error(), "context is required") } -func TestExtractor_ConfigDefaults(t *testing.T) { - // No config, should use defaults - extractor := keyword.NewExtractor("builtin", nil) - - keywords, err := extractor.Extract(nil, "Test query for keyword extraction", nil) - assert.NoError(t, err) - assert.NotEmpty(t, keywords) - assert.LessOrEqual(t, len(keywords), 10) // default max_keywords is 10 -} - -func TestExtractor_InvalidMCPFormat(t *testing.T) { - // Invalid MCP format should fallback to builtin +func TestExtractor_MCPMode_InvalidFormat(t *testing.T) { + // Invalid MCP format should fallback to system agent (which requires context) extractor := keyword.NewExtractor("mcp:invalid", nil) - keywords, err := extractor.Extract(nil, "Test query", nil) - assert.NoError(t, err) - assert.NotEmpty(t, keywords) + _, err := extractor.Extract(nil, "Test query", nil) + assert.Error(t, err) + assert.Contains(t, err.Error(), "context is required") +} + +func TestExtractor_SystemKeywordAgentConstant(t *testing.T) { + // Verify the system keyword agent constant + assert.Equal(t, "__yao.keyword", keyword.SystemKeywordAgent) } diff --git a/agent/search/nlp/keyword/mcp.go b/agent/search/nlp/keyword/mcp.go index d196cd60..6772599f 100644 --- a/agent/search/nlp/keyword/mcp.go +++ b/agent/search/nlp/keyword/mcp.go @@ -31,7 +31,7 @@ func NewMCPProvider(mcpRef string) (*MCPProvider, error) { } // Extract extracts keywords by calling the MCP tool -func (p *MCPProvider) Extract(ctx *agentContext.Context, content string, opts *types.KeywordOptions) ([]string, error) { +func (p *MCPProvider) Extract(ctx *agentContext.Context, content string, opts *types.KeywordOptions) ([]types.Keyword, error) { // Get MCP client client, err := mcp.Select(p.serverID) if err != nil { @@ -56,9 +56,9 @@ func (p *MCPProvider) Extract(ctx *agentContext.Context, content string, opts *t } // parseResult extracts keywords from the MCP tool response -func (p *MCPProvider) parseResult(result *gouMCPTypes.CallToolResponse) ([]string, error) { +func (p *MCPProvider) parseResult(result *gouMCPTypes.CallToolResponse) ([]types.Keyword, error) { if result == nil { - return []string{}, nil + return []types.Keyword{}, nil } // Check for errors in result @@ -72,7 +72,7 @@ func (p *MCPProvider) parseResult(result *gouMCPTypes.CallToolResponse) ([]strin // Parse content - expect JSON data with "keywords" field if len(result.Content) == 0 { - return []string{}, nil + return []types.Keyword{}, nil } // Try to extract keywords from content @@ -88,36 +88,50 @@ func (p *MCPProvider) parseResult(result *gouMCPTypes.CallToolResponse) ([]strin } } - // Try to parse as direct array - var keywords []string + // Try to parse as direct array of keywords + var keywords []types.Keyword if err := json.Unmarshal([]byte(content.Text), &keywords); err == nil { return keywords, nil } } } - return []string{}, nil + return []types.Keyword{}, nil } -// extractKeywordsFromValue extracts string array from various types -func (p *MCPProvider) extractKeywordsFromValue(v interface{}) ([]string, error) { +// extractKeywordsFromValue extracts Keyword array from various types +func (p *MCPProvider) extractKeywordsFromValue(v interface{}) ([]types.Keyword, error) { switch kw := v.(type) { - case []string: + case []types.Keyword: return kw, nil case []interface{}: - keywords := make([]string, 0, len(kw)) + keywords := make([]types.Keyword, 0, len(kw)) for _, item := range kw { - if s, ok := item.(string); ok { - keywords = append(keywords, s) + switch v := item.(type) { + case map[string]interface{}: + // Handle {k: "keyword", w: 0.9} format + k, _ := v["k"].(string) + w, _ := v["w"].(float64) + if k != "" { + if w == 0 { + w = 0.5 // Default weight + } + keywords = append(keywords, types.Keyword{K: k, W: w}) + } + case string: + // Plain string, use default weight + if v != "" { + keywords = append(keywords, types.Keyword{K: v, W: 0.5}) + } } } return keywords, nil case string: - var keywords []string + var keywords []types.Keyword if err := json.Unmarshal([]byte(kw), &keywords); err == nil { return keywords, nil } - return []string{kw}, nil + return []types.Keyword{{K: kw, W: 0.5}}, nil } - return []string{}, nil + return []types.Keyword{}, nil } diff --git a/agent/search/nlp/keyword/mcp_test.go b/agent/search/nlp/keyword/mcp_test.go index 77a3f993..40f40e3e 100644 --- a/agent/search/nlp/keyword/mcp_test.go +++ b/agent/search/nlp/keyword/mcp_test.go @@ -72,13 +72,13 @@ func TestMCPProviderWithCustomOptions(t *testing.T) { } func TestMCPProviderInvalidFormat(t *testing.T) { - // Test invalid MCP format fallback to builtin + // Test invalid MCP format fallback to system agent (requires context) extractor := keyword.NewExtractor("mcp:invalid", nil) - // Should fallback to builtin (no error) - keywords, err := extractor.Extract(nil, "test content for keyword extraction", nil) - assert.NoError(t, err) - assert.NotEmpty(t, keywords, "Should fallback to builtin and extract keywords") + // Should fallback to system agent which requires context + _, err := extractor.Extract(nil, "test content for keyword extraction", nil) + assert.Error(t, err) + assert.Contains(t, err.Error(), "context is required") } func TestMCPProviderServerNotFound(t *testing.T) { diff --git a/agent/search/nlp/querydsl/agent.go b/agent/search/nlp/querydsl/agent.go index 7142d9a5..85d6aa60 100644 --- a/agent/search/nlp/querydsl/agent.go +++ b/agent/search/nlp/querydsl/agent.go @@ -45,15 +45,14 @@ func (p *AgentProvider) Generate(ctx *agentContext.Context, input *Input) (*Resu var lastLintErrors string for attempt := 1; attempt <= MaxRetries; attempt++ { - // Build the request message - requestData := p.buildRequestData(input, attempt, lastLintErrors) - requestJSON, _ := json.Marshal(requestData) + // Build the request message in the format expected by querydsl agent + requestMessage := p.buildRequestMessage(input, attempt, lastLintErrors) // Create message for the agent messages := []agentContext.Message{ { Role: "user", - Content: string(requestJSON), + Content: requestMessage, }, } @@ -71,8 +70,8 @@ func (p *AgentProvider) Generate(ctx *agentContext.Context, input *Input) (*Resu continue } - // Parse the result - genResult, err := p.parseResult(result) + // Parse the result from response + genResult, err := p.parseResponse(result) if err != nil { lastError = err continue @@ -103,27 +102,32 @@ func (p *AgentProvider) Generate(ctx *agentContext.Context, input *Input) (*Resu return nil, fmt.Errorf("QueryDSL generation failed after %d attempts: %w", MaxRetries, lastError) } -// buildRequestData constructs the request data for the agent -func (p *AgentProvider) buildRequestData(input *Input, attempt int, lastLintErrors string) map[string]interface{} { +// buildRequestMessage constructs the request message for the agent +// Returns JSON format for structured communication with the agent +func (p *AgentProvider) buildRequestMessage(input *Input, attempt int, lastLintErrors string) string { + // Build request data as JSON requestData := map[string]interface{}{ "query": input.Query, "models": input.ModelIDs, "limit": input.Limit, } - // Add optional fields - if len(input.Wheres) > 0 { - requestData["wheres"] = input.Wheres + // Add schema from extra params if provided + if input.ExtraParams != nil { + if schema, ok := input.ExtraParams["schema"]; ok { + requestData["schema"] = schema + } } - if len(input.Orders) > 0 { - requestData["orders"] = input.Orders + + // Add scenario hint if specified (filter, aggregation, join, complex) + if input.Scenario != "" { + requestData["scenario"] = string(input.Scenario) } + + // Add allowed fields if specified if len(input.AllowedFields) > 0 { requestData["allowed_fields"] = input.AllowedFields } - if len(input.ExtraParams) > 0 { - requestData["extra"] = input.ExtraParams - } // Add retry context if this is a retry attempt if attempt > 1 && lastLintErrors != "" { @@ -134,7 +138,8 @@ func (p *AgentProvider) buildRequestData(input *Input, attempt int, lastLintErro } } - return requestData + jsonBytes, _ := json.Marshal(requestData) + return string(jsonBytes) } // validateDSL validates the generated QueryDSL using the linter @@ -150,18 +155,36 @@ func (p *AgentProvider) validateDSL(dsl *gou.QueryDSL) *linter.LintResult { return lintResult } -// parseResult extracts QueryDSL from the agent's response -// The agent should return data in NextHookResponse format: { data: { dsl: {...}, explain: "..." } } -// The Stream() response wraps this in: { next: { data: { dsl: {...} } } } -func (p *AgentProvider) parseResult(result interface{}) (*Result, error) { - if result == nil { +// parseResponse extracts QueryDSL from the agent's *context.Response +// Now that agent.Stream() returns *context.Response directly, +// we can access fields without type assertions. +// +// The querydsl agent returns QueryDSL in response.Next field +// Or returns error JSON: {"error": "code", "message": "..."} +func (p *AgentProvider) parseResponse(response *agentContext.Response) (*Result, error) { + if response == nil { return &Result{}, nil } - // Try to convert to map first (most common case) + // Check Next field first (custom hook data) + if response.Next != nil { + return p.parseNextData(response.Next) + } + + // No Next data, return empty result + return &Result{}, nil +} + +// parseNextData extracts QueryDSL from Next hook data +func (p *AgentProvider) parseNextData(next interface{}) (*Result, error) { + if next == nil { + return &Result{}, nil + } + + // Try to convert to map first var data map[string]interface{} - switch v := result.(type) { + switch v := next.(type) { case map[string]interface{}: data = v case string: @@ -171,7 +194,7 @@ func (p *AgentProvider) parseResult(result interface{}) (*Result, error) { } default: // Try to marshal and unmarshal - jsonBytes, err := json.Marshal(result) + jsonBytes, err := json.Marshal(next) if err != nil { return &Result{}, nil } @@ -180,49 +203,72 @@ func (p *AgentProvider) parseResult(result interface{}) (*Result, error) { } } - // Check for "next" field (custom hook data from NextHookResponse) - // Stream() returns: { next: { data: { dsl: {...} } } } - if next, hasNext := data["next"]; hasNext && next != nil { - if nextMap, ok := next.(map[string]interface{}); ok { - data = nextMap - } else if nextStr, ok := next.(string); ok { - if err := json.Unmarshal([]byte(nextStr), &data); err != nil { - return &Result{}, nil - } - } - } - - // Extract QueryDSL from data - // Try common field names: "dsl", "data", "data.dsl" genResult := &Result{} - // Get explain if present - if explain, ok := data["explain"].(string); ok { - genResult.Explain = explain + // Check for error response: {"error": "code", "message": "..."} + if errCode, hasError := data["error"]; hasError { + errMsg := "" + if msg, ok := data["message"].(string); ok { + errMsg = msg + } + return nil, fmt.Errorf("QueryDSL generation error [%v]: %s", errCode, errMsg) } - // Get warnings if present - if warnings, ok := data["warnings"]; ok { - genResult.Warnings = p.extractWarnings(warnings) + // Check if this is a direct QueryDSL (has "from" or "select" field) + // The querydsl agent returns QueryDSL directly, e.g., {"select": [...], "from": "table", ...} + if _, hasFrom := data["from"]; hasFrom { + genResult.DSL = p.extractDSL(data) + return genResult, nil + } + if _, hasSelect := data["select"]; hasSelect { + genResult.DSL = p.extractDSL(data) + return genResult, nil } - // Get DSL + // Check for "dsl" field wrapper: { dsl: {...} } if dsl, ok := data["dsl"]; ok { genResult.DSL = p.extractDSL(dsl) - } else if d, ok := data["data"]; ok { + if explain, ok := data["explain"].(string); ok { + genResult.Explain = explain + } + if warnings, ok := data["warnings"]; ok { + genResult.Warnings = p.extractWarnings(warnings) + } + return genResult, nil + } + + // Check for "data" field wrapper: { data: { dsl: {...}, explain: "...", warnings: [] } } + if d, ok := data["data"]; ok { if dm, ok := d.(map[string]interface{}); ok { + // Check if data.data contains dsl field: { data: { dsl: {...} } } if dsl, ok := dm["dsl"]; ok { genResult.DSL = p.extractDSL(dsl) + } else if _, hasFrom := dm["from"]; hasFrom { + // data.data is directly a QueryDSL (from __yao.querydsl Next hook) + genResult.DSL = p.extractDSL(dm) + } else if _, hasSelect := dm["select"]; hasSelect { + // data.data is directly a QueryDSL + genResult.DSL = p.extractDSL(dm) } + // Extract explain and warnings from data.data if explain, ok := dm["explain"].(string); ok { genResult.Explain = explain } if warnings, ok := dm["warnings"]; ok { genResult.Warnings = p.extractWarnings(warnings) } + return genResult, nil } } + // Fallback: Get explain and warnings from top level + if explain, ok := data["explain"].(string); ok { + genResult.Explain = explain + } + if warnings, ok := data["warnings"]; ok { + genResult.Warnings = p.extractWarnings(warnings) + } + return genResult, nil } diff --git a/agent/search/nlp/querydsl/builtin.go b/agent/search/nlp/querydsl/builtin.go deleted file mode 100644 index 76e5cdc6..00000000 --- a/agent/search/nlp/querydsl/builtin.go +++ /dev/null @@ -1,124 +0,0 @@ -package querydsl - -import ( - "github.com/yaoapp/gou/model" - "github.com/yaoapp/gou/query/gou" -) - -// BuiltinGenerator implements template-based QueryDSL generation -// This is a placeholder implementation that returns a basic QueryDSL. -// -// TODO: Implement actual template-based generation: -// - Parse natural language query -// - Match against model schema -// - Generate appropriate where clauses -// - Handle common query patterns (search, filter, sort) -// -// For production use cases requiring high accuracy, use Agent or MCP mode. -type BuiltinGenerator struct{} - -// NewBuiltinGenerator creates a new builtin QueryDSL generator -func NewBuiltinGenerator() *BuiltinGenerator { - return &BuiltinGenerator{} -} - -// Generate generates QueryDSL from natural language -// Currently returns a placeholder QueryDSL that searches all searchable fields -func (g *BuiltinGenerator) Generate(input *Input) (*Result, error) { - if input == nil || input.Query == "" { - return &Result{ - Warnings: []string{"empty query, returning empty DSL"}, - }, nil - } - - // Build a basic QueryDSL - dsl := &gou.QueryDSL{} - - // Set limit - limit := input.Limit - if limit <= 0 { - limit = 20 - } - dsl.Limit = limit - - // Apply pre-defined wheres if provided - if len(input.Wheres) > 0 { - dsl.Wheres = input.Wheres - } - - // Apply orders if provided - if len(input.Orders) > 0 { - dsl.Orders = input.Orders - } - - // Load models and try to generate basic search conditions - // Use the first model as the primary table, others can be joined - if len(input.ModelIDs) > 0 { - primaryModelID := input.ModelIDs[0] - - // Check if model exists before selecting - if !model.Exists(primaryModelID) { - return &Result{ - DSL: dsl, - Explain: "Generated basic QueryDSL (model not found)", - Warnings: []string{ - "model '" + primaryModelID + "' not found, returning basic DSL without search conditions", - }, - }, nil - } - - primaryModel := model.Select(primaryModelID) - if primaryModel != nil && len(primaryModel.MetaData.Columns) > 0 { - // Find searchable text columns (string/text types with index) - var searchableColumns []string - for _, col := range primaryModel.MetaData.Columns { - // Use Index as a proxy for searchable, and check for text types - if col.Index && (col.Type == "string" || col.Type == "text" || col.Type == "longText") { - searchableColumns = append(searchableColumns, col.Name) - } - } - - // If we have searchable columns and no pre-defined wheres, add a basic search - if len(searchableColumns) > 0 && len(input.Wheres) == 0 { - // Build OR conditions for searchable columns - orWheres := make([]gou.Where, 0, len(searchableColumns)) - for _, col := range searchableColumns { - orWheres = append(orWheres, gou.Where{ - Condition: gou.Condition{ - Field: &gou.Expression{Field: col}, - OP: "match", - Value: input.Query, - }, - }) - } - - // Wrap in OR group if multiple columns - if len(orWheres) > 1 { - // Mark all but the first as OR conditions - for i := 1; i < len(orWheres); i++ { - orWheres[i].OR = true - } - dsl.Wheres = []gou.Where{ - { - Wheres: orWheres, - }, - } - } else if len(orWheres) == 1 { - dsl.Wheres = orWheres - } - } - } - - // TODO: For multi-model queries, generate joins based on model relations - // This requires analyzing the relations between models and generating - // appropriate JOIN clauses in the QueryDSL - } - - return &Result{ - DSL: dsl, - Explain: "Generated basic search QueryDSL using builtin template (placeholder implementation)", - Warnings: []string{ - "builtin generator is a placeholder, consider using Agent or MCP mode for production", - }, - }, nil -} diff --git a/agent/search/nlp/querydsl/generator.go b/agent/search/nlp/querydsl/generator.go index b36c6285..0b531afe 100644 --- a/agent/search/nlp/querydsl/generator.go +++ b/agent/search/nlp/querydsl/generator.go @@ -1,13 +1,12 @@ // Package querydsl provides QueryDSL generation from natural language for DB search // Supports three modes via uses.querydsl configuration: -// - "builtin": Template-based generation (no external dependencies) -// - "": Delegate to an LLM-powered assistant for high-quality generation +// - "builtin" or "": Uses __yao.querydsl system agent (LLM-powered) +// - "": Delegate to a custom LLM-powered assistant // - "mcp:.": Call external MCP tool -// -// For production use cases requiring high accuracy, use Agent or MCP mode. package querydsl import ( + "fmt" "strings" "github.com/yaoapp/gou/query/gou" @@ -15,6 +14,9 @@ import ( "github.com/yaoapp/yao/agent/search/types" ) +// SystemQueryDSLAgent is the default system agent for QueryDSL generation +const SystemQueryDSLAgent = "__yao.querydsl" + // Generator generates QueryDSL from natural language // Mode is determined by uses.querydsl configuration type Generator struct { @@ -40,12 +42,13 @@ func (g *Generator) Generate(ctx *context.Context, input *Input) (*Result, error switch { case g.usesQueryDSL == "builtin" || g.usesQueryDSL == "": - result, err = g.builtinGenerate(input) + // Use system querydsl agent + result, err = g.agentGenerate(ctx, input, SystemQueryDSLAgent) case strings.HasPrefix(g.usesQueryDSL, "mcp:"): result, err = g.mcpGenerate(ctx, input) default: // Assume it's an assistant ID for Agent mode - result, err = g.agentGenerate(ctx, input) + result, err = g.agentGenerate(ctx, input, g.usesQueryDSL) } if err != nil { @@ -60,18 +63,13 @@ func (g *Generator) Generate(ctx *context.Context, input *Input) (*Result, error return result, nil } -// builtinGenerate uses template-based generation -// This is a lightweight implementation with no external dependencies. -// For better results, use Agent or MCP mode. -func (g *Generator) builtinGenerate(input *Input) (*Result, error) { - generator := NewBuiltinGenerator() - return generator.Generate(input) -} - // agentGenerate delegates to an LLM-powered assistant // The assistant can understand context and generate semantically correct QueryDSL -func (g *Generator) agentGenerate(ctx *context.Context, input *Input) (*Result, error) { - provider := NewAgentProvider(g.usesQueryDSL) +func (g *Generator) agentGenerate(ctx *context.Context, input *Input, agentID string) (*Result, error) { + if ctx == nil { + return nil, fmt.Errorf("context is required for QueryDSL generation") + } + provider := NewAgentProvider(agentID) return provider.Generate(ctx, input) } @@ -81,8 +79,8 @@ func (g *Generator) mcpGenerate(ctx *context.Context, input *Input) (*Result, er mcpRef := strings.TrimPrefix(g.usesQueryDSL, "mcp:") provider, err := NewMCPProvider(mcpRef) if err != nil { - // Fallback to builtin on invalid MCP format - return g.builtinGenerate(input) + // Fallback to system agent on invalid MCP format + return g.agentGenerate(ctx, input, SystemQueryDSLAgent) } return provider.Generate(ctx, input) } diff --git a/agent/search/nlp/querydsl/generator_test.go b/agent/search/nlp/querydsl/generator_test.go index 0f2b5736..a966d4b6 100644 --- a/agent/search/nlp/querydsl/generator_test.go +++ b/agent/search/nlp/querydsl/generator_test.go @@ -46,27 +46,24 @@ func TestNewGenerator(t *testing.T) { } } -func TestGenerator_Generate_Builtin(t *testing.T) { +func TestGenerator_Generate_Builtin_RequiresContext(t *testing.T) { + // Builtin mode now uses __yao.querydsl agent which requires context gen := NewGenerator("builtin", nil) - // Note: In real usage, models are loaded internally via model.Select() - // For this test, we just verify the basic flow works without models input := &Input{ Query: "find all active users", ModelIDs: []string{"user"}, Limit: 10, } - result, err := gen.Generate(nil, input) - assert.NoError(t, err) - assert.NotNil(t, result) - assert.NotNil(t, result.DSL) - assert.NotEmpty(t, result.Explain) - assert.NotEmpty(t, result.Warnings) + // Without context, should return error + _, err := gen.Generate(nil, input) + assert.Error(t, err) + assert.Contains(t, err.Error(), "context is required") } -func TestGenerator_Generate_EmptyMode(t *testing.T) { - // Empty mode should default to builtin +func TestGenerator_Generate_EmptyMode_RequiresContext(t *testing.T) { + // Empty mode defaults to __yao.querydsl agent which requires context gen := NewGenerator("", nil) input := &Input{ @@ -75,116 +72,45 @@ func TestGenerator_Generate_EmptyMode(t *testing.T) { Limit: 5, } - result, err := gen.Generate(nil, input) - assert.NoError(t, err) - assert.NotNil(t, result) + // Without context, should return error + _, err := gen.Generate(nil, input) + assert.Error(t, err) + assert.Contains(t, err.Error(), "context is required") } -func TestBuiltinGenerator_Generate(t *testing.T) { - gen := NewBuiltinGenerator() +func TestGenerator_Generate_AgentMode_RequiresContext(t *testing.T) { + // Custom agent mode requires context + gen := NewGenerator("custom.querydsl.agent", nil) - t.Run("empty query", func(t *testing.T) { - result, err := gen.Generate(&Input{}) - assert.NoError(t, err) - assert.NotNil(t, result) - assert.Nil(t, result.DSL) - assert.Contains(t, result.Warnings, "empty query, returning empty DSL") - }) + input := &Input{ + Query: "find users", + ModelIDs: []string{"user"}, + Limit: 10, + } - t.Run("nil input", func(t *testing.T) { - result, err := gen.Generate(nil) - assert.NoError(t, err) - assert.NotNil(t, result) - assert.Nil(t, result.DSL) - }) + _, err := gen.Generate(nil, input) + assert.Error(t, err) + assert.Contains(t, err.Error(), "context is required") +} - t.Run("basic query without models loaded", func(t *testing.T) { - // Models are loaded internally via model.Select() - // When model is not found, it still generates basic DSL - result, err := gen.Generate(&Input{ - Query: "find users", - ModelIDs: []string{"user"}, - Limit: 10, - }) - assert.NoError(t, err) - assert.NotNil(t, result) - assert.NotNil(t, result.DSL) - assert.Equal(t, 10, result.DSL.Limit) - }) +func TestGenerator_Generate_MCPMode_InvalidFormat(t *testing.T) { + // Invalid MCP format should fallback to system agent (which requires context) + gen := NewGenerator("mcp:invalid", nil) - t.Run("query with pre-defined wheres", func(t *testing.T) { - preWheres := []gou.Where{ - { - Condition: gou.Condition{ - Field: &gou.Expression{Field: "status"}, - OP: "=", - Value: "active", - }, - }, - } - result, err := gen.Generate(&Input{ - Query: "find users", - ModelIDs: []string{"user"}, - Wheres: preWheres, - Limit: 10, - }) - assert.NoError(t, err) - assert.NotNil(t, result) - assert.NotNil(t, result.DSL) - // Should use pre-defined wheres - assert.Equal(t, preWheres, result.DSL.Wheres) - }) + input := &Input{ + Query: "find users", + ModelIDs: []string{"user"}, + Limit: 10, + } - t.Run("query with orders", func(t *testing.T) { - orders := gou.Orders{ - {Field: &gou.Expression{Field: "created_at"}, Sort: "desc"}, - } - result, err := gen.Generate(&Input{ - Query: "find users", - ModelIDs: []string{"user"}, - Orders: orders, - Limit: 10, - }) - assert.NoError(t, err) - assert.NotNil(t, result) - assert.NotNil(t, result.DSL) - assert.Equal(t, orders, result.DSL.Orders) - }) + _, err := gen.Generate(nil, input) + assert.Error(t, err) + assert.Contains(t, err.Error(), "context is required") +} - t.Run("query with allowed fields", func(t *testing.T) { - result, err := gen.Generate(&Input{ - Query: "find users", - ModelIDs: []string{"user"}, - AllowedFields: []string{"id", "name", "email"}, - Limit: 10, - }) - assert.NoError(t, err) - assert.NotNil(t, result) - assert.NotNil(t, result.DSL) - }) - - t.Run("default limit", func(t *testing.T) { - result, err := gen.Generate(&Input{ - Query: "find users", - ModelIDs: []string{"user"}, - }) - assert.NoError(t, err) - assert.NotNil(t, result) - assert.NotNil(t, result.DSL) - assert.Equal(t, 20, result.DSL.Limit) - }) - - t.Run("multi-model query", func(t *testing.T) { - // Models are loaded internally via model.Select() - result, err := gen.Generate(&Input{ - Query: "find user orders", - ModelIDs: []string{"user", "order"}, - Limit: 10, - }) - assert.NoError(t, err) - assert.NotNil(t, result) - assert.NotNil(t, result.DSL) - }) +func TestSystemQueryDSLAgentConstant(t *testing.T) { + // Verify the system querydsl agent constant + assert.Equal(t, "__yao.querydsl", SystemQueryDSLAgent) } func TestResult(t *testing.T) { @@ -201,3 +127,80 @@ func TestResult(t *testing.T) { assert.NotEmpty(t, result.Explain) assert.Len(t, result.Warnings, 1) } + +func TestGenerator_ValidateFields(t *testing.T) { + gen := NewGenerator("", nil) + + t.Run("validate select fields", func(t *testing.T) { + result := &Result{ + DSL: &gou.QueryDSL{ + Select: []gou.Expression{ + {Field: "id"}, + {Field: "name"}, + {Field: "secret_field"}, + }, + }, + } + allowedFields := []string{"id", "name", "email"} + + validated := gen.validateFields(result, allowedFields) + assert.NotNil(t, validated) + assert.Len(t, validated.DSL.Select, 2) + assert.Contains(t, validated.Warnings[0], "secret_field") + }) + + t.Run("validate where fields", func(t *testing.T) { + result := &Result{ + DSL: &gou.QueryDSL{ + Wheres: []gou.Where{ + { + Condition: gou.Condition{ + Field: &gou.Expression{Field: "status"}, + OP: "=", + Value: "active", + }, + }, + { + Condition: gou.Condition{ + Field: &gou.Expression{Field: "secret"}, + OP: "=", + Value: "hidden", + }, + }, + }, + }, + } + allowedFields := []string{"status", "name"} + + validated := gen.validateFields(result, allowedFields) + assert.NotNil(t, validated) + assert.Len(t, validated.DSL.Wheres, 1) + assert.Contains(t, validated.Warnings[0], "secret") + }) + + t.Run("validate order fields", func(t *testing.T) { + result := &Result{ + DSL: &gou.QueryDSL{ + Orders: gou.Orders{ + {Field: &gou.Expression{Field: "created_at"}, Sort: "desc"}, + {Field: &gou.Expression{Field: "secret_sort"}, Sort: "asc"}, + }, + }, + } + allowedFields := []string{"created_at", "updated_at"} + + validated := gen.validateFields(result, allowedFields) + assert.NotNil(t, validated) + assert.Len(t, validated.DSL.Orders, 1) + assert.Contains(t, validated.Warnings[0], "secret_sort") + }) + + t.Run("nil DSL", func(t *testing.T) { + result := &Result{DSL: nil} + allowedFields := []string{"id", "name"} + + validated := gen.validateFields(result, allowedFields) + assert.NotNil(t, validated) + assert.Nil(t, validated.DSL) + }) +} diff --git a/agent/search/nlp/querydsl/types.go b/agent/search/nlp/querydsl/types.go index 0c9b6d3b..55693c75 100644 --- a/agent/search/nlp/querydsl/types.go +++ b/agent/search/nlp/querydsl/types.go @@ -2,12 +2,14 @@ package querydsl import ( "github.com/yaoapp/gou/query/gou" + "github.com/yaoapp/yao/agent/search/types" ) // Input contains all information needed to generate QueryDSL type Input struct { Query string // Natural language query ModelIDs []string // Target model IDs (e.g., ["user", "order", "product"]) + Scenario types.ScenarioType // QueryDSL scenario: "filter", "aggregation", "join", "complex" Wheres []gou.Where // Pre-defined filters (optional) Orders gou.Orders // Sort orders (optional) AllowedFields []string // Allowed fields whitelist (optional, for security validation) diff --git a/agent/search/rerank/agent.go b/agent/search/rerank/agent.go index 0a5137e6..994e50dd 100644 --- a/agent/search/rerank/agent.go +++ b/agent/search/rerank/agent.go @@ -59,20 +59,24 @@ func (p *AgentProvider) Rerank(ctx *context.Context, query string, items []*type }, } - result, err := agent.Stream(ctx, messages, options) + response, err := agent.Stream(ctx, messages, options) if err != nil { return nil, fmt.Errorf("agent stream failed: %w", err) } - // Parse response - return p.parseResponse(result, items, opts) + // Parse response from response.Next + return p.parseAgentResponse(response, items, opts) } -// parseResponse extracts reranked items from agent response -// The response format from agent.Stream is typically: -// { "next": { "data": { "order": [...] } } } -func (p *AgentProvider) parseResponse(result interface{}, originalItems []*types.ResultItem, opts *types.RerankOptions) ([]*types.ResultItem, error) { - if result == nil { +// parseAgentResponse extracts reranked items from agent's *context.Response +// Now that agent.Stream() returns *context.Response directly, +// we can access fields without type assertions. +// +// Expected response.Next format: +// { "order": ["ref_001", "ref_003", "ref_002"] } +// Or: { "items": [{ "citation_id": "ref_001", ... }, ...] } +func (p *AgentProvider) parseAgentResponse(response *context.Response, originalItems []*types.ResultItem, opts *types.RerankOptions) ([]*types.ResultItem, error) { + if response == nil || response.Next == nil { return originalItems, nil } @@ -84,20 +88,20 @@ func (p *AgentProvider) parseResponse(result interface{}, originalItems []*types } } - // Extract response data - response := extractResponseData(result) - if response == nil { + // Extract response data from Next field + data := extractNextData(response.Next) + if data == nil { return originalItems, nil } - // Try to get reranked order from response + // Try to get reranked order from data // Expected format: { "order": ["ref_001", "ref_003", "ref_002"] } // Or: { "items": [{ "citation_id": "ref_001", ... }, ...] } var reranked []*types.ResultItem // Try "order" field (list of citation IDs) - if order, ok := response["order"]; ok { + if order, ok := data["order"]; ok { if orderList := toStringSlice(order); len(orderList) > 0 { for _, id := range orderList { if item, exists := itemMap[id]; exists { @@ -116,7 +120,7 @@ func (p *AgentProvider) parseResponse(result interface{}, originalItems []*types // Try "items" field (full items or items with citation_id) if len(reranked) == 0 { - if items, ok := response["items"]; ok { + if items, ok := data["items"]; ok { if itemsList := toItemsList(items); len(itemsList) > 0 { for _, respItem := range itemsList { // Check if it's just a reference or full item @@ -150,20 +154,16 @@ func (p *AgentProvider) parseResponse(result interface{}, originalItems []*types return reranked, nil } -// extractResponseData extracts the actual response data from agent.Stream result -// Handles nested structures like { "next": { "data": { ... } } } -func extractResponseData(result interface{}) map[string]interface{} { - switch v := result.(type) { +// extractNextData extracts the actual data from response.Next field +// Handles nested structures like { "data": { ... } } +func extractNextData(next interface{}) map[string]interface{} { + if next == nil { + return nil + } + + switch v := next.(type) { case map[string]interface{}: - // Check for "next" wrapper (from NextHookResponse) - if next, ok := v["next"].(map[string]interface{}); ok { - // Check for "data" inside next - if data, ok := next["data"].(map[string]interface{}); ok { - return data - } - return next - } - // Check for direct "data" wrapper + // Check for "data" wrapper if data, ok := v["data"].(map[string]interface{}); ok { return data } @@ -172,16 +172,14 @@ func extractResponseData(result interface{}) map[string]interface{} { // Try to parse as JSON var data map[string]interface{} if err := json.Unmarshal([]byte(v), &data); err == nil { - return extractResponseData(data) + return extractNextData(data) } } // Try to handle other types by converting to JSON and back - if result != nil { - if bytes, err := json.Marshal(result); err == nil { - var data map[string]interface{} - if err := json.Unmarshal(bytes, &data); err == nil { - return extractResponseData(data) - } + if bytes, err := json.Marshal(next); err == nil { + var data map[string]interface{} + if err := json.Unmarshal(bytes, &data); err == nil { + return extractNextData(data) } } return nil diff --git a/agent/search/search.go b/agent/search/search.go index a8ed1373..a769832f 100644 --- a/agent/search/search.go +++ b/agent/search/search.go @@ -60,8 +60,14 @@ func (s *Searcher) Search(ctx *context.Context, req *types.Request) (*types.Resu return &types.Result{Error: "unsupported search type"}, nil } - // Execute search - result, err := handler.Search(req) + // Execute search - use context if handler supports it + var result *types.Result + var err error + if ctxHandler, ok := handler.(interfaces.ContextHandler); ok { + result, err = ctxHandler.SearchWithContext(ctx, req) + } else { + result, err = handler.Search(req) + } if err != nil { return &types.Result{Error: err.Error()}, nil } diff --git a/agent/search/types/types.go b/agent/search/types/types.go index 6d089a64..6cb70207 100644 --- a/agent/search/types/types.go +++ b/agent/search/types/types.go @@ -14,6 +14,17 @@ const ( SearchTypeDB SearchType = "db" // Database search (Yao Model/QueryDSL) ) +// ScenarioType represents the QueryDSL generation scenario +type ScenarioType string + +// ScenarioType constants for QueryDSL generation +const ( + ScenarioFilter ScenarioType = "filter" // Simple filtering queries + ScenarioAggregation ScenarioType = "aggregation" // Aggregation/grouping queries + ScenarioJoin ScenarioType = "join" // Multi-table join queries + ScenarioComplex ScenarioType = "complex" // Complex queries combining multiple features +) + // SourceType represents where the search result came from type SourceType string @@ -42,10 +53,11 @@ type Request struct { Graph bool `json:"graph,omitempty"` // Enable graph association // Database search specific - Models []string `json:"models,omitempty"` // Model IDs (e.g., "user", "agents.mybot.product") - Wheres []gou.Where `json:"wheres,omitempty"` // Pre-defined filters (optional), uses GOU QueryDSL Where - Orders gou.Orders `json:"orders,omitempty"` // Sort orders (optional), uses GOU QueryDSL Orders - Select []string `json:"select,omitempty"` // Fields to return (optional) + Models []string `json:"models,omitempty"` // Model IDs (e.g., "user", "agents.mybot.product") + Scenario ScenarioType `json:"scenario,omitempty"` // QueryDSL scenario: "filter", "aggregation", "join", "complex" + Wheres []gou.Where `json:"wheres,omitempty"` // Pre-defined filters (optional), uses GOU QueryDSL Where + Orders gou.Orders `json:"orders,omitempty"` // Sort orders (optional), uses GOU QueryDSL Orders + Select []string `json:"select,omitempty"` // Fields to return (optional) // Reranking Rerank *RerankOptions `json:"rerank,omitempty"` @@ -108,6 +120,12 @@ type ProcessedQuery struct { DSL *gou.QueryDSL `json:"dsl,omitempty"` // For DB search, uses GOU QueryDSL } +// Keyword represents an extracted keyword with weight +type Keyword struct { + K string `json:"k"` // Keyword text + W float64 `json:"w"` // Weight (0.1-1.0), higher means more relevant +} + // Note: For QueryDSL and Model types, use GOU types directly: // - github.com/yaoapp/gou/query/gou.QueryDSL // - github.com/yaoapp/gou/model.Model diff --git a/agent/test/README.md b/agent/test/README.md index daf76222..d4706a7c 100644 --- a/agent/test/README.md +++ b/agent/test/README.md @@ -110,10 +110,58 @@ Each line is a JSON object: | `expected` | any | No | Expected output (exact match) | | `user` | string | No | Override user ID | | `team` | string | No | Override team ID | +| `options` | Options | No | Context options (see below) | | `timeout` | string | No | Override timeout (e.g., "30s") | | `skip` | bool | No | Skip this test | | `metadata` | map | No | Additional metadata | +### Options + +The `options` field allows per-test-case configuration that maps to `context.Options`: + +| Field | Type | Description | +| ------------------------ | ------- | -------------------------------------------------- | +| `connector` | string | Override connector (e.g., `"deepseek.v3"`) | +| `mode` | string | Agent mode (default: `"chat"`) | +| `search` | bool | Enable/disable search mode (default: `true`) | +| `disable_global_prompts` | bool | Temporarily disable global prompts | +| `metadata` | map | Custom data passed to hooks (e.g., scenario) | +| `skip` | object | Skip configuration (see below) | + +#### Options.skip + +| Field | Type | Description | +| --------- | ---- | ------------------------ | +| `history` | bool | Skip history loading | +| `trace` | bool | Skip trace logging | +| `output` | bool | Skip output to client | +| `keyword` | bool | Skip keyword extraction | +| `search` | bool | Skip auto search | + +**Example with options:** + +```jsonl +{ + "id": "T001", + "input": "Query users with status active", + "options": { + "connector": "deepseek.v3", + "metadata": {"scenario": "filter"}, + "skip": {"trace": true} + }, + "assert": {"type": "json_path", "path": "from", "value": "users"} +} +``` + +**Using metadata for hook scenarios:** + +The `options.metadata` field is passed to agent hooks. For example, a Create Hook can read `options.metadata.scenario` to select different prompt presets: + +```jsonl +{"id": "T001", "input": "...", "options": {"metadata": {"scenario": "aggregation"}}} +{"id": "T002", "input": "...", "options": {"metadata": {"scenario": "join"}}} +``` + ### Input Types | Type | Description | Example | @@ -225,9 +273,28 @@ return { pass: true, message: "Validation passed" }; ### JSON Path Notes - Supports dot-notation: `$.field.subfield` or `field.subfield` +- Supports array indexing: `field[0]`, `field[0].subfield`, `field[0].nested[1]` +- Supports multiple expected values (OR logic): `"value": ["a", "b"]` - passes if actual matches any - Auto-extracts JSON from markdown code blocks (` ```json ... ``` `) - Works with both string output and structured objects +**Array index examples:** + +```jsonl +{"id": "T001", "assert": {"type": "json_path", "path": "wheres[0].like", "value": "%test%"}} +{"id": "T002", "assert": {"type": "json_path", "path": "wheres[0].in[0]", "value": "pending"}} +{"id": "T003", "assert": {"type": "json_path", "path": "joins[0].from", "value": "users"}} +{"id": "T004", "assert": {"type": "json_path", "path": "groups[0]", "value": "category"}} +``` + +**Multiple expected values (OR logic):** + +```jsonl +{"id": "T005", "assert": {"type": "json_path", "path": "error", "value": ["missing_schema", "missing_query"]}} +``` + +This passes if `error` equals either `"missing_schema"` or `"missing_query"`. + ## Output Formats Determined by `-o` file extension: diff --git a/agent/test/assert.go b/agent/test/assert.go index fd486368..1ba82ddf 100644 --- a/agent/test/assert.go +++ b/agent/test/assert.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "regexp" + "strconv" "strings" jsoniter "github.com/json-iterator/go" @@ -244,7 +245,7 @@ func (a *Asserter) assertJSONPath(assertion *Assertion, output interface{}) *Ass jsonData = v default: result.Passed = false - result.Message = "output is not a JSON object or array" + result.Message = fmt.Sprintf("output is not a JSON object or array, got: %T = %v", output, truncateOutput(output, 200)) return result } @@ -253,6 +254,8 @@ func (a *Asserter) assertJSONPath(assertion *Assertion, output interface{}) *Ass actual := a.extractPath(jsonData, path) result.Actual = actual + // Compare expected value with actual value + // First, try direct comparison (handles both primitive values and arrays) if validateOutput(actual, assertion.Value) { result.Passed = true result.Message = fmt.Sprintf("path '%s' equals expected value", assertion.Path) @@ -264,27 +267,113 @@ func (a *Asserter) assertJSONPath(assertion *Assertion, output interface{}) *Ass return result } -// extractPath extracts a value from JSON using a simple dot-notation path +// truncateOutput truncates output for error messages +func truncateOutput(output interface{}, maxLen int) string { + var s string + switch v := output.(type) { + case string: + s = v + case nil: + return "" + default: + bytes, err := jsoniter.Marshal(v) + if err != nil { + s = fmt.Sprintf("%v", v) + } else { + s = string(bytes) + } + } + + if len(s) > maxLen { + return s[:maxLen] + "..." + } + return s +} + +// extractPath extracts a value from JSON using dot-notation path with array index support +// Supports: "field", "field.nested", "field[0]", "field[0].nested", "field.nested[0].value" func (a *Asserter) extractPath(data interface{}, path string) interface{} { - parts := strings.Split(path, ".") current := data - for _, part := range parts { - if part == "" { + // Parse path into segments, handling both dots and array indices + // e.g., "wheres[0].like" -> ["wheres", "[0]", "like"] + segments := parsePathSegments(path) + + for _, segment := range segments { + if segment == "" { continue } - switch v := current.(type) { - case map[string]interface{}: - current = v[part] - default: - return nil + // Check if this is an array index like "[0]" + if strings.HasPrefix(segment, "[") && strings.HasSuffix(segment, "]") { + indexStr := segment[1 : len(segment)-1] + index, err := strconv.Atoi(indexStr) + if err != nil { + return nil + } + + arr, ok := current.([]interface{}) + if !ok { + return nil + } + + if index < 0 || index >= len(arr) { + return nil + } + current = arr[index] + } else { + // Regular field access + switch v := current.(type) { + case map[string]interface{}: + current = v[segment] + default: + return nil + } } } return current } +// parsePathSegments splits a path like "wheres[0].like" into ["wheres", "[0]", "like"] +func parsePathSegments(path string) []string { + var segments []string + var current strings.Builder + + for i := 0; i < len(path); i++ { + ch := path[i] + switch ch { + case '.': + if current.Len() > 0 { + segments = append(segments, current.String()) + current.Reset() + } + case '[': + if current.Len() > 0 { + segments = append(segments, current.String()) + current.Reset() + } + // Find the closing bracket + j := i + 1 + for j < len(path) && path[j] != ']' { + j++ + } + if j < len(path) { + segments = append(segments, path[i:j+1]) // Include "[" and "]" + i = j + } + default: + current.WriteByte(ch) + } + } + + if current.Len() > 0 { + segments = append(segments, current.String()) + } + + return segments +} + // assertRegex checks if output matches a regex pattern func (a *Asserter) assertRegex(assertion *Assertion, output interface{}) *AssertionResult { result := &AssertionResult{ diff --git a/agent/test/reporter.go b/agent/test/reporter.go index 7e486249..d1a16dfe 100644 --- a/agent/test/reporter.go +++ b/agent/test/reporter.go @@ -595,13 +595,13 @@ func (r *AgentReporter) Write(report *Report, w io.Writer) error { }, } - result, err := agent.Stream(ctx, messages, options) + response, err := agent.Stream(ctx, messages, options) if err != nil { return fmt.Errorf("reporter agent call failed: %w", err) } - // Extract content from result - content, err := r.extractContent(result) + // Extract content from response + content, err := r.extractContent(response) if err != nil { return fmt.Errorf("failed to extract report content: %w", err) } @@ -615,55 +615,25 @@ func (r *AgentReporter) Write(report *Report, w io.Writer) error { return nil } -// extractContent extracts the report content from the agent's response -func (r *AgentReporter) extractContent(result interface{}) (string, error) { - if result == nil { - return "", fmt.Errorf("agent returned nil result") +// extractContent extracts the report content from the agent's *context.Response +// Now that agent.Stream() returns *context.Response directly, +// we can access fields without type assertions. +func (r *AgentReporter) extractContent(response *context.Response) (string, error) { + if response == nil { + return "", fmt.Errorf("agent returned nil response") } - // Try to convert to map first (context.Response) - switch v := result.(type) { - case string: - return v, nil - - case *context.Response: - // Extract from completion content - if v.Completion != nil && v.Completion.Content != nil { - return r.contentToString(v.Completion.Content) - } - // Try next field - if v.Next != nil { - return r.contentToString(v.Next) - } - return "", fmt.Errorf("no content in response") - - case map[string]interface{}: - // Check for completion.content - if completion, ok := v["completion"].(map[string]interface{}); ok { - if content, ok := completion["content"]; ok { - return r.contentToString(content) - } - } - // Check for next - if next, ok := v["next"]; ok { - return r.contentToString(next) - } - // Check for content directly - if content, ok := v["content"]; ok { - return r.contentToString(content) - } - // Marshal the whole thing - jsonBytes, _ := jsoniter.Marshal(v) - return string(jsonBytes), nil - - default: - // Try to marshal as JSON - jsonBytes, err := jsoniter.Marshal(result) - if err != nil { - return fmt.Sprintf("%v", result), nil - } - return string(jsonBytes), nil + // Priority 1: Check Next field (custom hook data) + if response.Next != nil { + return r.contentToString(response.Next) } + + // Priority 2: Extract from completion content + if response.Completion != nil && response.Completion.Content != nil { + return r.contentToString(response.Completion.Content) + } + + return "", fmt.Errorf("no content in response") } // contentToString converts various content types to string diff --git a/agent/test/runner.go b/agent/test/runner.go index 939d2dae..8065c81c 100644 --- a/agent/test/runner.go +++ b/agent/test/runner.go @@ -64,15 +64,8 @@ func (r *Executor) RunDirect() (*Report, error) { ctx := NewTestContextFromOptions(chatID, agentInfo.ID, r.opts, tc) defer ctx.Release() - // Set options: skip history (input already contains conversation), connector override - opts := &context.Options{ - Skip: &context.Skip{ - History: true, // Skip history loading - input already contains full conversation - }, - } - if r.opts.Connector != "" { - opts.Connector = r.opts.Connector - } + // Build context options + opts := buildContextOptions(tc, r.opts) // Create timeout context timeout := tc.GetTimeout(r.opts.Timeout) @@ -103,12 +96,19 @@ func (r *Executor) RunDirect() (*Report, error) { output := extractOutput(response) r.output.DirectOutput(output) + // Determine connector: user-specified > agent default + connector := r.opts.Connector + if connector == "" { + connector = agentInfo.Connector + } + // Return minimal report (for exit code handling) return &Report{ Summary: &Summary{ - Total: 1, - Passed: 1, - AgentID: agentInfo.ID, + Total: 1, + Passed: 1, + AgentID: agentInfo.ID, + Connector: connector, }, }, nil } @@ -165,13 +165,19 @@ func (r *Executor) RunTests() (*Report, error) { return nil, fmt.Errorf("failed to get assistant: %w", err) } + // Determine connector: user-specified > agent default + connector := r.opts.Connector + if connector == "" { + connector = agentInfo.Connector + } + // Create report report := &Report{ Summary: &Summary{ Total: len(testCases), AgentID: agentInfo.ID, AgentPath: agentInfo.Path, - Connector: r.opts.Connector, + Connector: connector, RunsPerCase: r.opts.Runs, }, Environment: NewEnvironment(r.opts.UserID, r.opts.TeamID), @@ -279,6 +285,7 @@ func (r *Executor) runSingleTest(ast *assistant.Assistant, tc *Case, agentID str ID: tc.ID, Input: tc.Input, Expected: tc.Expected, + Options: tc.Options, } // Parse input to messages @@ -297,15 +304,8 @@ func (r *Executor) runSingleTest(ast *assistant.Assistant, tc *Case, agentID str ctx := NewTestContextFromOptions(chatID, agentID, r.opts, tc) defer ctx.Release() - // Set options: skip history (input already contains conversation), connector override - opts := &context.Options{ - Skip: &context.Skip{ - History: true, // Skip history loading - input already contains full conversation - }, - } - if r.opts.Connector != "" { - opts.Connector = r.opts.Connector - } + // Build context options from test case and runner options + opts := buildContextOptions(tc, r.opts) // Create timeout context timeout := tc.GetTimeout(r.opts.Timeout) @@ -477,23 +477,96 @@ func writeJSONLine(writer *bufio.Writer, data interface{}) error { return err } +// buildContextOptions builds context.Options from test case and runner options +// Priority: test case options > runner options > defaults +func buildContextOptions(tc *Case, runnerOpts *Options) *context.Options { + opts := &context.Options{ + Skip: &context.Skip{ + History: true, // Default: skip history loading - input already contains full conversation + }, + } + + // Apply test case options if specified + if tc.Options != nil { + // Connector: test case > runner + if tc.Options.Connector != "" { + opts.Connector = tc.Options.Connector + } + + // Mode + if tc.Options.Mode != "" { + opts.Mode = tc.Options.Mode + } + + // DisableGlobalPrompts + if tc.Options.DisableGlobalPrompts { + opts.DisableGlobalPrompts = true + } + + // Search (pointer to distinguish unset from false) + if tc.Options.Search != nil { + opts.Search = tc.Options.Search + } + + // Metadata for hooks + if tc.Options.Metadata != nil { + opts.Metadata = tc.Options.Metadata + } + + // Skip options from test case + if tc.Options.Skip != nil { + opts.Skip.Trace = tc.Options.Skip.Trace + opts.Skip.Output = tc.Options.Skip.Output + opts.Skip.Keyword = tc.Options.Skip.Keyword + opts.Skip.Search = tc.Options.Skip.Search + // Note: History defaults to true for tests + } + } + + // Runner connector override (highest priority) + if runnerOpts != nil && runnerOpts.Connector != "" { + opts.Connector = runnerOpts.Connector + } + + return opts +} + // extractOutput extracts the output from the agent response -func extractOutput(response interface{}) interface{} { +// Priority: Next hook data (if non-empty) > Completion content > nil +func extractOutput(response *context.Response) interface{} { if response == nil { return nil } - // Try to get completion content from context.Response - if resp, ok := response.(*context.Response); ok { - if resp.Completion != nil { - return resp.Completion.Content - } - if resp.Next != nil { - return resp.Next - } + // Prefer Next hook data if available and non-empty + // response.Next is already the Data value (not NextHookResponse struct) + if response.Next != nil && !isEmptyValue(response.Next) { + return response.Next + } + // Fall back to raw completion content + if response.Completion != nil { + return response.Completion.Content } - return response + return nil +} + +// isEmptyValue checks if a value is considered "empty" for output purposes +func isEmptyValue(v interface{}) bool { + if v == nil { + return true + } + + switch val := v.(type) { + case string: + return val == "" + case map[string]interface{}: + return len(val) == 0 + case []interface{}: + return len(val) == 0 + } + + return false } // validateOutput validates the actual output against expected diff --git a/agent/test/types.go b/agent/test/types.go index ac7c785a..b2ac9698 100644 --- a/agent/test/types.go +++ b/agent/test/types.go @@ -205,8 +205,13 @@ type Case struct { TeamID string `json:"team,omitempty"` // Metadata contains additional metadata for the test case + // This is passed to ctx.Metadata and can be used by Create Hook Metadata map[string]interface{} `json:"metadata,omitempty"` + // Options contains context options for this test case + // Supports: connector, skip (history, trace, output, keyword, search), mode + Options *CaseOptions `json:"options,omitempty"` + // Skip indicates whether to skip this test case Skip bool `json:"skip,omitempty"` @@ -215,6 +220,38 @@ type Case struct { Timeout string `json:"timeout,omitempty"` } +// CaseOptions represents per-test-case context options +// Maps to context.Options fields +type CaseOptions struct { + // Connector overrides the agent's default connector + Connector string `json:"connector,omitempty"` + + // Skip configuration + Skip *CaseSkipOptions `json:"skip,omitempty"` + + // DisableGlobalPrompts temporarily disables global prompts for this request + DisableGlobalPrompts bool `json:"disable_global_prompts,omitempty"` + + // Search mode, default is true (use pointer to distinguish unset from false) + Search *bool `json:"search,omitempty"` + + // Mode is the agent mode (default: "chat") + Mode string `json:"mode,omitempty"` + + // Metadata for passing custom data to hooks (e.g., scenario selection) + Metadata map[string]interface{} `json:"metadata,omitempty"` +} + +// CaseSkipOptions represents skip configuration for a test case +// Maps to context.Skip fields +type CaseSkipOptions struct { + History bool `json:"history,omitempty"` // Skip history loading + Trace bool `json:"trace,omitempty"` // Skip trace logging + Output bool `json:"output,omitempty"` // Skip output to client + Keyword bool `json:"keyword,omitempty"` // Skip keyword extraction + Search bool `json:"search,omitempty"` // Skip auto search +} + // Assertion represents a single assertion rule type Assertion struct { // Type is the assertion type: @@ -334,6 +371,9 @@ type Result struct { // Error contains the error message if status is failed/error/timeout Error string `json:"error,omitempty"` + // Options contains the context options used for this test case + Options *CaseOptions `json:"options,omitempty"` + // Metadata contains additional result metadata Metadata map[string]interface{} `json:"metadata,omitempty"` } diff --git a/agent/testutils/testutils.go b/agent/testutils/testutils.go index 5c79c7a7..104ad06a 100644 --- a/agent/testutils/testutils.go +++ b/agent/testutils/testutils.go @@ -3,6 +3,12 @@ package testutils import ( "testing" + _ "github.com/yaoapp/gou/encoding" + "github.com/yaoapp/gou/model" + "github.com/yaoapp/gou/query" + "github.com/yaoapp/gou/query/gou" + _ "github.com/yaoapp/gou/text" + "github.com/yaoapp/xun/capsule" "github.com/yaoapp/yao/agent" "github.com/yaoapp/yao/config" "github.com/yaoapp/yao/kb" @@ -28,6 +34,21 @@ func Prepare(t *testing.T, opts ...interface{}) { if err != nil { t.Fatal(err) } + + // Register default query engine (required for DB search) + // capsule.Global is initialized by test.Prepare + if _, has := query.Engines["default"]; !has && capsule.Global != nil { + query.Register("default", &gou.Query{ + Query: capsule.Query(), + GetTableName: func(s string) string { + if mod, has := model.Models[s]; has { + return mod.MetaData.Table.Name + } + return s + }, + AESKey: config.Conf.DB.AESKey, + }) + } } // Clean clean the test environment diff --git a/data/bindata.go b/data/bindata.go index e9cf4f75..c4c97090 100644 --- a/data/bindata.go +++ b/data/bindata.go @@ -80,7 +80,12 @@ // .tmp/data/yao/assistants/prompt/package.yao // .tmp/data/yao/assistants/prompt/prompts.yml // .tmp/data/yao/assistants/querydsl/package.yao +// .tmp/data/yao/assistants/querydsl/prompts/aggregation.yml +// .tmp/data/yao/assistants/querydsl/prompts/complex.yml +// .tmp/data/yao/assistants/querydsl/prompts/filter.yml +// .tmp/data/yao/assistants/querydsl/prompts/join.yml // .tmp/data/yao/assistants/querydsl/prompts.yml +// .tmp/data/yao/assistants/querydsl/src/index.ts // .tmp/data/yao/assistants/title/package.yao // .tmp/data/yao/assistants/title/prompts.yml // .tmp/data/yao/data/icons/404.png @@ -335,7 +340,7 @@ func cuiSetupIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "cui/setup/index.html", size: 10, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "cui/setup/index.html", size: 10, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -355,7 +360,7 @@ func cuiV09IndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "cui/v0.9/index.html", size: 13, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "cui/v0.9/index.html", size: 13, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -375,7 +380,7 @@ func cuiV10IndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "cui/v1.0/index.html", size: 49, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "cui/v1.0/index.html", size: 49, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -395,7 +400,7 @@ func cuiV10Layouts__indexAsyncJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "cui/v1.0/layouts__index.async.js", size: 71, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "cui/v1.0/layouts__index.async.js", size: 71, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -415,7 +420,7 @@ func cuiV10UmiJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "cui/v1.0/umi.js", size: 71, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "cui/v1.0/umi.js", size: 71, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -435,7 +440,7 @@ func initEnv() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.env", size: 219, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/.env", size: 219, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -455,7 +460,7 @@ func initVscodeSettingsJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/settings.json", size: 4666, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/.vscode/settings.json", size: 4666, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -475,7 +480,7 @@ func initVscodeTypesRuntimeConsoleDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/console.d.ts", size: 221, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/console.d.ts", size: 221, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -495,7 +500,7 @@ func initVscodeTypesRuntimeExceptionDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/exception.d.ts", size: 738, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/exception.d.ts", size: 738, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -515,7 +520,7 @@ func initVscodeTypesRuntimeFsDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/fs.d.ts", size: 8554, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/fs.d.ts", size: 8554, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -535,7 +540,7 @@ func initVscodeTypesRuntimeGlobalDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/global.d.ts", size: 1759, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/global.d.ts", size: 1759, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -555,7 +560,7 @@ func initVscodeTypesRuntimeHttpDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/http.d.ts", size: 6179, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/http.d.ts", size: 6179, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -575,7 +580,7 @@ func initVscodeTypesRuntimeIoDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/io.d.ts", size: 587, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/io.d.ts", size: 587, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -595,7 +600,7 @@ func initVscodeTypesRuntimeLogDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/log.d.ts", size: 1692, mode: os.FileMode(493), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/log.d.ts", size: 1692, mode: os.FileMode(493), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -615,7 +620,7 @@ func initVscodeTypesRuntimeNeoDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/neo.d.ts", size: 3750, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/neo.d.ts", size: 3750, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -635,7 +640,7 @@ func initVscodeTypesRuntimeProcessFsDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/process/fs.d.ts", size: 11133, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/process/fs.d.ts", size: 11133, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -655,7 +660,7 @@ func initVscodeTypesRuntimeProcessHttpDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/process/http.d.ts", size: 5653, mode: os.FileMode(493), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/process/http.d.ts", size: 5653, mode: os.FileMode(493), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -675,7 +680,7 @@ func initVscodeTypesRuntimeProcessModelDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/process/model.d.ts", size: 6656, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/process/model.d.ts", size: 6656, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -695,7 +700,7 @@ func initVscodeTypesRuntimeProcessDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/process.d.ts", size: 23165, mode: os.FileMode(493), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/process.d.ts", size: 23165, mode: os.FileMode(493), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -715,7 +720,7 @@ func initVscodeTypesRuntimeQueryDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/query.d.ts", size: 6124, mode: os.FileMode(493), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/query.d.ts", size: 6124, mode: os.FileMode(493), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -735,7 +740,7 @@ func initVscodeTypesRuntimeStoreDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/store.d.ts", size: 2251, mode: os.FileMode(493), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/store.d.ts", size: 2251, mode: os.FileMode(493), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -755,7 +760,7 @@ func initVscodeTypesRuntimeSuiDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/sui.d.ts", size: 1713, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/sui.d.ts", size: 1713, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -775,7 +780,7 @@ func initVscodeTypesRuntimeTimeDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/time.d.ts", size: 711, mode: os.FileMode(493), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/time.d.ts", size: 711, mode: os.FileMode(493), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -795,7 +800,7 @@ func initVscodeTypesRuntimeDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime.d.ts", size: 424, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime.d.ts", size: 424, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -815,7 +820,7 @@ func initVscodeTypesSuiDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/sui.d.ts", size: 8931, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/.vscode/types/sui.d.ts", size: 8931, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -835,7 +840,7 @@ func initAppYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/app.yao", size: 3115, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/app.yao", size: 3115, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -855,7 +860,7 @@ func initDataReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/data/README.md", size: 41, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/data/README.md", size: 41, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -875,7 +880,7 @@ func initDataTemplatesDefault__assetsReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/data/templates/default/__assets/README.md", size: 33, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/data/templates/default/__assets/README.md", size: 33, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -895,7 +900,7 @@ func initDataTemplatesDefault__assetsImagesIconsAppPng() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/data/templates/default/__assets/images/icons/app.png", size: 34558, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/data/templates/default/__assets/images/icons/app.png", size: 34558, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -915,7 +920,7 @@ func initDataTemplatesDefault__assetsImagesLogosLogo_colorSvg() (*asset, error) return nil, err } - info := bindataFileInfo{name: "init/data/templates/default/__assets/images/logos/logo_color.svg", size: 2909, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/data/templates/default/__assets/images/logos/logo_color.svg", size: 2909, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -935,7 +940,7 @@ func initDataTemplatesDefault__assetsImagesLogosWordmarkSvg() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/data/templates/default/__assets/images/logos/wordmark.svg", size: 3615, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/data/templates/default/__assets/images/logos/wordmark.svg", size: 3615, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -955,7 +960,7 @@ func initDataTemplatesDefault__dataJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/data/templates/default/__data.json", size: 30, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/data/templates/default/__data.json", size: 30, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -975,7 +980,7 @@ func initDataTemplatesDefault__documentHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/data/templates/default/__document.html", size: 492, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/data/templates/default/__document.html", size: 492, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -995,7 +1000,7 @@ func initDataTemplatesDefaultIndexIndexCss() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/data/templates/default/index/index.css", size: 2896, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/data/templates/default/index/index.css", size: 2896, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1015,7 +1020,7 @@ func initDataTemplatesDefaultIndexIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/data/templates/default/index/index.html", size: 2361, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/data/templates/default/index/index.html", size: 2361, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1035,7 +1040,7 @@ func initDataTemplatesDefaultIndexIndexJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/data/templates/default/index/index.json", size: 31, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/data/templates/default/index/index.json", size: 31, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1055,7 +1060,7 @@ func initDbReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/db/README.md", size: 84, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/db/README.md", size: 84, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1075,7 +1080,7 @@ func initFlowsMenuFlowYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/flows/menu.flow.yao", size: 813, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/flows/menu.flow.yao", size: 813, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1095,7 +1100,7 @@ func initFormsAccountFormYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/forms/account.form.yao", size: 1194, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/forms/account.form.yao", size: 1194, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1115,7 +1120,7 @@ func initIconsAppIcns() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/icons/app.icns", size: 67465, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/icons/app.icns", size: 67465, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1135,7 +1140,7 @@ func initIconsAppIco() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/icons/app.ico", size: 54993, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/icons/app.ico", size: 54993, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1155,7 +1160,7 @@ func initIconsAppPng() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/icons/app.png", size: 34558, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/icons/app.png", size: 34558, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1175,7 +1180,7 @@ func initLoginsAdminLoginYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/logins/admin.login.yao", size: 302, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/logins/admin.login.yao", size: 302, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1195,7 +1200,7 @@ func initLogsReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/logs/README.md", size: 28, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/logs/README.md", size: 28, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1215,7 +1220,7 @@ func initModelsAdminUserModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/models/admin/user.mod.yao", size: 6416, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/models/admin/user.mod.yao", size: 6416, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1235,7 +1240,7 @@ func initModelsTestsPetModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/models/tests/pet.mod.yao", size: 525, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/models/tests/pet.mod.yao", size: 525, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1255,7 +1260,7 @@ func initNeoNeoYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/neo/neo.yml", size: 724, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/neo/neo.yml", size: 724, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1275,7 +1280,7 @@ func initPublicReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/public/README.md", size: 108, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/public/README.md", size: 108, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1295,7 +1300,7 @@ func initPublicAssetsReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/public/assets/README.md", size: 33, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/public/assets/README.md", size: 33, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1315,7 +1320,7 @@ func initPublicAssetsImagesIconsAppPng() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/public/assets/images/icons/app.png", size: 34558, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/public/assets/images/icons/app.png", size: 34558, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1335,7 +1340,7 @@ func initPublicAssetsImagesLogosLogo_colorSvg() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/public/assets/images/logos/logo_color.svg", size: 2909, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/public/assets/images/logos/logo_color.svg", size: 2909, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1355,7 +1360,7 @@ func initPublicAssetsImagesLogosWordmarkSvg() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/public/assets/images/logos/wordmark.svg", size: 3615, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/public/assets/images/logos/wordmark.svg", size: 3615, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1375,7 +1380,7 @@ func initPublicAssetsLibsuiMinJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/public/assets/libsui.min.js", size: 12569, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/public/assets/libsui.min.js", size: 12569, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1395,7 +1400,7 @@ func initPublicAssetsLibsuiMinJsMap() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/public/assets/libsui.min.js.map", size: 38553, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/public/assets/libsui.min.js.map", size: 38553, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1415,7 +1420,7 @@ func initPublicIndexCfg() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/public/index.cfg", size: 85, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/public/index.cfg", size: 85, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1435,7 +1440,7 @@ func initPublicIndexSui() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/public/index.sui", size: 5682, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/public/index.sui", size: 5682, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1455,7 +1460,7 @@ func initScriptsAccountTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/scripts/account.ts", size: 2521, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/scripts/account.ts", size: 2521, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1475,7 +1480,7 @@ func initScriptsAiNeoTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/scripts/ai/neo.ts", size: 375, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/scripts/ai/neo.ts", size: 375, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1495,7 +1500,7 @@ func initScriptsTestsTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/scripts/tests.ts", size: 1044, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/scripts/tests.ts", size: 1044, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1515,7 +1520,7 @@ func initScriptsUtilsTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/scripts/utils.ts", size: 1230, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/scripts/utils.ts", size: 1230, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1535,7 +1540,7 @@ func initSuisWebSuiYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/suis/web.sui.yao", size: 675, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/suis/web.sui.yao", size: 675, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1555,7 +1560,7 @@ func initTablesAccountTabYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/tables/account.tab.yao", size: 5597, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/tables/account.tab.yao", size: 5597, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1575,7 +1580,7 @@ func initTsconfigJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/tsconfig.json", size: 178, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "init/tsconfig.json", size: 178, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1595,7 +1600,7 @@ func libsuiAgentTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "libsui/agent.ts", size: 15267, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "libsui/agent.ts", size: 15267, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1615,7 +1620,7 @@ func libsuiIndexTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "libsui/index.ts", size: 13049, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "libsui/index.ts", size: 13049, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1635,7 +1640,7 @@ func libsuiUtilsTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "libsui/utils.ts", size: 5959, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "libsui/utils.ts", size: 5959, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1655,7 +1660,7 @@ func libsuiYaoTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "libsui/yao.ts", size: 4338, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "libsui/yao.ts", size: 4338, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1675,7 +1680,7 @@ func publicIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "public/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "public/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1695,7 +1700,7 @@ func uiIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "ui/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "ui/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1715,7 +1720,7 @@ func yaoAssistantsEntityPackageYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/assistants/entity/package.yao", size: 212, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/assistants/entity/package.yao", size: 212, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1735,7 +1740,7 @@ func yaoAssistantsEntityPromptsYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/assistants/entity/prompts.yml", size: 930, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/assistants/entity/prompts.yml", size: 930, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1755,12 +1760,12 @@ func yaoAssistantsKeywordPackageYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/assistants/keyword/package.yao", size: 200, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/assistants/keyword/package.yao", size: 200, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _yaoAssistantsKeywordPromptsYml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x44\x91\x41\x6f\x13\x31\x10\x85\xef\xf9\x15\x4f\x39\x81\x94\x58\x4a\xa1\x97\xdc\x38\x00\x02\x54\x40\x6d\x39\x21\xa4\xb8\xbb\xd3\xac\x89\x77\xc6\xf2\xcc\x8a\x6e\x81\xff\x5e\xc5\x8e\x93\xdb\x8c\xf6\x7d\xef\xcd\x3e\xaf\x91\x25\xd2\x16\x3a\xab\xd1\xb8\x00\x3a\x61\x23\xb6\x2d\xfe\x2d\x00\xe0\xfd\x93\x65\xdf\x19\x0e\x34\xff\x91\xdc\x2b\x1e\xb3\x8c\x30\x7a\xb2\xa6\x74\x8b\x22\xbc\xf7\x7a\xd8\x96\x69\xe3\xf0\x8e\x7d\x9c\x9f\x09\x81\xd3\x64\x45\x5d\xbe\x5c\xb9\xb3\x5f\x18\x93\x64\xf3\x7c\x71\x2e\x8a\x37\x0e\xb7\x64\x53\x66\x7c\xbe\xfb\xf6\x15\x8f\x92\x47\x5f\xd9\xb7\x0e\x37\xde\xba\xe1\xe4\x19\x3d\xef\x27\xbf\xa7\x1a\x7e\x4b\x9a\x84\x95\xf0\xa1\x00\x78\x55\x68\xe1\x38\xbf\xae\x37\xed\x76\xbb\xdf\x2a\x5c\xe6\xbf\xcb\x16\xb9\xdc\xe2\x67\x5b\x36\xcb\x15\xda\x7c\xb5\x5c\xc1\x39\xf7\xeb\x7f\x63\x6b\xca\xc7\x29\xf4\x14\x03\x93\x56\xd3\xf5\xf9\x6f\xae\xd7\x9b\xeb\x4b\x45\x0f\x5e\xa9\x87\x70\x6b\x08\x91\x78\x6f\xc3\x89\xf9\x9e\x83\xe4\x60\xe1\x99\xc0\x32\xb1\xae\x90\xb2\x24\xca\x6d\x3b\xd0\x7c\x04\x3b\x4a\xa6\x27\xe4\x13\x77\x71\xea\x09\x1a\x78\x1f\x09\x35\xc5\x73\x0f\x1d\x24\x1b\xd2\x90\xbd\x92\x9e\x6f\xaa\xe2\x4e\xc6\x51\x18\x6a\x92\x70\x29\x78\x8d\x2f\xed\xcc\x9b\x1f\x77\xf7\x78\x38\x3e\x12\x6c\x20\xa8\x1f\xe9\x5c\x2b\xbc\xd6\xa2\x17\x2f\x01\x00\x00\xff\xff\x64\x5a\xdf\x11\x21\x02\x00\x00") +var _yaoAssistantsKeywordPromptsYml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x64\x52\x41\x4f\xdb\x58\x10\xbe\xe7\x57\x8c\x72\x62\xa5\xe4\xad\x59\x2d\x0b\xf8\xb6\x5a\x72\xd8\xdd\x92\xa0\xa6\x52\x85\xaa\x1e\x26\xce\x10\xbb\x3c\xfb\xb9\xef\x3d\x93\x18\xf5\x10\xa8\x48\x11\x02\x81\x28\x42\x1c\x5a\x95\x70\x48\x51\x25\x5a\xf5\x50\xb5\xaa\x1a\xf5\xbf\x00\x4e\xf0\xbf\xa8\x1c\x3b\x10\xb5\x37\x7b\xde\x37\xf3\xcd\xf7\xcd\x57\x04\x29\x38\x99\xa0\x42\xa5\xc9\xcd\x01\x58\xc2\xd3\xe4\x69\x13\x9e\xe5\x00\x00\x96\x45\x00\x28\x09\x10\x56\x29\x6c\x0a\x59\x07\x6a\x69\x89\x96\x76\x84\x07\x5a\x08\x5e\x80\x72\xe5\x01\x20\x58\x36\xea\x9a\xd0\x0c\x16\x44\x5a\xf1\x54\x93\x24\x3c\x0d\x48\x25\x58\x05\x42\x82\x2f\xc5\x9a\x53\x27\xa0\x96\xcf\xd1\xc3\x51\x9d\x8d\x69\x24\x54\xca\xf7\x96\xe1\x89\xa8\x99\x80\x1e\xf2\x70\x9d\x40\x53\x4b\x03\x7a\x75\x10\x81\xf6\x03\x0d\x08\xff\x55\x2b\x65\x40\x29\x31\x04\xb1\x32\xde\x49\x41\xd3\xd1\x36\x34\xc9\x69\xd8\x5a\xb1\xdc\x68\x64\x25\x6d\x59\x11\xd2\x45\x6d\xc2\xa3\x7c\x06\x36\x53\x58\xbe\x00\x8c\xb1\xc7\x29\xf6\xe1\xa8\x64\x8e\xbe\x8b\x30\xcd\x0c\x13\xfe\x11\x92\x40\x0b\xdf\xb1\xb2\xaa\xc1\xe6\x8a\x06\x9b\x37\xe1\x7f\x0a\x13\x97\x2c\xf2\xb5\xba\x7d\xfb\xab\x68\xb0\x59\x13\xaa\x81\xef\x0b\xa9\x1d\xaf\x01\xda\x26\x97\xee\x00\x7f\x16\x0d\x36\x63\xc2\x12\x49\xc7\xb7\x49\x22\xbf\x9b\x31\xc2\x94\x5a\xe8\xfa\x9c\xd4\x78\x89\x7f\x3d\x3f\xd0\x53\xa5\xf2\x6f\x26\xe4\x17\x68\x8d\xb8\xf0\x49\x2a\x58\x91\x81\xd2\x12\x35\xd5\x53\xcd\x16\x72\x5e\x43\x6b\x15\x6c\xe2\x9c\x41\xa9\xfa\x87\x31\x3d\x0b\xa8\x42\xcf\xfa\x1d\x9b\xe8\x68\x70\xdc\xc4\x76\xaa\x83\x24\xac\x63\xcd\xe1\x8e\x0e\x59\x3e\x63\x49\x4d\x4a\xdc\x99\x68\x31\xa7\xf3\x05\x48\x0b\xb6\x14\x9e\x08\x54\x72\xb9\x86\x44\xd7\x75\xbc\x86\x69\xb0\xf9\xe4\x3d\xa5\x32\x0d\x36\x97\xfc\x59\xa2\x4e\x93\x0c\xa6\xc1\x66\xf3\x99\xbb\x63\x31\xd7\x5f\x2e\x06\xc7\x2f\x12\x41\xc3\xa3\xf3\xc1\xf6\xe7\x68\x7f\x2f\xee\x6d\xff\xbd\xb4\x14\x1d\x7c\x88\x76\xce\x07\x5b\x67\x57\xed\x8d\xb8\xfb\x29\x7e\x7d\x16\xed\x75\xe3\xee\xf7\xab\xf6\x66\xfc\xaa\x7d\xd3\xdb\xb8\xfe\x76\x12\xed\x1e\xc7\xbd\xe3\xe8\xe3\x7e\xb4\x73\x7a\xd3\xef\x47\x87\xbb\x51\x67\x2b\xba\x38\x89\xf6\x4e\x87\x47\xe7\x57\xed\xcd\x5f\x25\x0d\xda\x6f\x6f\x9e\xf7\xd3\xde\x54\x53\x4a\x14\xb7\xdf\x44\x5f\x7b\x63\x1d\xe9\x98\xe1\xfb\xee\xf0\xa0\x33\x56\x93\xee\x77\xdd\x7f\x19\xbf\xdb\x9d\x54\x72\x3f\x98\xb8\xd0\x28\xae\x59\x30\xef\x62\x59\x00\x4f\x68\x3b\x09\x00\x71\x45\x19\x74\x11\x5b\x30\x73\x9b\xd6\x02\x28\x21\x93\x0b\xd6\xc2\x2c\xb3\x19\xac\x1a\xb8\x2e\x4a\x67\x3d\x71\x92\x8f\x6e\xfc\x53\xce\x16\x51\x5b\x36\x38\x89\x9b\xc0\xd1\x6b\x04\xd8\x20\x98\x2a\x95\x2f\x3b\x87\xa5\x72\x01\x52\x83\x2f\x3b\x87\x99\xd3\xb9\x1f\x01\x00\x00\xff\xff\x4d\xf5\x83\x7b\xde\x03\x00\x00") func yaoAssistantsKeywordPromptsYmlBytes() ([]byte, error) { return bindataRead( @@ -1775,12 +1780,12 @@ func yaoAssistantsKeywordPromptsYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/assistants/keyword/prompts.yml", size: 545, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/assistants/keyword/prompts.yml", size: 990, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _yaoAssistantsKeywordSrcIndexTs = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x56\xdf\x72\xe3\xb4\x17\xbe\xf7\x53\x9c\x9f\x67\x67\x7f\x4e\xea\xd8\x6d\xb9\x4b\xc9\x96\x65\x59\x66\x81\x52\x3a\xdb\xe5\x2a\x0e\x83\x62\xcb\x89\xc7\xb2\x64\x24\x99\x34\x43\x33\xc3\x73\x70\xc9\x73\xf0\x34\xbc\x00\xaf\xc0\x1c\x49\xb6\x95\xb4\xec\x30\xf4\xc6\x8a\x74\xce\xf7\x9d\x7f\xfa\xd4\x74\x3a\x0d\x60\x0a\xdf\xd0\xfd\x4e\xc8\x02\xde\x3e\x68\x49\x72\x5d\x09\x0e\xaf\x37\x94\x6b\x98\xc1\x2d\x7d\xd0\xf0\x4e\x88\x1a\xed\xee\x88\x54\x54\xc1\xcd\xcd\xb7\x20\xa9\x6a\x05\x57\x14\x08\x2f\x80\x5a\x3f\x05\xb5\x05\x52\xb0\xab\xf4\x16\xa8\x94\x42\x82\x16\x8c\x4a\xc2\x73\x1a\xc0\x34\x0d\x82\x34\x85\xcf\xb4\x9a\x71\x91\x6f\x69\x5e\x07\x81\x0b\xc1\xf0\x6c\x85\xa8\x61\x06\xad\x14\x39\x55\xc8\xe4\xf0\x7a\x02\x0c\xac\x27\x46\xa7\xef\xd1\x46\xd3\x07\x9d\xb8\xc8\xbf\xbe\xff\xee\x16\x4a\x21\xa1\x24\x1d\xd3\x33\x47\xad\xc1\xec\x7b\x20\xa5\x14\x8d\x49\x43\x74\xba\xed\xb4\x89\xac\xec\xb8\x3d\xc4\x50\xa2\x00\x20\xd7\x0f\x73\x20\x58\x87\xe4\x8d\xe0\x48\x13\x07\x00\x2d\xd9\x33\x41\x8a\xfe\x04\x8d\xb1\x3c\x77\x76\x3b\x98\x9c\x1e\xbc\xef\x0b\xf5\x08\xbc\x63\x0c\x7e\x41\x64\xc1\x95\x86\x5c\x34\x2d\xa3\x86\x72\xd1\xc3\x26\xe3\xe6\x55\x10\x00\xa4\x29\xdc\x0a\xcf\x32\x06\x49\x75\x27\xb9\xc5\xc2\x4c\x95\x26\xbc\x20\xb2\x80\x2d\xe1\x05\xab\xf8\x26\x00\xa8\x4a\x88\xfe\xe7\xc1\x3f\x3e\x82\xf7\x33\xc9\x31\x1b\xae\x27\x26\x16\xf0\x11\xaf\x02\x80\x43\xe0\x45\x68\x0c\x61\x01\x4f\xbd\xd1\x94\x51\x3d\xb4\x7c\x0e\x4a\xcb\x8a\x6f\x96\x2b\x58\xc0\x72\x65\xa2\xd7\x72\xef\x38\xd2\x14\x9b\xf5\xaf\x7a\x35\xb6\xa9\xf7\x7c\x87\x99\x51\x05\x0d\x91\x75\x21\x76\x1c\x72\x51\x50\x58\x33\x91\xd7\x2a\x86\xb5\x14\x35\xe5\xa6\xc5\x31\x50\x9d\x27\xc6\xcd\x26\xd0\xe2\xc0\x16\xb0\x80\x3b\x3b\x52\x51\x78\x1a\x41\x18\xc3\x50\x0e\xa2\x5c\xb4\x30\x64\x75\x3d\xa6\x75\x65\x8e\x0e\xae\x8f\x26\x3f\x5b\x69\x47\xf2\xf2\x25\xbc\x96\x92\xec\x93\x4a\x99\xaf\xdb\x4f\x7a\xa8\xc9\xe4\x09\xba\xe9\xfb\x91\x51\x52\x56\x4c\x53\x19\x39\x43\x80\xa8\x9e\xc0\xe2\x15\xe8\x7d\x4b\x45\x09\x35\x2c\x16\x0b\x08\x6d\x48\x21\x52\xd6\x89\x96\x55\x13\x4d\x12\x46\xf9\x46\x6f\xe1\x15\x9c\x3b\xdf\x89\x0b\x18\x5b\x0a\x39\xd1\xf9\x16\x22\x3a\x19\xfb\xf1\x55\x79\x74\x23\x48\xc5\x54\x6c\x3a\xa6\x45\x7f\x30\x06\x6a\x2e\x0c\xd6\x2e\x38\x89\xdf\x59\x3a\x05\x51\x5f\x4a\xd1\x7c\xc0\xfb\xd3\x17\x75\x98\x28\xcb\xa8\x74\xc5\x18\x70\x31\x40\x58\xca\x3e\x10\xbe\xb1\x4c\x92\xec\x7a\x36\xac\xf0\x50\x1d\x97\x24\x16\xe1\xbc\x4f\xe5\x3f\x06\xf3\xde\x4e\xbd\x6b\x5e\x0f\x12\x0c\xd7\xc1\x82\x17\x44\x93\xf9\x93\xbe\xcd\xc7\xf0\x6d\x8d\xf1\x73\xb8\x0a\x0e\x83\x9c\xbd\x7d\xb6\x80\x2d\x23\x15\x37\x89\xc1\x6e\xeb\x66\xd6\x44\x60\x12\xc7\x0e\xa0\x6f\x3f\xee\xa5\x90\x0d\xd1\x0a\x58\x55\xd3\x39\x1e\xcc\xe0\x8d\x68\x1a\x32\x53\xb4\x25\x92\x68\x5a\xcc\x21\x74\x04\x17\x71\x4f\x75\x39\xac\x3e\x09\xad\xd3\x4d\xc5\xe9\xb3\x3e\x19\xef\x7d\x86\x55\xef\xf3\x79\xc7\xf0\x72\xb7\xa2\xe2\x5a\xcd\x21\x9c\xc1\xe8\x34\xac\x2f\x9d\xf1\x6d\xd7\xac\xa9\x34\xd0\x17\x89\x67\x78\x99\x1c\x59\x7a\x12\xfb\x4f\x8d\xc2\xd2\xf4\x37\x6e\xe2\x29\xca\x28\x9a\x1f\x93\x1b\xd3\xd5\x46\xfc\x4c\x51\xae\x1a\xc1\xa1\x95\xb4\xac\x1e\xa8\x4a\x55\x57\x9a\x85\xd3\xac\x9c\x51\xc2\x8d\x2e\x0c\x23\x9d\x48\xda\x32\x92\xd3\x28\xfd\x61\x99\xa9\xec\x7e\x35\xbd\x1e\x34\x60\x99\xa9\xf9\x5f\x7f\xfc\xb6\x9a\x66\xcb\xeb\xb4\x8a\x21\x0c\x27\x1e\x57\x38\x84\x14\x3a\xc2\x13\xc0\x6c\xe5\x10\x5f\xa4\xa7\xbe\x5a\x92\x0a\x35\x1b\x56\xd6\xc7\xde\xe5\x3e\x99\x0f\x72\x0f\x0c\x9b\xb7\xde\xcf\xf0\x7b\x2c\x8d\xb6\x1e\xb8\x8f\xa3\xef\x52\x4a\x54\xcb\x2a\x1d\xa5\xcb\x8c\x67\x72\x75\x96\x5a\x2c\x54\xd9\x68\xb4\x07\x51\x5a\x3f\x4f\x0d\x5c\x40\x6b\xbf\xef\x31\x70\xd3\x59\x15\xc3\x4f\x9d\xd0\xa6\x7c\x47\xa2\x0f\x0b\x83\xe3\x6e\xc7\x49\x09\x67\xd9\x34\xfb\xf3\xd7\xdf\xb3\x22\x4b\x56\x67\x4f\x32\xb7\x44\x2a\x75\x0c\xcf\x40\x84\xff\xff\x71\x75\xf6\x68\x3f\x2f\xd2\xcd\x29\x80\x17\x91\xef\x17\x67\xea\x63\x75\xc6\xc1\x20\xbd\x93\x57\x6d\x53\x83\xfb\xba\x6a\x81\x36\xad\xde\x83\xf9\xbf\x45\x00\x13\xe6\x3d\x3d\x52\x21\x4f\x69\x8d\x00\x1f\xef\x7e\x0a\x17\xe7\xe7\xa3\xd2\x23\x2a\x76\x04\xd6\x7b\xcb\x8d\x48\x28\x47\xa4\xe2\x0a\x9a\x8e\xe9\xaa\x65\x7d\x01\x7d\x92\x8a\xe7\xac\x2b\xa8\x8a\xc2\x38\xf4\x5e\x0e\xef\x61\xd3\xd8\xf6\xde\xdc\xb6\x1d\x6d\x93\x86\xb4\x51\xd4\x9a\x57\xa3\x75\x29\xba\xa7\x00\xff\xbc\x51\x40\x0c\x1c\x05\x83\xe5\x53\x0c\xcf\x9a\x3e\xc9\xd5\xdf\x3a\x49\xf4\x58\x20\x93\xb6\x53\x5b\x83\xe0\x51\xdb\xb7\xe8\x78\x75\x00\xca\x14\xf5\x50\x8e\x11\xdc\xaf\x01\xe4\x30\x3e\x69\xee\x8e\x7c\x41\x8b\xae\x65\x55\x4e\x34\x1d\xb5\x7b\x99\x24\x09\xa7\x3b\xb8\xa7\x7a\x78\x3b\x26\x2b\xd4\xe7\xbf\x03\x00\x00\xff\xff\x39\x8d\xcc\xe8\xf1\x0a\x00\x00") +var _yaoAssistantsKeywordSrcIndexTs = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\x56\xdd\x8e\xdb\x44\x14\xbe\xf7\x53\x9c\x5a\xd5\xd6\xde\x75\xc6\x09\xd2\x0a\x70\x70\xa1\xaa\xba\x62\xa1\xdd\x56\xdd\x22\x2e\x92\x54\x4c\xec\x71\x62\xe2\xcc\x84\x99\x09\x49\xd4\x8d\xc4\x6b\x20\x71\x81\xb8\x40\xdc\xf0\x00\xf0\x38\x88\xf2\x1c\x68\xfe\xfc\x93\xb0\x2d\xe5\x82\x9b\x44\x9e\x39\xbf\xdf\xf9\xce\x39\x13\x9f\x9e\x7a\x70\x0a\x9f\x93\xdd\x86\xf1\x1c\x1e\x6d\x25\xc7\x99\x2c\x19\x85\x07\x33\x42\x25\xf4\xe0\x8a\x6c\x25\x7c\xca\xd8\x42\xc9\x3d\xc3\x5c\x10\x01\x8f\x1f\x3f\x01\x4e\xc4\x8a\x51\x41\x00\xd3\x1c\x88\xd1\x13\xb0\x30\x86\x04\x6c\x4a\x39\x87\x0d\x29\x67\x73\xa9\x14\x2f\x18\x5f\x62\x99\xc0\xc8\xb7\x12\x89\xb9\xf3\x23\x40\x08\x4d\xa0\x77\x1f\x46\xaf\x16\x11\x6c\xf6\xe6\xc0\x83\xd3\xd8\xf3\xe2\x18\x3e\x91\xa2\x47\x59\x36\x27\xd9\xc2\xf3\xe2\xd3\x26\xd4\x96\x03\x25\x5b\x52\x49\x78\x81\x33\x52\x0b\xbc\xf2\x00\x16\x09\x08\xc9\x4b\x3a\x1b\x42\x1c\xbb\xe0\x3c\x80\x4d\x02\x74\xbd\x9c\x12\xae\xcf\xad\x95\xa0\x8f\x06\xbd\x01\xea\x87\xde\x5e\xbb\x52\x71\xeb\xec\xe7\x8c\x2d\xa0\x07\x2b\xce\x32\x22\x54\xfe\xd6\x90\x4b\x5b\xc1\xe5\xe0\x68\xa1\x54\x1c\xe6\x3c\x48\xfa\xe8\x43\x3f\x02\xf7\xfd\x5e\xd2\x47\x1f\xf8\xad\x84\x8b\x35\x35\xd6\x94\xdb\xc0\x03\xc8\xe4\x36\x01\xac\x2a\x81\x1e\x32\x2a\xc9\x56\x46\x1e\xc0\x0a\xef\x2a\x86\x73\x77\xa3\x84\x55\x81\x9e\x99\x63\x2f\x3c\xbc\x78\xee\x4a\x75\x03\x74\x5d\x55\x1a\x99\x8c\x51\x21\x21\x63\xcb\x55\x45\xb4\xcb\xd4\x99\x45\xcd\xe1\xd0\xf3\x40\x01\x74\xc5\x5a\x92\x11\x70\x22\xd7\x9c\x1a\x5b\x05\xe3\x20\x24\xa6\x39\xe6\x39\xcc\x31\xcd\xab\x92\xce\x3c\x80\xb2\x80\xe0\x4e\xcb\xfc\xcd\x0d\xb4\x3e\x51\xa6\xb2\xa1\x32\xd4\xb1\x40\xdb\xe2\xd0\x03\xd8\x7b\xad\x08\xb5\x20\xa4\x70\xac\xad\x44\x2b\x22\x6b\xd2\x25\xae\xf6\xa3\x09\xa4\x30\x9a\xe8\xf0\x25\xdf\x59\x27\x71\xec\xf8\x0d\x9f\x5d\x3f\xbd\x02\xcc\x39\xde\x41\xc1\xd9\xb2\x55\x3d\x70\x8e\x57\xaa\x88\x39\xa4\xf0\xcc\x94\x3d\xf0\x15\xfc\xc8\x5a\x50\x06\xfc\x08\xea\x34\xb0\xb0\x44\x1b\x4d\x2c\xca\xda\xb9\xc1\xc1\x9a\x3a\x39\x81\x07\xca\x25\x2a\x85\xfe\xb7\xe7\xa1\x03\x01\x9a\xee\x49\x8d\x7b\x9b\x4e\x47\x7a\xa8\x65\xf7\x0a\x25\xc8\xb0\xcc\xe6\x10\x90\xb0\xc9\xf0\xb2\x68\xb3\xb2\xc0\x65\x25\x22\x8d\x81\x64\xee\xc2\xa4\xac\xb2\xf1\x0e\x9c\x5a\x01\xeb\x56\x5c\x70\xb6\x7c\xa1\x98\xe8\xd2\xac\x6b\x63\x1c\x09\x59\x56\x15\x50\x56\x9b\x30\x9e\x9c\x7f\x3a\xb3\xe0\xe2\x8d\xf3\xa6\xd0\x70\xc2\xa8\x22\x74\x26\xe7\x90\xa6\x29\xf4\x5d\x06\xff\x31\x98\x6b\xc6\x25\x4c\x77\xae\x93\x73\x22\x32\x42\x73\x15\x81\x9a\x4e\x55\xb9\x2c\xa5\x02\xe0\xdc\xeb\x78\xa8\x23\x11\x8c\xcb\x20\xc0\x11\x4c\x43\x48\xef\xc3\x14\x6d\xa0\x07\x18\x6d\x42\x24\xaa\x32\x23\x41\x3f\x82\xf3\xd0\x35\xc3\x73\xc3\x55\x5b\x54\x67\xc3\xab\x49\x6c\x12\xc9\xb1\xc4\xc9\x51\x61\x93\x06\x2a\x53\x46\xf5\xb7\x1f\xb6\x06\x8e\x9e\x1d\xf5\x80\xb1\x14\x7d\xf3\xf0\x54\x6a\x8f\xb6\x58\x75\x87\x50\x42\x0f\x2e\xdd\x9c\xf9\xeb\x87\xdf\x5f\x7f\xff\xcb\xeb\x5f\x7f\xfe\xf3\xb7\x1f\xed\xac\xf1\x73\x42\x56\x50\x11\xcc\x69\x49\x67\x49\x1f\xbd\xef\x1f\xcc\x9e\x63\xe6\x95\x92\x2c\x45\x02\x81\x61\x38\xdc\x00\xa6\xbb\x70\x34\x09\xdb\xfd\xd6\xcc\x94\x37\x76\xa3\x1a\x17\x81\x91\x53\x56\x81\x15\xfa\x5f\xb8\xfa\x2b\x82\xc8\xdd\x8a\xd8\x73\x4d\x0e\xdf\xf8\xf5\x9b\x3e\x39\xe8\xd0\x76\xc4\xd7\x5a\x56\x87\x6c\x5b\xa5\xdd\x83\x8d\x89\xa6\x26\x68\xb5\x16\xf3\x6e\x77\x99\xfe\x52\x1d\x46\x2a\x41\xb4\xbe\x8e\xe6\xe4\x04\x8e\x82\x63\xd3\xaf\x49\x26\x7d\x75\xa7\x0e\xd1\xa2\xf1\x11\xc7\x70\x81\xab\x6a\x8a\xb3\x45\x62\x66\x23\x01\xb3\xe4\x6c\x49\x3b\xe9\x2c\x20\x85\x56\xf4\x68\x11\x22\xc9\xcb\x65\x50\xc7\x64\xc4\x36\x90\xd6\x29\xb4\x82\x41\x1b\x13\x8e\x59\x6b\x3e\x7c\x0c\x4f\xb0\x9c\xa3\x65\x49\x83\x01\xea\x47\xf6\x0b\x6f\xd5\x92\x8b\xac\x46\x18\x42\x02\x7d\x74\xde\xc6\x69\xe1\xda\xf2\x7e\xd3\x94\xc7\x68\xbd\x02\x95\x06\xec\x0f\xf1\x72\x2d\x69\x5b\xc1\x29\x1d\x13\x5c\x94\x74\x56\x35\x3c\x37\x15\x4e\xe0\x90\xe0\xc0\x78\x7d\xe6\xdf\x4e\x53\x0b\x9b\x90\xdc\xed\xfb\x86\x9b\xc7\x4b\x4f\xa1\xba\xd4\xc4\x11\x92\x5b\x8c\x11\x27\xab\x0a\x67\x24\x88\x5f\x8e\xfc\x7b\x93\xb3\x1b\xfd\x7b\x37\x9e\x45\xe0\xfb\xe1\xd0\xf4\xfd\x92\x7d\x4b\xe0\x9b\x35\x93\x44\xb8\x0d\x67\x6d\x85\xdd\x0d\x66\x06\xc5\x0b\x33\x75\xc5\xaa\x2a\xf5\x70\xaa\xb0\xde\x67\x15\xa3\xf5\x10\x84\x25\xde\xe9\x25\x82\x4b\x6a\xae\x44\x58\xc7\xa9\xe4\x1f\xaa\xb3\xcb\x7c\x0b\xa9\x0b\x1b\xa9\xe3\x4b\x9a\x93\xed\xd3\x22\xf0\x13\x5f\x97\x40\xc5\xd2\x11\x6f\x55\xaf\xd3\x95\x2d\x3b\x62\x3d\x35\x58\xa9\xf1\xd6\x56\xee\xf2\xce\xb2\x4e\xd7\xe3\x5a\xf2\x7f\x34\xd0\x71\x7d\x06\x83\xdb\x2d\xb8\x6e\xbd\xa8\x18\x96\x41\x6d\x35\x6c\x6d\x4b\x17\xe9\xc9\x09\xdc\x29\xc5\x15\xbe\xb2\x62\xad\x3d\xd9\x99\xb4\x9a\x9d\xf5\x60\x8d\xea\xb3\x4d\xf2\xc6\x16\x70\x46\x9d\xc2\x7e\xd8\xa5\xb0\x79\xf6\xd8\xa8\x0b\xb6\xa6\x79\xfd\xf0\xd1\x4f\xcf\x9c\x14\x78\x5d\xc9\xfa\x8d\x5b\x07\xa5\x82\xb1\x10\x45\x2a\x88\x3e\x3a\xef\x8e\x78\xf7\x08\xa9\x37\x91\xde\x92\xab\x4a\x71\x40\xed\x49\xd8\xcc\x09\x35\x4f\x14\x85\x95\xde\xa3\x6a\x8f\x77\xf9\x7f\xdb\x7a\x54\x16\x8e\xbb\xe0\xdf\x4f\xe8\x86\xb8\x45\x49\xed\x06\xea\x55\xe5\x82\xb8\xc7\x4e\x6d\x46\x5f\x3d\xd1\x4f\x90\x54\x07\x8e\x96\xea\x23\x88\xc7\xa3\x60\xf4\x72\x3c\x99\x9c\x85\xe3\x49\x5c\xf3\xb3\x11\xef\x32\x53\xcf\x7f\x48\x5b\xe6\x46\x83\x09\xd2\x5d\x13\xf8\x91\x6f\x49\xf4\xb6\xc5\xf1\x3f\x2e\x85\x43\xa6\x8a\xce\xc8\x3c\x1a\x7d\x0d\x9f\x9a\x65\x50\x95\x94\xf4\xa6\x0a\x57\x4a\x5a\xef\xb5\xa6\xf5\x4b\x4a\x84\x43\xd5\x40\x11\x8f\xc6\x74\xcc\xa3\xc9\x99\x41\x54\xbd\x7b\x2d\x05\xbf\x74\x9d\x35\x40\xfd\xc3\x25\xab\x1d\xb0\xc2\x18\x74\x89\x2a\xdd\xac\x22\x98\x6a\xa0\xd4\x95\x4d\xb0\x3d\x05\xc7\x62\xdc\x1b\x9f\x8e\xff\xf8\xee\xa7\x71\x3e\x46\xe3\xd1\x78\xe2\xdf\xfb\x6a\x72\x16\xeb\x81\xd8\x9a\x87\x2b\x4e\x8a\x72\xab\x27\x62\xd7\x84\xd3\xb8\x7b\xa4\x22\xd6\x45\x47\xc5\x0d\x8b\x1a\x58\x1b\x5c\x0b\x57\x35\x0d\x0e\x4e\x3f\x82\x41\xbf\xff\x2e\xe5\xb7\xfa\x6f\x61\x40\x1c\xc3\x17\x82\x38\x43\xb6\xff\x19\x07\x2c\x44\x39\xa3\x90\x93\x8c\x13\xac\x9b\xd2\xc2\x5f\x6b\x36\xf6\xec\x32\xee\xa3\xf3\xb6\x65\x80\xe6\xf6\x60\x18\x75\x2a\x59\x07\xa8\xdf\x91\x9d\x1a\xf7\x94\xd1\x41\x73\xbf\x7f\x57\xe2\xde\xb6\x9d\xff\x0e\x00\x00\xff\xff\x25\x11\xd6\x9c\x08\x10\x00\x00") func yaoAssistantsKeywordSrcIndexTsBytes() ([]byte, error) { return bindataRead( @@ -1795,7 +1800,7 @@ func yaoAssistantsKeywordSrcIndexTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/assistants/keyword/src/index.ts", size: 2801, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/assistants/keyword/src/index.ts", size: 4104, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1815,12 +1820,12 @@ func yaoAssistantsNeedsearchPackageYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/assistants/needsearch/package.yao", size: 207, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/assistants/needsearch/package.yao", size: 207, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _yaoAssistantsNeedsearchPromptsYml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x92\xc1\x6a\xdb\x40\x10\x86\xef\x7e\x8a\x9f\xcd\xa1\x09\xac\x43\x7a\x28\x34\xba\xc5\x89\x8b\x69\xa9\x43\xe3\x42\x0e\xa5\x84\xf5\x6a\x24\x2d\x5e\xef\xba\x3b\xa3\xca\xa2\xc9\xb5\x0f\xd0\x47\xec\x93\x14\xc9\x72\x7b\x88\x2e\xa1\x17\xc1\x30\xcc\x37\x9f\xfe\xd9\x13\x2c\x89\x72\xac\xc8\x24\x5b\xe1\xaa\xa4\x20\x93\x29\x52\xf4\x94\x81\x5b\x16\xda\x4e\x00\x1b\x83\x50\x90\x0c\x8f\x13\x00\xb8\xf6\x86\xd9\x15\x2d\x5c\x81\x9a\x29\xe1\x5b\x4d\xa9\x45\x20\xca\x19\xb4\x17\x4a\xc1\x78\x70\x8f\x3c\x9f\xf4\x23\x27\x27\xb8\xab\x3d\x71\x5f\x2c\x6f\xb1\x9a\x5f\xdd\x5d\x2f\x32\x94\x89\x48\x5c\x28\x59\xc3\x56\x4e\x6c\x65\x44\x63\x6b\xa4\xd2\xb0\x31\x27\x94\x14\x28\x19\x71\x31\x68\x08\xed\x05\xbb\x14\x2d\x31\xbb\x50\xea\xa1\xe9\xb1\x09\xb1\xf1\x94\x97\xd4\xd3\xef\xe7\xb3\x0c\x89\x8c\x9f\x8a\xdb\x12\x72\x23\x06\xa7\x0d\x19\xa9\x28\x69\x04\x6a\x58\x63\x97\x9c\x25\x3e\xd3\xb0\x75\x4a\x14\x04\xf4\x9d\x82\xb0\x46\x22\xdb\x95\x2e\x14\xb1\x87\x7d\x98\x65\xc8\xa3\xad\xb7\x14\x64\xd0\xa8\x62\x33\x95\xd8\xf9\x85\xc2\x95\xf5\xd1\xee\xdd\xd5\xa7\x7e\xe2\x66\x96\x1d\x42\xe9\x16\x6b\xc4\x94\x53\x3a\x80\x63\xca\x59\x63\x5d\xb3\x0b\xc4\xdc\xf7\xff\x85\x43\xbc\x8b\x81\x09\xa7\xef\x57\xb7\x4b\xc4\xe0\xdb\xb3\xbe\xf7\x43\x75\xb1\x3e\x1c\xc2\x54\x19\xd6\x31\x7a\x0d\x75\xa8\x1f\xa4\xdd\x11\xab\x0c\x5f\x54\x43\x6b\xf5\xa8\x36\xdd\x27\x5f\xab\xaf\x1a\xaa\xf7\xcb\x29\x58\x52\x19\x2e\xa6\xaf\x9f\xfe\x2e\x9b\xef\xcd\x76\x77\x3c\x86\x5a\x90\xf7\x51\xe1\xf7\xcf\x5f\xcf\x96\x15\xc6\x33\x8d\x6c\x7b\x8e\x3f\xbf\xbc\x7c\x3a\xe0\x3e\xc7\xdc\xb4\xaf\x18\x43\xe2\xe3\x60\x49\xf5\x18\xb7\xff\x8b\x31\xf8\x9b\x01\x7e\x9f\x9c\x10\x0c\x38\x26\x41\x51\x07\xdb\x65\xff\xff\xee\x17\x03\x7e\x11\x1b\x48\x1c\x2e\x8b\x9b\xd9\xcb\xe4\x37\xa3\xee\x6f\x8f\xee\x1f\xdb\xe1\x31\xbc\x8c\x3a\x7a\xcd\x3e\x91\x3f\x01\x00\x00\xff\xff\x1d\x72\x66\x0e\xbb\x03\x00\x00") +var _yaoAssistantsNeedsearchPromptsYml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x56\x4d\x6f\xdc\xc8\x11\xbd\xeb\x57\x14\x46\xc0\x5a\x0b\x70\x64\x07\x41\x80\x2c\x81\x3d\x68\xad\x6c\x36\x5e\x4b\xda\x58\x32\x16\x81\x61\x18\xc5\x66\xcd\xb0\x31\xcd\x6e\xaa\xaa\x7b\x46\x74\xe2\xab\x8f\x09\x60\xe4\x92\x63\x6e\xb9\xe7\x96\x9f\x13\xc0\xce\xdf\x08\xaa\xf9\xa1\xb1\x23\x05\x70\xb2\x47\x36\xd9\xaf\xaa\xde\xab\x7a\xc5\x43\x38\x27\xaa\xe1\x92\x90\x4d\x03\x27\x6b\xf2\xf1\x60\x09\x1c\x1c\x95\x20\xbd\x44\x6a\x0f\x00\x4c\xf0\x91\x7c\x2c\xe1\x0f\x07\x00\x00\xbf\x0b\x09\x90\x09\x10\x64\xb8\x66\xf3\x6b\x30\x0e\x45\xec\xca\x12\x1f\xc3\x89\x47\xd7\xbf\x26\x48\x42\x0c\xd6\x77\x29\x02\xfa\x7a\xfa\xa4\x87\x5d\x43\xb1\x21\x06\xba\x89\xc4\x1e\xdd\x0c\x25\xe0\x89\x6a\xaa\x8f\x0f\x72\xac\xc3\x43\x0d\xc7\x70\x85\xb2\xc9\x07\x4b\x78\x3c\x61\xc4\x66\xc0\x7f\x20\x70\x9d\x88\x7b\xcd\x23\x4c\x40\x06\x23\xad\x03\x5b\x92\xf1\xda\x45\x8a\x9a\xc5\xd9\xf3\xcb\x2b\xa8\x34\xf9\x27\x97\x17\xe7\xb0\xb3\xb1\x01\xba\x41\x13\x5d\x06\x14\x82\x9f\xc3\xca\x92\xab\xa5\xcc\x99\xbc\x1a\xf0\x8a\x11\xf7\x55\xec\x3b\x92\x42\x29\x59\xd9\x9a\xbc\xa1\x11\xfe\xf4\x02\xce\x2f\xae\xb4\x1e\x46\x13\x61\x43\xfd\x2e\x70\x2d\xc5\xf4\x02\xbd\xec\x88\x73\xce\xd7\x89\x24\xda\xe0\x6f\xdf\xd5\x35\xd0\x4d\xe7\xd0\xa3\x9e\xcb\x5c\xfa\x58\xaa\x35\xf9\x1c\x9e\x25\x47\xf3\xcb\xc3\xfd\xf4\xbe\x5e\xa1\x13\x82\xa3\xf3\xb9\xfe\x81\xc5\x2f\xf3\xc7\xcf\x85\x94\x70\xff\x51\x74\x30\xe8\x33\x11\x39\x31\xaa\x61\xc5\xa1\x85\xa7\x4f\xcf\x1e\x48\x16\x34\xab\xb2\xf1\x61\xe7\xa8\x5e\x53\x39\x96\xf9\x6b\x26\x8a\xd6\xaf\x05\xbe\x00\xd3\xd8\x68\x1a\x8c\x25\x2c\x1a\x72\x2e\x2c\x0a\x58\x34\x61\x97\x7b\xa3\x0f\x69\x51\x80\x41\x49\xe8\x94\xac\x2d\xb1\xe4\x22\x46\x9c\x33\x8c\x8d\x42\xa0\x33\xc9\x0d\x55\x97\x80\x6c\x63\xd3\x52\xb4\xa6\x00\xba\x4e\xc3\x71\x01\xab\xc0\x6d\x72\x38\x09\xf9\x38\xd4\x04\x6b\xf2\xc4\xf9\x83\x12\x76\x6c\x23\x81\x09\x35\x15\x50\x53\x95\xd6\xc5\xc0\xa6\xf5\xe3\x21\x3a\xed\x84\xd8\xb4\x13\xc4\x15\xdd\x44\xe8\x38\x18\x12\xb1\x7e\x5d\x42\x64\xf4\xe2\x30\x52\x01\x92\xda\x16\xd9\xbe\xa6\x02\x98\x32\xf4\x90\x01\xc6\x89\x82\x1c\x7a\x9f\x1b\x68\xac\xc4\xc0\x7d\x01\x62\xac\xf6\x44\xee\x0f\x43\x5d\x14\x38\xf2\x21\x42\xb4\x2d\x2d\x85\xbc\xd8\x68\xb7\xf4\xe5\x54\x08\x13\xea\x33\x44\x94\x8d\x4c\x75\x28\x92\xd5\x16\xeb\x02\xb5\x52\x40\xc5\x68\xbd\x1e\xb6\x60\x6b\x9a\x59\x78\x46\x28\xc1\x5b\xbf\x86\x2f\xc0\x85\xb5\x35\x25\x74\x8d\x75\x41\x42\xd7\xf4\x05\x84\xce\xfa\x81\xbd\xa6\xef\x42\x6c\x94\x54\x74\xb3\xf8\xf7\x74\x51\xe4\x44\xc3\x48\xec\x77\xfb\xd7\x2f\x16\x3b\xaa\x16\x2f\xe1\xe8\x47\xaa\xc6\x37\x9f\x34\x16\x13\xba\xa5\x56\x09\x81\x61\xc5\x74\x9d\xc8\xeb\x44\x99\x06\xfd\x5a\x93\xb4\x7e\xe0\x50\x1b\x6f\x9e\xf1\xa9\xa9\x1e\x27\x66\x35\x10\xda\x92\x8f\x79\xee\x76\xb9\x70\xc2\x8d\xde\x9d\x19\x61\x32\xfa\x59\x83\x5d\x47\x5a\xfa\x2c\xe7\x47\xf4\x42\x8d\x11\x4b\xd8\x11\xaa\xc3\x14\x7a\xdd\x6c\xa0\x63\x6b\x14\x83\x6e\x72\x4e\x04\x8c\x51\x9f\xa5\x0b\x1c\x05\xc4\x04\x9e\xad\xe2\xa9\xa2\xec\x65\x5c\x0e\x99\x81\x98\x86\x6a\x9d\xc1\x0c\xca\x04\x4d\x48\x2c\x05\xe0\x16\xad\xc3\xca\x3a\x1b\xfb\x59\x9e\x9c\x6a\xea\x6a\x0d\x53\x82\xf6\x96\x44\xd0\x31\x18\x64\xf1\xb4\x03\x26\x47\x28\xd9\x4e\x46\x06\x24\x62\x4c\x73\x1a\x61\x98\xfb\x65\x85\x42\xb5\xd2\x82\x5c\xf5\xd0\x39\xcc\x95\xb8\xa0\x8a\x6a\x9a\x85\x3a\x08\x93\xc8\x7d\xee\x70\xaf\xae\x9b\x2c\xeb\xf7\x53\x27\x83\x46\xfa\x44\xda\x6c\xad\x83\x84\xa3\x29\xd4\xc1\xa4\x96\x7c\x1c\xd4\x0c\xac\x93\x54\x27\x35\xbd\x4f\xdd\xe2\x74\xff\xcb\x12\x9a\xb0\x5b\xc6\x00\xeb\x64\x6b\x2d\x20\x26\x15\x16\x9d\xd2\x49\x31\x75\xa0\x7d\xce\xc9\x0c\x0d\x3a\x0d\xbb\x5f\xd9\x75\x9a\x46\x5d\x28\x66\xf7\x29\xa0\x43\xc6\x96\x22\x29\xff\xa1\xcb\x57\xa6\xa9\xa7\x7a\xbc\xfc\xc3\x98\x97\x72\x54\xc2\x8a\x30\x26\x1e\x34\x27\x33\xbb\xaa\xb2\x8f\xdd\xa0\xde\xed\xb6\xf8\x21\x38\x6b\xac\x2a\x17\x89\x75\x0c\x79\xd0\x3d\xe7\xee\xac\x1f\x76\x40\xdb\x39\x8b\xb7\x3b\xe0\xdb\x93\xdf\x96\x7a\xda\x06\x7f\x3b\x69\x80\x55\x48\x31\x5b\xef\xb0\x50\x1f\x8e\x74\x4d\xcd\xcb\x21\x55\x8e\xa4\x09\x21\x66\x2f\x22\xe6\xc0\xd0\x92\x08\xae\x35\x8c\xb2\xaa\x43\x23\x29\xe7\x1e\x5c\xfa\x5f\x26\xb8\xce\x4a\x9f\x62\xc4\xff\xa6\xb1\xae\xd3\xe5\x44\x8f\x4a\x9b\x8d\x11\xb3\x24\xaa\xbc\x4e\xd6\xc4\x10\xb1\xdc\x1e\xc2\xa2\xed\x21\x70\x4d\x2c\xba\x06\xda\x5e\x9b\x62\x65\x1d\x8d\x4f\xa3\x43\x2e\xc6\xcb\x27\xc6\x84\xe4\x27\x65\x2a\x74\x98\x5d\x53\x52\x25\x86\x6d\x37\x6c\xc7\x96\xda\x8a\x58\x1a\xdb\x7d\x3c\x17\xdf\x24\x51\x01\x44\xfd\x40\x77\x6c\x09\xd6\x6f\xc3\x30\xde\x7b\xf9\xe6\x26\xe9\xb5\xfd\xa6\x8b\xcf\xf5\x67\xa4\x63\x5a\x11\xab\x4b\xcb\x7e\x3f\x09\x6e\xa9\x06\x1b\xb3\xe7\xae\x70\xab\x0b\x63\xee\x86\xef\xc7\x6d\x9e\xcb\xcc\x15\x59\xaf\x95\xed\x31\x55\x13\x3f\xfc\xcd\x29\xf8\x94\x73\x9e\x37\xf8\x33\xba\x4e\x56\xb7\xeb\xf8\xfb\xf1\x6d\xf6\x14\x38\xca\x3f\x1f\xc1\xbb\xbe\x00\x1f\xa0\x45\xde\xd4\x61\xe7\x07\x59\x7e\xbf\xd8\x53\x74\xa1\xcb\x29\xd1\xc3\xbc\xe0\x0b\x58\xec\xcb\xba\x28\xe1\xc5\xcb\x02\x16\xb7\x3f\x23\x8b\x12\x1e\x1d\x3f\x5a\xfe\xec\xf8\xd1\x9b\x39\x85\x5f\xdd\x60\xdb\xb9\xb1\x96\xc5\x77\x79\x53\xc3\x3f\xdf\xbe\xfb\x8f\x38\x9f\x11\xe2\xab\xaf\xde\x0c\x70\x57\xa1\xc6\xfe\x81\x4c\x6e\x7b\x37\xb0\x16\x70\x07\xee\xb0\x55\xee\x00\xff\xc5\x08\xfe\x63\x5e\x88\x08\x55\xaa\x2a\x47\x20\x81\xb5\x63\xe0\xc9\xe5\xff\x9f\xff\x14\xe2\x5f\x7f\xfe\xdb\x13\xdc\xe2\x65\xee\xba\xf7\x6f\xff\xf2\xfe\xed\xbb\x0f\x7f\xff\xeb\x87\x3f\xbe\x7b\xff\x8f\x3f\xfd\x74\x51\xbe\x0b\x3b\x88\x61\xf8\x69\x5c\xc3\xe9\x37\x9f\x47\xd3\xe6\x4e\x96\x7e\x39\x81\x9f\xcd\x83\xf7\x59\xa8\xf5\xbd\xdc\xff\x3b\x00\x00\xff\xff\x0e\x73\x5a\x63\x14\x0c\x00\x00") func yaoAssistantsNeedsearchPromptsYmlBytes() ([]byte, error) { return bindataRead( @@ -1835,7 +1840,7 @@ func yaoAssistantsNeedsearchPromptsYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/assistants/needsearch/prompts.yml", size: 955, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/assistants/needsearch/prompts.yml", size: 3092, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1855,7 +1860,7 @@ func yaoAssistantsNeedsearchSrcIndexTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/assistants/needsearch/src/index.ts", size: 2767, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/assistants/needsearch/src/index.ts", size: 2767, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1875,7 +1880,7 @@ func yaoAssistantsPromptPackageYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/assistants/prompt/package.yao", size: 186, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/assistants/prompt/package.yao", size: 186, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1895,12 +1900,12 @@ func yaoAssistantsPromptPromptsYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/assistants/prompt/prompts.yml", size: 621, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/assistants/prompt/prompts.yml", size: 621, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _yaoAssistantsQuerydslPackageYao = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x34\x8d\x4d\x8a\xc3\x30\x0c\x46\xf7\x3e\xc5\x87\xd6\x61\x30\x59\x66\x39\x37\x98\x13\x0c\x4a\x2c\xa8\xc9\x8f\x53\xc9\xa6\x0d\x21\x77\x2f\x76\xe8\xf6\x7b\x4f\x4f\xa7\x03\x68\xe3\x55\x68\x00\xfd\x15\xd1\x03\xbf\x25\x2e\x41\x94\xba\x8a\x82\xd8\xa4\x71\xcf\x31\x6d\xd5\x68\x0c\x81\x33\x8f\x6c\x82\x67\x11\x8d\x62\xb7\x9a\x8f\xbd\x55\x5e\x49\xe7\xef\x79\x31\x31\x1a\x70\x82\x4c\x58\xa7\x47\xe5\x21\x1a\x8f\x8b\x04\xc2\xd5\x9c\xd4\xea\x4d\x73\x00\x40\x2b\xbf\xff\x73\x9a\xa5\x6d\xbd\xf7\xbe\xbb\xf7\x2c\xeb\x2e\xca\xb9\x68\xfd\xe3\x7f\x7a\x07\x5c\xee\x72\x9f\x00\x00\x00\xff\xff\x5a\x74\xb2\x32\xc4\x00\x00\x00") +var _yaoAssistantsQuerydslPackageYao = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x34\x8d\x4d\x8a\xc3\x30\x0c\x46\xf7\x3e\xc5\x87\xd6\x61\x98\xc9\x6a\x9a\x65\x6f\xd0\x13\x14\x25\x16\xd4\xe4\xc7\xa9\x64\xd3\x86\x90\xbb\x17\x3b\x74\xfb\xbd\xa7\xa7\xdd\x01\xb4\xf0\x2c\xd4\x81\x6e\x59\x74\xc3\x35\x87\xc9\x8b\x52\x53\x90\x17\x1b\x34\xac\x29\xc4\xa5\x18\x95\xc1\x73\xe2\x9e\x4d\xf0\xcc\xa2\x41\xec\x54\xd3\xb6\xd6\xca\x2b\xea\xf8\x3d\xcf\x26\x46\x1d\x76\x90\x09\xeb\xf0\x28\xdc\x07\xe3\x7e\x12\x4f\x38\xaa\x13\x6b\xbd\x6a\x0e\x00\x68\xe6\xf7\x3d\xc5\x51\xea\xf6\xff\x77\x69\x9b\x73\x4f\x32\xaf\xa2\x9c\xb2\x96\x3f\xbf\x3f\xad\x03\x0e\x77\xb8\x4f\x00\x00\x00\xff\xff\x87\xb1\xea\xfa\xc4\x00\x00\x00") func yaoAssistantsQuerydslPackageYaoBytes() ([]byte, error) { return bindataRead( @@ -1915,12 +1920,92 @@ func yaoAssistantsQuerydslPackageYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/assistants/querydsl/package.yao", size: 196, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/assistants/querydsl/package.yao", size: 196, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _yaoAssistantsQuerydslPromptsYml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\x53\x5d\x4f\x2b\x37\x10\x7d\xcf\xaf\x38\x35\xaf\x4b\xd4\xf2\xb8\x22\x48\xb4\x55\x51\xab\x0a\x28\x51\x1f\x10\x42\x60\xd6\x93\xc4\xc5\x3b\x76\xed\x71\x42\xc4\xe5\xbf\x5f\xd9\xbb\xf9\xb8\xba\x97\x97\x64\x76\xce\x9c\x33\xe3\xf9\x38\xc1\x3f\x99\xe2\xf6\xf7\xf9\xdf\xb8\x22\xa6\xa8\xc5\x47\x5c\x2e\x89\x05\xb7\xd1\xf7\x41\xd2\xe4\x14\xd1\x3b\x6a\x91\xb6\x49\xa8\x9f\x00\x9d\x67\x21\x96\x16\x5f\x26\x00\x70\xef\x33\x74\x24\xe8\x83\xd4\x72\x27\x35\x2d\x68\x84\xe8\xf4\x0a\x9b\x20\xbe\x90\xd7\x14\x05\xac\x25\x47\xed\xe0\x34\x2f\xb3\x5e\x12\xfe\xcf\x14\x2d\x25\x58\x16\x8f\x7b\xed\x0f\x6a\x0b\x1f\x7b\x2d\xd3\x49\xcd\x76\x72\x54\xf1\x5c\x62\xee\x24\x47\xaa\xc8\xf3\xf3\xf3\x7f\xc9\x73\xb5\xdf\xeb\x2f\xa0\x12\x39\xea\x44\xb5\x78\x50\x0b\x4b\xce\xfc\xa2\x1a\x0c\xd6\x99\x7a\x6c\x76\x51\x8b\xe8\x7b\xd5\x42\x89\x7e\x71\xf4\xc4\xba\x27\xb5\xc7\x36\x2b\x8a\x94\x8a\xc2\xe8\x01\xde\x07\x85\xc2\x18\x62\xa1\x7c\x28\x5f\xb3\x62\xae\xb5\xcb\x54\xd5\x28\x89\xfa\x68\x7e\x44\x4b\xa2\x25\xa7\x03\xd1\xf2\x31\xf3\x41\xe9\x4e\xec\xba\x0a\x07\x62\x63\x79\xa9\x1e\x3f\x46\x9d\x43\xd5\x3e\x1a\x8a\x9f\x56\xd6\x45\xd2\x42\xe6\x49\x4b\x91\x49\x3e\x96\x2e\x28\x43\xa9\x53\xdf\x4b\x39\xdb\xdb\x82\x9f\xfd\x5c\x3d\x1f\xbb\x86\xee\x7b\x3e\xcf\x21\xf8\x28\x64\x70\x13\x86\xd1\xa6\x0a\x9d\xe2\x37\xdf\x07\x1d\x6d\xf2\xdc\x62\xd6\xe0\xa7\x59\x83\x8b\x06\x17\xb3\x06\xe7\x0d\xce\x67\x63\xd4\xad\x16\xa1\xc8\x2d\x9c\x7d\xa5\x06\xec\xa5\x5a\x23\x7a\xa7\x79\x49\x2d\x2c\x0f\x48\xf9\x7f\x21\xd9\x10\xf1\x18\x70\x9d\x9d\x43\xb7\xa2\xee\xb5\x2d\x7b\xc4\xd9\xb9\xa6\x1a\x5e\xea\xc7\xbe\xce\x3b\x4a\xc1\x73\x22\xfc\x51\x97\xa6\xba\x2f\xdd\x46\x6f\x13\x62\x85\x0c\x36\x56\x56\x58\x6b\x67\x0d\xfe\x9a\xdf\x5c\xb7\x9f\x2f\x8f\x49\x4e\xb5\x78\xc7\x74\x3a\xc5\x7e\x8e\x8a\xde\x82\xd3\x96\x4b\x37\x7f\x8d\x96\x16\xa8\x0e\xd6\x62\x3d\xc3\x2f\x20\xab\x61\x99\xb7\x47\x3b\xa4\x23\x5b\x5e\xa6\x61\xb6\xbc\xc5\xce\x01\x1f\xcb\x1b\x28\xa9\xc7\x4f\x1a\x7f\x95\xad\x21\x67\x99\x76\xfd\x1e\xcf\x94\xc6\x27\xec\x8f\xe1\x45\x27\x32\xf0\x5c\xf3\x87\xe8\xd7\xd6\x90\x41\xea\x56\xd4\xeb\x91\xfa\x6f\x22\xe8\x10\xa2\x0f\xd1\x16\x05\xbf\x1b\x65\x39\xb1\x43\xdd\xe5\x04\x89\x65\x24\xfd\xc9\x9d\xcb\x86\xe0\xd9\x6d\x51\xb7\x2b\x41\x56\x5a\x40\x6f\x36\x95\x59\x55\xe2\x37\x79\x2e\x8d\xc1\x8a\x5c\x58\x64\x77\xdc\x9c\x21\x4d\xe7\xfb\xe0\xe8\x6d\x77\xef\x93\xc9\xd7\x00\x00\x00\xff\xff\x44\xaa\x00\x17\x83\x04\x00\x00") +var _yaoAssistantsQuerydslPromptsAggregationYml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x39\x7d\x6b\x1b\xc9\xf9\xff\xfb\x53\x3c\xac\x0f\x62\xc3\x5a\x76\xee\xf7\x83\x82\x38\x1b\x54\xdb\x71\x7c\xc4\x56\x2a\xc9\xa1\x21\x04\x6b\xbc\x7a\x56\x9a\x78\x77\x66\x33\x33\xeb\x58\x4d\x05\x29\xa4\x4d\x5a\x72\xe4\x5a\x12\x28\x47\x43\xb9\x70\xd0\x72\x94\xb4\xa5\x25\xed\x35\xa5\xfd\x32\xf5\x4b\xfe\xea\x57\x28\x33\xb3\xaf\xda\x75\xe2\xa4\x29\x87\xc1\x5a\xcd\x3c\xef\xef\xcf\x6a\x16\xbe\x17\xa3\x18\xaf\x75\xaf\xc0\x06\x32\x14\x44\x71\x01\x0b\xd0\x1a\x0e\x05\x0e\x89\xa2\x9c\x2d\x76\x15\x51\x54\x2a\xea\x49\xe8\x7a\xc8\x88\xa0\x7c\x66\x01\x04\x0f\xb0\x09\x72\x2c\x15\x86\x33\x00\x1e\x67\x0a\x99\x6a\xc2\x0f\x67\x00\x00\xae\xf3\x18\x88\x40\x20\x39\xf9\x61\x4a\xbe\x01\xab\x9c\x1d\xa0\x50\xc0\x88\x8a\x05\x09\x20\x20\x6c\x18\x93\x21\xc2\xed\x18\x05\x45\x09\x94\x29\x0e\xd7\x09\xcf\xb1\x3f\xed\xb6\xb7\xc1\xe7\x22\x24\xaa\x61\x38\xf4\x46\x54\x82\x4c\xe4\x01\x9f\x7b\xb1\x44\x09\x9c\x41\x6b\x63\xa3\xb3\xbe\xd1\xea\x6d\xb6\xb7\x81\xb0\x01\x74\x7b\xad\xde\x66\xb7\xb7\xb9\xda\x4d\xc9\x37\x66\x0c\x85\xd9\xd9\x29\xf2\x5d\x6f\x84\x21\x31\x77\xfd\x7e\xff\x96\xe4\xcc\x3c\xdf\x35\xff\x01\x9c\x8f\xa4\x01\x70\x9a\xe0\x8c\x94\x8a\x9a\x8b\x8b\x1a\x66\xc1\x9e\x36\xb8\x18\x2e\x0e\x04\xf1\xd5\xc2\xd2\x77\x16\xed\xd9\xac\xe3\xa6\xb8\x8a\xaa\x00\x35\x66\xca\x32\xbf\x1a\xa0\xf4\x04\x8d\xb4\xad\x35\xc0\x06\x8f\xad\x5c\xb0\xc6\x43\x42\x19\x74\x23\xf4\xa8\x4f\x3d\xb8\x92\x9a\xc9\xe7\x02\x06\x44\x91\x3d\x22\x33\x9b\x15\x58\x8d\x23\xc3\x89\xef\xdd\x42\x4f\x15\xf9\xf8\x94\x51\xcd\x46\x3a\xcd\x4c\x2b\x00\x07\x0f\x23\x81\x52\x5a\xfe\xf9\x79\x81\x94\x54\x82\xb2\x61\x46\xaa\x4e\xec\x4b\x14\x83\x01\xe4\xa4\x1a\xd0\x1d\x33\x45\x0e\x9b\xe0\xeb\x1b\x17\x14\xd9\x0b\xb0\x91\x7c\x69\x5e\xda\xd9\x5e\x9d\x23\x62\x28\xe7\x5d\x0b\x00\x44\x02\x09\x28\x91\x4e\xc6\x64\x92\xf3\x73\x3c\xce\x06\x54\xbd\x41\xc4\x29\x6d\xeb\x44\xb4\x56\xcd\x29\x95\x60\x23\xc1\x23\x14\x4a\x5b\xb2\xcc\x01\xc0\x31\x02\xea\xe3\x8a\x45\x8a\x32\x1a\x50\x1e\xd5\xc2\xb9\x15\x61\x96\x5d\x58\x71\x61\x65\xd9\x85\x4f\x5c\xf8\x44\x7f\xac\xb8\x10\xd0\x7d\x74\x21\x24\xca\x1b\xb9\x40\x99\x0b\x54\x56\x59\x1c\x90\x20\x46\xcb\x65\x8a\xe6\x2a\x0f\x23\x9d\x75\x16\xa2\x2a\x9b\x28\xcb\xb6\xc7\x79\x80\x84\x59\xe1\x7c\x12\x07\xca\x69\x82\x4f\x02\x89\x15\xd4\xe5\x5a\x7e\xdd\x11\x17\x6a\xa4\x93\x4c\x47\x24\x8f\x96\x2f\x2c\x5f\xa8\xb2\x5d\xd1\xb8\x13\x17\x9c\x95\xe5\xf4\xe9\x93\xec\x21\x3f\x4a\xc0\xca\xb8\xda\x20\xe7\x64\xad\x41\x6b\xb8\x53\x56\x56\x9a\x08\x41\xc6\x35\xfe\xa8\x12\xa4\xac\x8e\x9c\x3c\xcb\xbf\xc8\xe2\xd0\x69\xc2\x0d\x87\xc5\x41\xa0\x0f\x18\x57\x60\x9e\x6f\xc2\xa4\x40\x64\x52\x1b\xdf\x77\x46\x28\x70\x3a\xb6\x49\x10\xb4\x7d\x4d\xb3\x24\xc3\x5d\x70\x3e\x12\xa8\xcf\x9d\xd9\xc5\x42\x52\x2f\xe6\x91\x3d\x2d\xf6\xdd\xe9\xf8\x4e\x18\xca\x33\x6c\x43\x15\x86\xc9\x5d\x3d\x2b\x2b\x2e\x4c\xec\x5f\x81\xd7\xcd\x5a\xed\xb8\x18\xa0\x98\xd6\x8e\x33\xac\xd7\xee\xad\xb9\x73\xc1\x56\x0c\x7d\x7a\xc1\x85\x0b\x69\xfd\xf0\xaa\xfe\xba\x5b\x2d\x10\x55\x53\x64\xe9\xad\xe3\x50\x72\xa1\xec\x71\xe6\x50\x22\xbd\x54\x08\xed\xcb\x73\x69\x3c\x14\x3c\x8e\x3e\xb4\xc6\xb9\xb2\x82\x07\x41\x1c\xc1\xd1\xe7\x0f\x4f\x5f\x7c\xf9\x21\xd4\xb6\x04\xcf\xa8\x71\xe7\xd2\xf8\x16\xa7\xef\x54\x9c\xdf\x58\x70\x05\x0f\x6b\xd3\xbe\xa7\x9b\x08\x28\x0e\x86\x5b\x25\x3b\xf7\x71\x5c\x8b\xf6\x29\xa7\x0c\xf6\x71\x6c\x5b\x4d\x15\xcf\xe7\x02\xe9\x90\xd5\xe2\x5e\xb2\x77\x6f\x42\x0f\xd0\x57\xf5\xa5\xb5\x02\x2a\xe8\x70\x74\x26\x6c\xb1\x4a\x94\x6c\x25\xf0\x76\x4c\x05\x0e\x4c\x38\x1a\xe3\xb8\x56\x59\x37\x97\xbd\xe0\x95\x99\x29\x1a\x67\xd9\xda\x91\x18\x68\xbf\xbc\x67\x11\x28\xcc\x0d\x3a\x42\x0a\xb1\x90\xfb\xef\xad\x91\x6d\x3d\xca\x48\x58\x6e\x58\x1f\xac\x3e\x4d\x57\x21\x59\xeb\xe4\x76\x67\x6d\xbd\x03\xdf\xbd\xee\x54\x93\xb8\x1e\x61\xa3\xd3\xde\xb9\x5a\x41\x18\x91\x03\xca\x86\x67\x49\x3d\x45\xe2\x72\xeb\xda\xe6\xf6\x46\x3e\x8f\x94\x5b\xbd\xc9\xa7\xf7\xd6\x3f\x49\x8f\x12\xc1\x80\x86\x74\xca\xd7\x94\x29\x1c\xa2\xa8\x11\x6e\x8b\x1c\x82\x40\x8f\x8b\xc1\x94\x58\xdc\xf7\x25\x9e\x9b\x4c\x77\x9f\x46\xf5\x74\x22\x32\xc4\xf3\x52\xb9\xaa\x87\x5e\x16\x87\x7b\x28\x60\xee\xe2\x82\x1e\x7b\x07\xf3\x55\x72\x92\xfe\xe0\xdc\x24\x3b\x56\x26\x88\x50\x80\x11\xa5\x1c\xbf\x54\x48\x55\xeb\xf7\x0e\xaa\x58\x30\x30\x00\x89\x62\x73\x72\x3e\xcf\x5d\xfb\x39\x49\x97\x88\x6c\xd3\x48\x17\x2a\x84\x4b\x31\xf3\x8c\x93\xcc\xd5\x02\xf4\x9b\xab\xed\x9d\xed\xde\x9c\xa9\x2d\xf3\x7d\x58\x80\x55\x1e\xb3\x94\x78\x0e\xd5\xdd\xd9\x2a\xc0\x74\xe3\xd0\x8e\x79\x39\x40\xeb\xda\x46\x01\xa0\x75\x80\x82\x0c\x31\xbb\xdd\x6a\x7d\xbf\x70\xbb\x45\x0e\x69\x18\x87\xf9\xed\xe6\x76\xf1\x96\xb2\xd2\xed\x5a\xab\xb7\x5e\xb8\x5e\x3f\x54\x82\x78\x4a\xaf\x20\x08\x3a\xd5\xcd\x93\xa2\x61\xce\xed\xfa\x7a\xab\x93\x62\xb8\x9a\x7e\x7b\xbb\x77\xb9\x86\xc4\x18\x89\x58\x0c\x39\x53\xa3\xcc\x52\x1b\x26\xe9\x92\xed\x21\x21\xd8\x35\xd5\xa3\x09\x7d\xc7\x23\x0a\x87\x5c\x8c\x9d\x3e\x70\x01\x77\xa8\x1a\xa5\xbd\x30\xbf\x2b\x77\x47\xa7\x9f\x10\x69\x9b\x26\xd4\x84\xfe\xdd\xac\xf5\xe5\xe4\x8a\x2d\xd0\xe9\x71\x45\x02\x67\x92\x7b\x6f\x35\xcd\x51\xb8\x64\x56\x50\x73\x9e\x1d\x4a\x88\x25\x82\xae\xb0\x66\x7b\x26\xd2\xae\x93\xfb\x38\x2e\x33\x3b\x3c\x3c\xd4\x7c\xda\x57\xd7\x3b\xad\x5e\xbb\xe3\x34\xe1\x5a\xeb\xca\xce\xfa\x24\x15\xb0\xef\xac\x38\x7d\x28\xe3\x44\x82\x7a\xa8\xb1\xf4\x78\x7c\x71\x69\xa9\x08\xbc\x5c\x81\xf6\x74\xe4\x38\xe9\xa8\x7d\xb1\x08\x5d\x05\x96\x8a\xa8\x58\x6a\xe8\x65\x53\x5c\x3c\x45\x0f\xb0\xa8\xf5\x65\x5b\xcd\x60\xce\xa7\x81\x42\x01\x24\x8d\xe1\x01\x08\x94\x71\xa0\xe4\xbc\x01\xdd\x91\x08\xc4\xd7\x10\x69\x55\xd4\x1d\xba\x8a\x64\xe3\xb5\x99\x8a\x54\x10\xc5\x04\x37\x09\xb5\xf4\xf3\x05\x65\x0b\xf2\x17\x81\x6d\xbe\xd0\xc1\x7c\x59\xd3\x54\xec\xf5\x43\x12\x46\x01\x4a\x7b\xb0\xc9\xa2\x58\x35\xc1\x39\x7e\xf4\xd3\x93\x9f\xbd\x3c\xbe\xf7\xa3\x93\x57\xbf\x3e\x7d\xf1\xe5\xe9\x8b\xe7\x47\x9f\x3d\x3d\x7e\xfa\x87\xd7\x0f\x1e\xdb\x8d\xd3\x6e\xff\xcd\xea\xfa\xef\x98\xe6\xd4\xcc\xfa\x87\xab\xed\x1c\xc4\xa1\xa9\xce\xe9\x28\x97\x43\xd1\x81\x86\x48\x2b\xd0\xe6\x9a\xfe\x16\x90\x3d\x0c\x92\xaf\x59\x9d\xc9\x51\x72\x4f\x54\xdb\x65\x86\x6a\xa5\xaf\x43\xb7\x86\x2b\xa2\x0f\xd0\xa3\x21\x09\x4a\xf8\xaf\x1f\xfc\xfc\xf5\xf3\x67\x8e\x2d\x4d\x37\xf3\x0a\xa5\x3f\xdb\xb1\xd2\x56\x4a\xf4\xcd\xa6\x82\x1b\x05\xc9\x72\xab\xeb\x00\xb7\x81\x76\xd3\xcd\x5a\x7d\xc1\x38\x59\xd7\xcc\xd0\x6f\x4e\xca\xbe\x38\xfa\xfc\xfe\xd1\xc3\x9f\x9c\xfc\xf1\xd5\xeb\x27\xf7\x8e\x9e\xbc\x38\xbe\xf7\xea\xf5\xf3\x67\xff\xfe\xfb\xa3\xa3\xc7\x5f\x1f\xff\xf2\x1f\x27\x5f\xfd\xed\xf4\xe5\x8f\x4f\xff\xf9\x40\x47\xc0\xd2\xc9\x17\xf7\xcf\xeb\x9f\x48\xf0\x41\xec\xa9\xff\x85\x87\x8a\x75\xe2\x0d\x3e\xb2\x5a\xd5\xba\x98\x04\x28\xdf\xea\x22\x63\x8e\x77\xf7\x52\x51\x3a\x93\x4a\x86\x9b\x71\x94\x32\xa5\xac\xe8\xa8\xa2\x95\x0a\xae\xca\x68\x68\xd8\x7c\x8e\xb9\x31\x9d\xa5\x96\x74\x31\x49\x97\x26\x1a\x25\x1b\xae\x6e\x38\x86\x27\xd8\x75\x69\xca\xf3\x5b\xba\xd4\x07\x63\x30\xd0\x49\x14\x7d\xdb\xd9\x77\xbe\xf4\x69\x59\xa8\xba\xd8\x10\xa8\xcb\xdb\x2e\x29\xd3\x48\x5a\x62\x89\xc8\xaa\x05\x85\x96\x7a\x47\x0f\xdb\x86\x9a\x73\x32\xbe\xd5\xcd\xd3\xb8\xdc\x76\xd7\xa9\x5b\xd3\x55\xdf\x3b\x73\x2b\x0c\xeb\x19\x39\x53\xae\xd7\x22\x59\xcf\xbb\xe0\x18\x09\xea\xe3\xe0\xf8\xf7\x8f\xff\xf5\xd7\xaf\x4f\x9e\xfc\xf6\xf8\xe1\x5f\x4e\xbe\xb8\x7f\xf4\xcd\x9f\x8e\x9e\x3d\x38\x7e\xf9\xf0\xf4\xcf\xdf\x1c\xfd\xe2\xd1\xf1\xaf\xee\x1d\x7d\xf5\x9b\xa3\xcf\x9e\x9e\xfc\xee\x89\x2d\xd4\xdf\x7a\x90\xc4\x12\xc5\x6e\x19\xaf\x30\x5c\xe6\x45\xda\x68\xf4\xdf\xc4\xd9\x7b\x95\xe9\x82\x74\x66\x0c\x4c\x5a\xa9\x79\xa7\x7a\x30\xdc\xcd\x39\x9b\x31\xb0\x70\x1b\x92\xc3\xf4\xf6\xad\x21\x91\x32\x49\x7d\x39\x3b\x0b\x1d\x94\x11\x67\x12\x8b\x63\x91\x15\xd2\x8e\x40\x9c\x05\xe3\x06\x6c\x73\x08\x89\xd8\x1f\xf0\x3b\xcc\x05\xc6\x01\x0f\xa3\x80\x30\xf3\xe3\x42\xf6\x2a\x7e\x16\xba\xb1\xe7\xa1\x94\x19\xcd\x8a\x96\x8d\x46\xa3\x28\xa3\x79\x9f\x5c\x16\x51\x43\x4c\x72\x8a\xeb\x42\x70\x31\x4d\x0f\xf5\xa1\xc6\x37\x0f\xbb\x1e\x1f\x18\x22\x21\x4a\x69\x37\x12\xc7\xa2\x15\xe7\xfe\x49\x3a\x85\x84\x54\x4a\xca\x86\xbb\xf6\xf5\x7e\xbf\xa9\x55\xb3\xcf\x10\x09\x7e\x40\x07\x38\x98\x06\xbd\x1d\xa3\x18\x5b\x48\xf3\xb8\x98\xec\xf2\x21\x32\x95\x21\x01\xa4\x68\x94\x1d\x90\x80\x0e\x76\x4d\xd1\xed\x37\xa1\x83\x3e\x0a\x64\x1e\x0e\x92\xd7\xe4\x8c\x2b\xa0\x2c\xe1\x9a\x62\x91\x70\x8f\x0e\x63\x1e\xcb\x8c\x9d\x7d\xd7\x4d\xcd\x8f\x32\x10\x33\x2f\x40\x22\xf2\x11\x3b\xa6\x03\x0c\x28\x4b\x96\x87\x8b\x0d\x68\xb3\x60\x6c\xa6\x58\xc3\x44\xda\xa9\x5e\x8d\x30\x97\x30\x51\x73\x4e\x03\xd9\xdc\x6a\xe8\xc0\xb6\x13\xe0\xc7\x0d\x58\xb3\x6f\x90\xc1\x6c\x99\x7a\xfe\xfb\x78\x09\xa8\x6f\xc4\x95\xf6\x07\x8c\xc4\x36\xff\xd7\x80\x64\x89\x32\x1e\xb0\x81\x42\x7d\xa0\xba\x34\x00\x95\x40\x99\x8c\x7d\x9f\x7a\x14\x99\x8d\xa8\xff\x6f\xc0\xe6\xd6\xd5\x76\xa7\xd7\xda\xee\x35\xe1\x1a\x0a\xea\x8f\x61\xcc\xe3\x04\x57\x9a\x4d\x01\xf6\xd0\xe7\x02\x81\x9b\xf0\x6b\xc0\x3a\x93\xb1\x40\x20\x41\xa0\x07\xf1\x05\x33\x7b\x42\x44\xa8\xb0\xd3\xba\xc7\x03\xce\x60\xae\x39\xef\x02\x36\x86\x0d\x78\xd3\xc8\x0d\xdb\xed\xde\x19\x00\xae\x01\x98\xf9\x4f\x00\x00\x00\xff\xff\xf0\x9a\xca\xd7\x46\x1b\x00\x00") + +func yaoAssistantsQuerydslPromptsAggregationYmlBytes() ([]byte, error) { + return bindataRead( + _yaoAssistantsQuerydslPromptsAggregationYml, + "yao/assistants/querydsl/prompts/aggregation.yml", + ) +} + +func yaoAssistantsQuerydslPromptsAggregationYml() (*asset, error) { + bytes, err := yaoAssistantsQuerydslPromptsAggregationYmlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "yao/assistants/querydsl/prompts/aggregation.yml", size: 6982, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _yaoAssistantsQuerydslPromptsComplexYml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x59\x5b\x6f\xdc\xc6\xf5\x7f\xd7\xa7\x38\xa0\x12\x58\xc2\x9f\x5a\xad\xfc\x8f\xdb\x62\x61\x09\x50\x75\x8b\x02\x5b\xab\xae\x64\x21\x86\x20\x48\x23\xf2\xec\xee\x44\xdc\x19\x7a\x66\x28\x6b\xeb\x2e\x90\xa2\x29\xe2\x06\x0e\x92\x5e\x82\x14\x69\x82\x22\x46\x81\x16\x7d\x70\xf3\x60\x38\x88\x5d\xb4\x5f\xa6\xba\xf8\xa9\x5f\xa1\x98\x19\x5e\x66\x97\xd4\xc5\x81\x03\x01\x5a\x72\x78\xee\xe7\x37\x67\xce\x21\xc7\xe1\x67\x09\x8a\xfe\xe2\xc6\x2d\x58\x41\x86\x82\x28\x2e\x60\x0a\x16\x78\x2f\x8e\xf0\xc8\x3e\x84\x8d\x00\x19\x11\x94\xc3\xc4\x32\x8d\x14\x0a\xf8\x3f\x98\xef\x74\x04\x76\x88\xa2\x9c\x4d\x8e\x4d\x81\xe0\x11\x36\x40\xf6\xa5\xc2\xde\x18\x40\xc0\x99\x42\xa6\x1a\xf0\x8b\x31\x00\x80\xbb\x3c\x01\x22\x10\x48\xa1\xac\x93\x29\xab\xc1\x02\x67\x87\x28\x14\x30\xa2\x12\x41\x22\x88\x08\xeb\x24\xa4\x83\x70\x2f\x41\x41\x51\x02\x65\x8a\xc3\x5d\xc2\x0b\xee\x77\x36\x9a\x6b\xd0\xe6\xa2\x47\x54\xcd\x68\xd8\xec\x52\x09\x32\x33\xb3\xcd\x83\x44\xa2\x04\xce\x60\xa1\x79\x7b\xfd\xd6\xd2\xbb\xb9\xac\x80\xf7\xf6\x29\xa3\xac\x03\x6d\xe3\x8a\xf4\x81\x14\xae\xe8\x3b\x16\x82\xe4\x42\x51\xd6\xa9\x8d\x19\xd9\xe3\xe3\x23\x8a\x37\x82\x2e\xf6\x88\x79\xb6\xb7\xb7\xf7\x9e\xe4\xcc\x5c\x3f\x30\xff\x01\xbc\x37\xa4\x21\xf0\x1a\xe0\x75\x95\x8a\x1b\xd3\xd3\x9a\x66\xca\xae\xd6\xb8\xe8\x4c\x87\x82\xb4\xd5\x54\xfd\xc7\xd3\x76\x6d\xdc\xf3\x33\x5e\x45\x55\x84\x9a\x33\x53\x59\x3c\x0a\x51\x06\x82\xc6\xda\x4e\x4d\xb0\xc2\x93\x34\x3d\x8b\xbc\x47\x28\x83\x8d\x18\x03\xda\xa6\x01\xdc\xca\x02\xd8\xe6\x02\x42\xa2\xc8\x3e\x91\x79\x34\x1d\x55\xfd\xd8\x68\xe2\xfb\xef\x61\xa0\x5c\x3d\x6d\xca\xa8\x09\x87\xd7\xc8\xbd\x02\xf0\xf0\x28\x16\x28\xa5\xd5\x5f\xac\x3b\xa2\xa4\x12\x94\x75\x72\x51\x55\x66\x2f\x53\x8c\x42\x28\x44\xd5\x60\xa3\xcf\x14\x39\x6a\x40\x5b\x3f\xf1\x41\x91\xfd\x08\x6b\xe9\x4d\x63\xf9\xce\xda\xc2\x04\x11\x1d\x39\xe9\x5b\x02\x20\x12\x48\x44\x89\xf4\x72\x25\x83\x42\x9f\x17\x70\x16\x52\x75\x81\x89\x23\xde\x56\x99\x68\xa3\x5a\x48\x1a\xa2\x8d\x05\x8f\x51\x28\x1d\xc9\x61\x0d\x00\x9e\x31\x50\x2f\x97\x22\xe2\xda\x68\x48\x79\x5c\x49\xe7\x97\x8c\x99\xf5\x61\xce\x87\xb9\x59\x1f\x6e\xfa\x70\x53\xff\xcc\xf9\x10\xd1\x03\xf4\xa1\x47\x54\xd0\xf5\x81\x32\x1f\xa8\x2c\xab\x38\x24\x51\x82\x56\xcb\x88\x4c\xbd\xbb\xf5\x7e\xb4\x14\x65\xdb\xc4\xb0\x6d\xfb\x9c\x47\x48\x98\x35\xae\x4d\x92\x48\x79\x0d\x68\x93\x48\x62\x89\x75\xb6\x52\xdf\x46\x97\x0b\xd5\xd5\x3b\x4b\x23\x92\xc7\xb3\xd7\x66\xaf\x95\xd5\xce\x69\xde\x81\x0f\xde\xdc\x6c\x76\x75\x33\xbf\x28\x96\x52\xb2\x61\x5e\x1d\x90\x2b\xaa\xd6\xa4\x15\xda\x29\x1b\x76\x9a\x08\x41\xfa\x15\xf9\x28\x0b\xa4\xac\x4a\x9c\x3c\x2f\xbf\xc8\x92\x9e\xd7\x80\x6d\x8f\x25\x51\xa4\x17\x18\x57\x60\xae\x77\x60\xe0\x08\x19\x54\xe2\xfb\x7e\x17\x05\x8e\x62\x9b\x44\x51\xb3\xad\x65\x0e\xd9\xf0\x00\xbc\x37\x04\xea\x75\x6f\x7c\xda\xd9\xd4\xd3\x05\xb2\x47\xcd\x7e\x30\x8a\xef\x54\xa1\x3c\x27\x36\x54\x61\x2f\x7d\x56\xad\xca\x9a\x0b\x03\xfb\xe7\xe8\xda\xa9\xf4\x8e\x8b\x10\xc5\xa8\x77\x9c\x61\xb5\x77\x97\xee\x9d\x6b\xb6\x62\xe8\xd5\x6b\x3e\x5c\xcb\xea\x47\x50\xce\xd7\x83\x72\x81\x28\x87\x22\xdf\xde\x1a\x87\xfa\x8c\xb0\xcb\x79\x42\x89\x0c\x32\x23\x74\x2e\xaf\xe4\x71\x47\xf0\x24\x7e\xdd\x1e\x17\xce\x0a\x1e\x45\x49\x0c\xc7\x9f\x3e\x3c\x7b\xf2\xf5\xeb\x70\xdb\x0a\x3c\xa7\xc6\x5d\xc9\xe3\xf7\x38\x7d\xa5\xe2\x7c\x61\xc1\x15\xbc\x57\xb9\xed\x37\xf5\x21\x02\x8a\x83\xd1\x56\xda\x9d\x07\xd8\xaf\x64\x7b\x87\x53\x06\x07\xd8\xb7\x47\x4d\x99\xaf\xcd\x05\xd2\x0e\xab\xe4\x5d\xb6\xcf\x2e\x62\x8f\xb0\xad\xaa\x4b\x6b\x89\x54\xd0\x4e\xf7\x5c\x5a\xb7\x4a\x0c\xc5\x4a\xe0\xbd\x84\x0a\x0c\x0d\x1c\x4d\x70\x7c\xeb\xac\x5f\xd8\xee\x64\x65\x6c\x44\xc6\x79\xb1\xf6\x24\x46\x3a\x2f\xdf\xb3\x08\x38\x7d\x83\x46\x88\x83\x85\x22\x7f\x97\x22\xdb\x66\x94\x91\xde\xf0\x81\xf5\xda\xea\xd3\x68\x15\x92\x95\x49\x6e\xb6\x16\x97\x5a\xf0\xd3\xbb\x5e\x79\x13\x57\x33\xac\xb4\x9a\x77\xd6\x4b\x0c\x5d\x72\x48\x59\xe7\x3c\xab\x47\x44\xbc\x3d\xbf\xb5\xba\xb6\x52\xf4\x23\xc3\x47\xbd\xd9\x4f\xdf\xdb\xff\x74\x7b\x0c\x09\x8c\x68\x8f\x8e\xe4\x9a\x32\x85\x1d\x14\x15\xc6\xdd\x26\x47\x20\x30\xe0\x22\x1c\x31\x8b\xb7\xdb\x12\xaf\x2c\x66\xe3\x80\xc6\xd5\x72\x62\xd2\xc1\xab\x4a\x59\xd7\x4d\x2f\x4b\x7a\xfb\x28\x60\x62\x66\x4a\xb7\xbd\xe1\x64\x59\x9c\xa4\x3f\xbf\xb2\xc8\x96\xb5\x09\x62\x14\x60\x4c\x19\xc6\x2f\x15\x52\x55\xe6\xbd\x85\x2a\x11\x0c\x0c\x41\xea\xd8\x84\x9c\x2c\xf6\xae\xfd\x1d\x64\x43\x44\x3e\x69\x2c\x64\x59\x86\x65\x33\xde\x98\xf5\x7c\x51\x42\x22\x11\xf4\x1e\x35\x73\x1a\x91\x76\x20\xd1\x25\xe7\x3e\x55\x5d\xdb\xd0\x35\x60\xef\x41\x5e\xb4\xbd\xa3\xa3\x23\xed\x56\x73\x7d\xa9\x35\xbf\xd9\x6c\x79\x0d\xd8\x9a\xbf\x75\x67\x69\x90\xaa\x6c\xa6\xb2\x24\x4c\x24\x12\x43\x57\xa4\x9c\x6c\x18\x92\x29\xd8\xf3\x66\xbd\x3d\x18\x96\x2b\x15\x51\x89\xd4\xa2\x67\x0d\xe4\x02\x45\x0f\xd1\x1b\xec\xe5\x2c\x73\x25\x96\x58\xd0\x00\x35\x87\x6e\xe1\x66\xea\x75\x97\xb8\xac\x40\x07\x3b\x6b\x06\x67\x7e\xe2\xd0\xde\xac\xb0\x85\x07\x07\x5e\xda\x2f\xce\xb8\x72\x6f\x56\x18\x1e\x70\x61\x24\x9b\x9e\xf2\x47\x2e\xb5\xe9\x22\x47\xe9\x4d\xc9\xf1\xf3\x16\xd3\x7b\x53\xa1\x54\x6f\xba\x9e\x52\x76\x41\x74\xcc\x61\xb7\xed\x11\x7d\xbd\xef\xed\xb8\x6c\xb2\xc4\x16\x62\x84\x0a\xc3\x5d\x62\x0e\x62\xd3\x43\xda\x36\x31\x67\x6b\xb6\x0c\x87\x69\xd1\x95\x48\xd0\x87\xb2\xa5\x26\x21\xda\xca\x82\x6d\x0d\xa5\xc2\xd0\xb0\xe6\x05\x73\x5b\x57\x94\x19\x1f\x86\xa4\xd5\x6a\x35\xbd\x7c\x7d\xb0\x33\x28\x40\x99\x0d\xfb\x08\xcb\x09\x0b\x0c\x10\x33\x2f\x1a\x0b\xcd\x3b\x6b\x9b\x13\xc6\x86\xc9\x3d\x1f\xf6\x1a\x1b\x77\x6e\xbb\xb7\xf3\x5b\x2b\xee\xed\xed\xf9\x77\x87\x6e\x57\xd7\xb2\xdb\x5c\xe2\xe2\xfc\xe6\x92\x4b\x73\x77\x69\xbe\x35\xc4\xd3\x5c\xdb\x7c\x3b\xe7\xca\x6c\x7c\xdb\x96\x54\x98\xb0\x73\x7d\x3e\xd5\x63\x08\x02\x65\x12\x29\x39\x99\x69\x70\x02\x6e\xac\x25\x3d\x9e\x30\x35\xe9\x20\xb3\xee\x38\xbf\x74\x44\x7a\x71\x84\xd2\x2e\xac\xb2\x38\x51\x0d\xf0\x4e\x5f\xfc\xf9\xec\xc9\xd7\xff\x79\xf1\xd1\xf1\x77\x4f\x4f\xfe\xf1\xc9\xc9\x97\x0f\x4f\xbf\xf8\xe0\xe4\xe9\x8b\xb3\x6f\x7f\x75\xf6\xe4\xf1\xf1\xc7\x9f\x9d\x7c\xf6\xcd\xf1\xef\x1e\x9d\xbc\xff\xe2\xe5\x87\xbf\x7d\xf9\xf8\x2b\x3b\xad\xda\x37\x07\x8d\xf2\xab\x03\x9b\xbb\x46\x7e\xf6\xf8\x7a\x92\x8d\x92\x9e\xa9\xec\x59\x1b\x58\x50\xd1\x50\x53\x64\xd5\x6b\x75\xd1\xe0\x93\xec\x63\x94\xde\xe6\x35\xaa\x60\x29\x10\x59\x3e\x6a\x73\xd6\xd3\x8f\x9e\x9d\xbc\xff\xcb\x2a\x76\x1b\x23\x97\x3d\xc4\x80\xf6\x48\x34\xc4\x9f\xfa\x5a\xc1\x1f\x08\x24\x05\xb2\x73\x19\x44\xa1\xa2\xe9\xfe\xca\x84\x1c\x3f\xfc\xd3\xf1\x8b\xe7\x27\x9f\x3f\x7b\xf9\xf9\x53\xcf\x56\xc8\x9d\xa2\x50\x9a\xa2\x95\x28\x9d\x85\x34\x74\x79\x73\xb2\xed\xa5\xd8\x28\x94\x4d\xea\x82\xd6\xe3\x4c\x75\xb5\x8a\x14\xac\x34\x34\xcb\x41\xe6\x91\x0b\x02\xfd\x40\x71\x45\x22\x6f\xc7\xcf\xfb\x13\x27\x2b\xc5\xee\xb9\xbc\x16\xea\xad\x95\xd3\x0c\x07\xc0\x54\x35\xef\x7a\xfd\xfa\x5b\x53\xf5\x99\xa9\xfa\x8c\x37\xd0\xea\xf2\x3e\xa2\xca\x13\x63\x50\xde\x9a\x6c\x7b\xc6\x2b\x3d\xcd\x78\x3b\x83\x61\x6c\x2e\x53\x16\x82\xe2\x31\xdc\x80\x80\x28\xec\x70\xf3\xe6\x6b\xbf\x0f\x92\x44\x28\xc1\xb8\x00\xa6\x18\xc3\x9c\x46\xbb\x0f\x9c\x45\x7d\x90\x5d\x7e\xdf\x65\x30\x27\x8a\x89\x85\x25\xab\xd7\xaf\x0a\xe2\x58\xf0\x30\x09\xd4\x0f\x01\xe3\xac\xc6\x5d\x00\xe2\x35\x4d\x52\x05\x41\xeb\x5a\xff\x12\xf6\x85\x8c\xac\x42\x44\x7e\x82\x5d\xb4\x09\xd6\x0d\x51\xd5\x16\xd4\xe1\x77\xb9\x9d\xb6\x23\xe7\xde\x30\x44\xaf\x06\x7b\xd7\x33\x03\x66\xa3\xa9\xc0\xf2\xae\xd5\xec\x22\xda\x4d\x51\x25\xa6\x4b\x87\xf5\x08\x40\x73\x9d\x7a\xbd\xe8\x67\xb7\x47\x8b\xab\x35\xc5\xad\xad\x56\x94\x83\x64\xc7\x46\xb0\xc3\xb3\x5f\x74\xa1\x37\x46\xc0\x7d\xf2\xe8\x37\xc7\x5f\x7e\x73\xfc\xe8\xb9\xad\xc0\x5b\xab\xeb\xa7\x7f\xf8\xdb\xc9\xc3\x6f\x75\xf9\x7d\xf6\xf0\xec\xe9\x77\xba\xe4\x3e\xfe\xea\xbf\xff\x7c\x74\xfc\xc9\xdf\x4f\xfe\xf8\xaf\xd3\xbf\x3c\xb7\xeb\x67\xcf\x7e\x7d\xf6\xef\x0f\x6f\xd4\xeb\xf5\xd3\x2f\x3e\xb0\x22\xae\x8a\xe7\x44\xfe\x30\x35\xf9\x0a\x60\x3e\xfe\xeb\xef\x8f\x3f\xfd\xb8\x8a\x59\x60\xc7\xbc\x9c\xbc\x98\xdd\xfa\x59\xc1\x4e\xe5\xee\x21\x8d\x5d\x76\xe7\x35\x5f\xce\xbf\xb5\xba\x5e\xc5\x9c\x66\x2c\xc6\xcb\x8f\x04\x37\x29\xaf\x08\xeb\xc2\xc3\xe1\xc2\xad\xd3\xb1\x3b\x5c\xbd\x1d\x83\xce\x29\xe1\x79\x0e\x2b\xd1\x5e\x44\x63\x36\x6d\x85\x46\xf1\x9e\x1a\x73\x09\xda\x5d\x3b\x32\xcc\xdf\x38\x0f\xf2\x29\xd8\x07\x79\xab\xd1\x42\x19\x73\x26\xd1\xed\xfd\x6d\x74\x6c\x53\xae\xcb\x74\x0d\xd6\x38\xf4\x88\x38\x08\xf9\x7d\xe6\x03\xe3\x80\x47\x71\x44\x98\xf9\x7e\x91\x7f\xb1\x18\x87\x8d\x24\x08\x50\xca\x5c\x66\x29\xbc\xb5\x5a\xcd\x8d\x8f\x79\xed\x3e\x1c\x9f\x94\xa2\x08\x42\xba\xe0\xf8\xaf\x57\x06\x85\xd2\x25\x21\xb8\x18\x55\x89\x7a\x51\xab\x30\x17\xbb\x01\x0f\x8d\x9e\x1e\x4a\x69\x67\x3b\xcf\xb2\xb9\x13\xd4\x20\xeb\xd5\x7a\x54\x4a\xca\x3a\xbb\xf6\x43\xc9\x5e\x43\x7b\x6f\xaf\x21\x16\xfc\x90\x86\x18\x8e\x92\xde\x4b\x50\xf4\x2d\xa5\xb9\x9c\x4e\xdf\x8a\xf4\x90\xa9\x9c\x09\x20\x63\xa3\xec\x90\x44\x34\xdc\x35\x89\xdc\x6b\x40\x0b\xdb\x28\x90\x05\x18\xa6\x1f\x1c\x18\x57\x40\x59\xaa\x35\xe3\x22\xbd\x7d\xda\x49\x78\x22\x73\x75\xf6\xab\x01\x35\x1f\xbe\x20\x61\x41\x84\x44\xe4\x99\x5d\x49\x68\x88\x11\x65\x68\x1b\xe7\x99\x1a\x34\xf5\x91\xab\xa7\x39\xa3\x44\x82\xce\x03\xa8\x2e\x16\x16\xa6\x6e\xea\xb9\x0c\x6c\xe1\xa9\xe9\xfd\x67\xdb\xd8\xeb\x35\x58\xb4\xef\xe2\xc1\x54\x4a\x50\x1c\xae\xd7\x81\xb6\x8d\xb9\xd2\x7e\x0a\x4a\x63\xf3\xff\x35\x48\xc7\x51\x93\x01\x8b\x25\xda\x06\xaa\x4b\x2a\x50\x09\x94\xc9\xa4\xdd\xa6\x01\x45\x66\x41\xf7\x56\x0d\x56\x6f\xaf\x37\x5b\x9b\xf3\x6b\x9b\x0d\xd8\x42\x41\xdb\x7d\xe8\xf3\x24\xe5\x95\xe6\x8b\x0d\xec\x63\x9b\x0b\x04\x6e\x10\x5a\x83\x25\x26\x13\x81\x40\xa2\x48\x4f\x8f\x53\x66\x16\x85\x98\x50\x61\xa7\xd6\x80\x47\x9c\xc1\x44\x63\xd2\x07\xac\x75\x6a\x70\xd1\x59\x03\x6b\xcd\xcd\x73\x08\x7c\x43\x30\xf6\xbf\x00\x00\x00\xff\xff\xba\x58\xb0\x79\xb8\x1c\x00\x00") + +func yaoAssistantsQuerydslPromptsComplexYmlBytes() ([]byte, error) { + return bindataRead( + _yaoAssistantsQuerydslPromptsComplexYml, + "yao/assistants/querydsl/prompts/complex.yml", + ) +} + +func yaoAssistantsQuerydslPromptsComplexYml() (*asset, error) { + bytes, err := yaoAssistantsQuerydslPromptsComplexYmlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "yao/assistants/querydsl/prompts/complex.yml", size: 7352, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _yaoAssistantsQuerydslPromptsFilterYml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xd4\x59\x6d\x6b\x1c\xc9\x11\xfe\xae\x5f\x51\x8c\xce\x58\x82\xd1\x68\xe5\xe4\x92\x30\x78\x05\xb2\x25\xf9\x74\xf8\xb4\xca\x4a\xb6\x31\x46\x78\x5b\x33\x35\xbb\x6d\xcd\x74\x8f\xbb\x7b\x64\x6d\x9c\x85\x1c\x98\x8b\x09\x18\x9c\x5c\x2e\x1f\x0c\x21\x89\x21\x5c\x3e\x5d\xf2\x29\x17\x92\xfc\x9a\x70\xb2\x7c\xff\x22\x74\xf7\xbc\xed\xce\xe8\xe5\x1c\x93\x10\x0e\xce\xb3\x3d\x55\x4f\xbd\x3c\xdd\xd5\x55\xa3\x79\xf8\x71\x86\x62\xbc\xbe\x7b\x1b\x6e\x21\x43\x41\x14\x17\xb0\x04\x9b\x34\x56\x28\x96\xef\x8d\x50\x20\xdc\xe4\x2c\xa4\x8a\x72\x26\x61\x37\x40\x46\x04\xe5\x73\x4b\x20\x78\x8c\x3e\xc8\xb1\x54\x98\xcc\x01\x04\x9c\x29\x64\xca\x87\x9f\xce\x01\x00\xdc\xe7\x19\x10\x81\x40\x2a\xfc\x61\x81\xef\x69\xc4\x23\x14\x0a\x18\x51\x99\x20\x31\xc4\x84\x0d\x33\x32\x44\x78\x9c\xa1\xa0\x28\x81\x32\xc5\xe1\x3e\xe1\x95\xf6\xc7\xbb\xbd\x6d\x88\xb8\x48\x88\xf2\x8c\x85\xbd\x11\x95\x20\x73\x7f\x20\xe2\x41\x26\x51\x02\x67\xb0\xb9\x75\x7b\x6f\xa3\x0f\x84\x85\x70\xef\xa3\x8d\xfe\x86\x76\xcd\xfa\x5f\xc0\x7b\x73\x06\x61\x7e\x7e\x06\x7e\x37\x18\x61\x42\xcc\xbb\xc1\x60\xf0\x48\x72\x66\x9e\x9f\x9a\xff\x03\x38\x1f\x48\x23\xe0\xf8\xe0\x8c\x94\x4a\xfd\xe5\x65\x2d\xb3\x64\x57\x3d\x2e\x86\xcb\xa1\x20\x91\x5a\xea\xfc\x70\xd9\xae\xcd\x3b\x6e\xa1\xab\xa8\x8a\x51\x6b\x16\x26\xab\x57\x21\xca\x40\xd0\x54\x7b\xa8\x05\x6e\xf1\xcc\xfa\x05\xeb\x3c\x21\x94\xc1\x6e\x8a\x01\x8d\x68\x00\xb7\x8b\x34\x45\x5c\x40\x48\x14\x39\x20\xb2\xcc\x59\xcd\xd4\x38\x35\x96\xf8\xc1\x23\x0c\x54\xdd\x4e\x44\x99\x25\xd2\xf1\xcb\xa8\x00\x1c\x3c\x4e\x05\x4a\x69\xed\x57\xeb\x35\x28\xa9\x04\x65\xc3\x12\xaa\xcd\xed\x4d\x8a\x71\x08\x15\x94\x07\xbb\x63\xa6\xc8\xb1\x0f\x91\x7e\xe3\x82\x22\x07\x31\x7a\xf9\x0f\x7f\xf3\xce\xf6\xcd\x05\x22\x86\x72\xd1\xb5\x02\x40\x24\x90\x98\x12\xe9\x94\x46\x26\x95\x3d\xa7\x24\xf1\x2c\x17\x67\xa2\x6d\x73\xd1\x66\xb5\x42\x9a\x92\x4d\x05\x4f\x51\x28\x9d\xc9\x69\x0b\x00\x8e\x71\x50\x2f\x37\x32\x52\xf7\xd1\x88\xf2\xb4\x55\xce\x6d\x38\xd3\x75\x61\xd5\x85\xd5\xae\x0b\xd7\x5d\xb8\xae\xff\x59\x75\x21\xa6\x87\xe8\x42\x42\x54\x30\x72\x81\x32\x17\xa8\x6c\x9a\x38\x22\x71\x86\xd6\xca\x0c\xe6\x4d\x9e\xa4\xfa\xd4\x59\x89\xa6\x6f\x62\xda\xb7\x03\xce\x63\x24\xcc\x3a\x17\x91\x2c\x56\x8e\x0f\x11\x89\x25\x36\x54\xbb\xad\xf6\x76\x47\x5c\xa8\x91\x3e\x69\x7a\x47\xf2\xb4\x7b\xb5\x7b\xb5\x69\x76\x55\xeb\x4e\x5c\x70\x56\xbb\xc5\xd3\xf5\xf2\xa1\x5a\xca\xc5\xa6\x75\x75\x42\x2e\x69\x5a\x8b\xb6\x58\xa7\x6c\x3a\x68\x22\x04\x19\xb7\xf0\xd1\x04\xa4\xac\x0d\x4e\x9e\xc5\x2f\xb2\x2c\x71\x7c\x78\xe0\xb0\x2c\x8e\xf5\x02\xe3\x0a\xcc\xf3\x3e\x4c\x6a\x20\x93\xd6\xfd\xfd\x44\x97\xda\xd9\xbd\x4d\xe2\xb8\x17\x69\xcc\x29\x1f\x9e\x82\xf3\x81\x40\xbd\xee\xcc\x2f\xd7\x0e\xf5\x72\xb5\xb3\x67\xdd\x7e\x3a\xbb\xbf\x73\x83\xf2\x8c\xdc\x50\x85\x49\xfe\xae\xdd\x94\x75\x17\x26\xf6\xbf\x9a\xad\xfd\xd6\xe8\xb8\x08\x51\xcc\x46\xc7\x19\xb6\x47\x77\xe1\xd9\xb9\x6a\x2b\x86\x5e\xbd\xea\xc2\xd5\xa2\x7e\x04\x4d\xbe\x9e\x36\x0b\x44\x33\x15\xe5\xf1\xd6\xfb\x50\x72\xa1\xec\x72\x49\x28\x91\x41\xe1\x84\xe6\xf2\x52\x11\x0f\x05\xcf\xd2\xf7\x1d\x71\x15\xac\xe0\x71\x9c\xa5\x70\xf2\xf2\xf9\xdb\xaf\xfe\xf0\x3e\xc2\xb6\x80\x67\xd4\xb8\x4b\x45\xfc\x88\xd3\xef\x54\x9c\xcf\x2d\xb8\x82\x27\xad\xc7\x7e\x4f\x5f\x22\xa0\x38\x18\x6b\x8d\xd3\x79\x88\xe3\x56\xb5\x8f\x39\x65\x70\x88\x63\x7b\xd5\x34\xf5\x22\x2e\x90\x0e\x59\xab\xee\xa6\x7d\x77\x9e\x7a\x8c\x91\x6a\x2f\xad\x0d\x51\x41\x87\xa3\x33\x65\xeb\x55\x62\x2a\x57\x02\x1f\x67\x54\x60\x68\xb6\xa3\x49\x8e\x6b\x83\x75\x2b\xdf\x6b\xac\xcc\xcd\x60\x9c\x95\x6b\x47\x62\xac\x79\x79\xc7\x22\x50\xeb\x1b\xf4\x0e\xa9\xed\x85\x8a\xbf\x0b\x77\xb6\x65\x94\x91\x64\xfa\xc2\x7a\x6f\xf5\x69\xb6\x0a\xc9\x56\x92\x7b\xfd\xf5\x8d\x3e\xdc\xb8\xef\x34\x0f\x71\xbb\xc2\xad\x7e\xef\xce\x4e\x43\x61\x44\x8e\x28\x1b\x9e\xe5\xf5\x0c\xc4\x47\x6b\x77\xb7\xb6\x6f\x55\xfd\xc8\xf4\x55\x6f\xce\xd3\x3b\xc7\x9f\x1f\x8f\x29\xc0\x98\x26\x74\x86\x6b\xca\x14\x0e\x51\xb4\x38\xf7\x09\x39\x06\x81\x01\x17\xe1\x8c\x5b\x3c\x8a\x24\x5e\x1a\x66\xf7\x90\xa6\xed\x38\x29\x19\xe2\x65\x51\x76\x74\xd3\xcb\xb2\xe4\x00\x05\x2c\xac\x2c\xe9\xb6\x37\x5c\x6c\xc2\x49\xfa\x93\x4b\x43\xf6\xad\x4f\x90\xa2\x00\xe3\xca\xf4\xfe\xa5\x42\xaa\x56\xde\xfb\xa8\x32\xc1\xc0\x08\xe4\x81\x2d\xc8\xc5\xea\xec\xda\x7f\x27\xc5\x10\x51\x4e\x1a\xe5\x10\x05\x9b\x66\x88\x31\xeb\xb5\xc9\x2a\x93\x08\xfa\x8c\x9a\x01\x8c\x48\x3b\x90\xe8\x92\xf3\x84\xaa\x91\x6d\xe8\x7c\x18\x3c\x2d\x8b\xb6\x73\x7c\x7c\xac\xc3\xea\xed\x6c\xf4\xd7\xf6\x7a\x7d\xc7\x87\xbb\x6b\xb7\xef\x6c\x4c\x72\x93\xbd\x1c\x4b\xc2\x42\x26\x31\xac\x43\xca\x45\xdf\x88\x2c\xc1\xc0\xe9\x3a\x03\x98\xc6\x95\x8a\xa8\x4c\x6a\xe8\xae\xd9\x72\x81\xa2\x47\xe8\x4c\x06\xa5\xca\x6a\x43\x25\x15\x34\x40\xad\xa1\x5b\xb8\x95\x4e\xa7\x2e\xdc\x34\xa0\x93\x5d\x34\x83\x2b\x3f\xaa\xc9\x5e\x6f\xf1\x85\x07\x87\x4e\xde\x2f\xae\xd4\x71\xaf\xb7\x38\x1e\x70\x61\x90\x4d\x4f\xf9\x83\x29\xe9\xa6\xcf\x66\x87\x14\x6d\xa7\x13\x62\x8c\x0a\xc3\x7a\x98\xa6\xf3\x9c\xd5\x32\x65\xca\x2d\xdb\x52\xe7\x8a\x42\xa9\xae\xd4\xd5\x28\x3b\x27\xa3\xe6\x82\x7c\xe0\x10\xfd\x7c\xe0\xec\xd7\xd5\x64\x43\x2d\xf7\xe9\x21\x31\x97\xb7\xe9\x3b\x6d\x6b\x39\xa9\x76\xd5\xbd\x11\x32\x7d\x1b\xea\xdd\xd3\x85\x23\x69\x06\x88\x1c\xf4\x8e\x44\x18\x74\x07\xba\x9d\xf5\x61\x6b\xdd\x05\xeb\x87\x0b\x3a\x74\x17\xf2\x5b\xc7\x05\xdd\xe6\xb8\x80\xc7\x24\x50\x76\x9f\xc9\x3a\x80\x06\xcc\x31\x74\xf0\x20\x91\x08\x3d\x9c\x98\x79\xb6\xfc\x95\x4f\xff\xf9\xef\xfc\x28\x2c\xc1\xe0\xca\x21\x8e\x9f\x70\x11\x5e\xd1\xc1\x69\x21\x42\x99\xac\x5e\xd7\xdf\x4a\x45\x84\x92\x66\xbb\x37\xf5\xb5\x00\xb2\x30\x7f\x5d\x44\xdf\xb3\x53\xfe\x36\x4a\x85\x61\xed\x30\xe5\xfe\xf7\xfa\x26\xa1\x66\xea\x51\x22\x43\x17\x9a\x44\x9a\x3d\xae\x49\xac\x38\xcc\xe1\x16\x4c\xf1\xa7\x6c\xb8\x68\x50\xca\xeb\xe8\x81\xae\xd7\x2b\x2e\x4c\x01\x7b\x9e\xa7\x97\xaf\x4d\x2a\x4e\x37\x8e\x49\x92\xc6\xe8\xc3\xc2\x1a\xac\x6d\xaf\xc3\x8d\x45\xed\xef\x4d\xf8\xd7\x67\xbf\x82\xc1\x83\x3a\xe0\x9a\x0b\x37\xf6\x27\x4d\xc4\x9b\x93\xfd\x8a\xe9\x1c\x4e\xda\x85\x2d\x96\x66\xca\x07\xe7\xcd\xef\xfe\xf8\xf6\xcf\xaf\x4f\x7f\xf1\xd7\x37\x3f\xfb\xf4\x9b\xbf\xfd\xdd\x1e\xd6\xd3\x57\xcf\x4e\x7f\xfd\xa7\x37\xcf\xbf\xb6\x93\xb4\xfd\xaa\xe1\x37\x3f\x6b\xd8\x24\xf8\xe0\x64\x52\x5f\x8b\xae\x1e\xb2\xe3\x2c\x31\x97\x4e\xd1\xa1\x56\x42\x34\xd4\x12\x45\x61\xdd\x5a\x37\xc7\x80\x1c\x60\x9c\xff\x2c\xcb\x67\xa5\x52\x24\xb9\xd9\x03\x94\x8a\x27\x5f\x7e\x7e\xf2\xf2\x45\x9b\x72\x75\x6a\xce\x51\xb7\x91\x3b\xb6\xdc\xee\x57\x55\xd7\x54\xc0\x4c\xe9\x24\xe5\xb1\x96\x9d\xce\x83\x3c\x92\xc2\xb9\xdc\xce\xbe\x5b\x76\x2d\x55\x3e\x2a\x8e\x2e\x2e\x90\xfb\x6e\x75\xc3\x5e\xeb\x4c\xa6\x79\xda\x35\xe7\x02\x52\xc1\xc3\x2c\x50\xb2\x38\x0a\x94\x0d\x81\xee\x8c\x38\xc3\xcb\x52\x55\x20\xfc\x6f\xd8\xda\xd6\x22\x2d\xaa\xe5\x05\x50\xe8\x86\x18\xd0\x84\xc4\x53\xca\x3b\x46\xe8\x3f\xa1\xca\x9a\xa9\x33\x55\x4f\x47\x2b\x59\x8d\x82\x6d\xd3\x7d\xe5\x02\xbe\xbe\xf9\xc7\xd7\x6f\x7e\xff\xcf\x95\x4e\x67\xe9\xc3\x4e\xe7\xf4\xd5\xb3\x93\x2f\x3e\x3b\xf9\xfc\xd3\xff\x0f\x92\x4e\x5e\xbe\x38\xfd\xf2\x2f\xef\x4c\x93\x0d\xfd\xbf\xcd\x53\xd5\x42\x74\xf3\x1e\x42\xd7\xc3\xe6\x6b\x73\xb7\x7f\xd8\xe9\x9c\x4f\x5f\x59\x10\x53\x64\x21\x65\xc3\x37\xcf\x7f\x93\x0a\x1e\xe8\x59\x85\x0d\x4f\x5f\x3d\x7b\xfb\xd5\xeb\x93\x17\x5f\x5c\x96\xce\x7c\x6c\x78\xff\x64\x7e\xa7\x12\xd7\x54\x27\x09\xcf\x98\xba\x88\xcf\x6f\x7f\xfe\xcb\x6f\x5f\xff\xf6\x9d\xf8\xac\xfc\xcb\x4d\xd5\x29\xad\xb2\x72\x41\x95\xcc\x9b\x9e\x9c\x8a\xfc\x43\x44\xce\x85\xb3\xdf\x4e\xe4\xfc\x3c\xf4\x51\xa6\x9c\x49\xac\xf7\xcb\xd6\x5f\xdb\xc8\x72\x16\x8f\x3d\xd8\xe6\x90\x10\x71\x18\xf2\x27\xcc\x05\xc6\x01\x8f\xd3\x98\x30\xa2\xdb\x80\xf2\x2b\xff\x3c\xec\x66\x81\x36\x58\x62\x36\x02\xf6\x3c\xaf\x1e\x9b\xf9\x54\x3d\x1d\x5a\x2e\xd1\xe2\xe9\x3c\x6c\x08\xc1\xc5\x2c\x38\xea\x45\x0d\x66\x1e\x1e\x06\x3c\x34\x88\x09\x4a\x69\x27\x1f\xc7\xaa\xd5\xe7\x8b\x49\xd1\x0f\x26\xd4\xa4\xe7\xa1\xfd\x33\xc2\xc0\xd7\x71\xda\x67\x7d\x87\x1c\xd1\x10\xc3\x59\xd1\xc7\x19\x8a\xb1\x95\x34\x8f\xcb\xf9\x37\x83\x44\xf7\x65\x85\x12\x40\xa1\x46\xd9\x11\x89\x69\xf8\xd0\x10\x36\xf0\xa1\x8f\x11\x0a\x64\x01\x86\xf9\xe7\x78\xc6\x15\x50\x96\x5b\x2d\xb4\x48\x72\x40\x87\x19\xcf\x64\x69\xce\x7e\x53\xa7\xb6\xfd\xcb\x58\x10\x23\x11\x25\x87\xb7\x32\x1a\x62\x4c\x59\xde\x52\xae\x78\xd0\x63\xf1\xd8\x74\xab\xc6\x88\x04\x9d\x71\x50\x23\xac\x3c\xcc\xc3\xd4\x53\x0b\xd8\xf3\xe6\xe9\x0d\xbf\x68\x10\xae\x79\xb0\x6e\xbf\x54\x83\x61\x42\xf7\xbe\xd7\x3a\x40\x23\xe3\xae\xb4\x7f\x28\xc9\x73\xf3\x3d\x0f\xf2\x61\xcd\x30\x60\x77\x0d\x8d\x80\xea\x22\x01\x54\x02\x65\x32\x8b\x22\x1a\x50\x64\x76\x7b\x7d\xdf\x83\xad\x4f\x76\x7a\xfd\xbd\xb5\xed\x3d\x1f\xee\xa2\xa0\xd1\x18\xc6\x3c\xcb\x75\xa5\xf9\x7b\x06\x1c\x60\xc4\x05\x02\x37\x7b\xd1\x83\x0d\x26\x33\x81\x40\xe2\x58\xcf\x56\x4b\xa6\x83\x86\x94\x50\x61\x67\xba\x80\xc7\x9c\xc1\x82\xbf\xe8\x02\x7a\x43\xaf\xb5\xa8\x15\x63\x13\x6c\xf7\xf6\xce\x10\x70\x8d\xc0\xdc\xbf\x03\x00\x00\xff\xff\x04\x32\xac\x91\xaf\x1b\x00\x00") + +func yaoAssistantsQuerydslPromptsFilterYmlBytes() ([]byte, error) { + return bindataRead( + _yaoAssistantsQuerydslPromptsFilterYml, + "yao/assistants/querydsl/prompts/filter.yml", + ) +} + +func yaoAssistantsQuerydslPromptsFilterYml() (*asset, error) { + bytes, err := yaoAssistantsQuerydslPromptsFilterYmlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "yao/assistants/querydsl/prompts/filter.yml", size: 7087, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _yaoAssistantsQuerydslPromptsJoinYml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x19\xdb\x6a\x1c\xc9\xf5\x5d\x5f\x71\x68\x2d\x58\x82\xd6\xc8\xbb\x1b\x08\x34\x96\x40\x2b\xcb\xda\x31\xb2\x46\x19\x49\x06\x63\x84\xa6\xd4\x7d\x7a\xa6\xac\xea\xaa\x76\x55\xb5\xa4\x89\x32\x90\x84\x40\x96\xc0\xb2\x1b\x92\xbc\x04\x42\x58\x43\x48\xc8\x83\x4d\x9e\x12\xc8\x43\x7e\x66\x7d\xfb\x8b\x50\x55\x7d\x9d\x6e\xd9\xb2\xf1\xb2\x49\x08\x02\x4d\x77\xf5\xb9\xdf\xea\x9c\xaa\x45\xf8\x51\x86\x72\x7a\x7b\x7f\x07\xb6\x91\xa3\x24\x5a\x48\x58\x81\x7b\x19\xd3\x74\x45\x93\x13\x86\x70\x57\x50\x0e\xfb\x21\x72\x22\xa9\x58\x58\x01\x29\x18\x06\xa0\xa6\x4a\x63\xb2\x00\x10\x0a\xae\x91\xeb\x00\x7e\xb2\x00\x00\xf0\x40\x64\x40\x24\x02\xa9\x08\x8f\x0b\xc2\x3d\xd8\x14\xfc\x0c\xa5\x06\x4e\x74\x26\x09\x03\x46\xf8\x38\x23\x63\x84\xc7\x19\x4a\x8a\x0a\x28\xd7\x02\x1e\x10\x51\x61\xdf\xdd\x1f\xec\x42\x2c\x64\x42\x74\xcf\x72\x38\x98\x50\x05\x2a\x97\x07\x62\x11\x66\x0a\x15\x08\x0e\xf7\x0e\x77\x0e\xfa\x2b\x07\x1b\x9f\xed\x6c\xc1\xdd\x41\x7f\xb7\x20\xda\x5b\xb0\x78\x8b\x8b\x73\x44\xf7\xc3\x09\x26\xc4\x7e\x1b\x8d\x46\x8f\x94\xe0\xf6\xf9\xd2\xfe\x07\xf0\x3e\x52\x16\xc0\x0b\xc0\x9b\x68\x9d\x06\xab\xab\x06\x66\xc5\xad\xf6\x84\x1c\xaf\x46\x92\xc4\x7a\xe5\xe6\x0f\x57\xdd\xda\xa2\xe7\x17\xb8\x9a\x6a\x86\x06\xb3\x60\x59\x7d\x8a\x50\x85\x92\xa6\x9a\x0a\x6e\x00\xb6\x45\xe6\xe4\x82\xdb\x22\x21\xc6\xd4\x29\x86\x34\xa6\x21\xec\x14\xc6\x89\x85\x84\x88\x68\x72\x42\x54\x69\xa9\x1a\xab\x69\x6a\x39\x89\x93\x47\x18\xea\x3a\x9f\x98\x72\x6a\xd8\x28\x2f\x28\xb5\x02\xf0\xf0\x22\x95\xa8\x94\xe3\x5f\xad\xd7\x48\x29\x2d\x29\x1f\x97\xa4\xba\xc4\xbe\x43\x91\x45\x50\x91\xea\xc1\xfe\x94\x6b\x72\x11\x40\x6c\xbe\xf8\x60\x83\xa7\x97\xbf\x04\x77\x0e\x77\x37\x97\x88\x1c\xab\x65\xdf\x01\x00\x51\x40\x18\x25\xca\x2b\x99\xcc\x2a\x7e\x5e\x28\x78\x44\xf5\x1b\x44\x9c\xd3\xb6\x4b\x44\x67\xd5\x8a\x52\x03\x36\x95\x22\x45\xa9\x8d\x25\x9b\x1c\x00\x3c\x2b\xa0\x59\x6e\x59\xa4\x2e\xa3\x05\x15\x69\x27\x9c\xdf\x12\x66\xcd\x87\x75\x1f\xd6\xd7\x7c\xb8\xe5\xc3\x2d\xf3\xb3\xee\x03\xa3\xa7\xe8\x43\x42\x74\x38\xf1\x81\x72\x1f\xa8\x6a\xb3\x38\x23\x2c\x43\xc7\x65\x8e\xe6\xa6\x48\x52\x93\x6b\x0e\xa2\x2d\x9b\x6c\xca\x76\x22\x04\x43\xc2\x9d\x70\x31\xc9\x98\xf6\x02\x88\x09\x53\xd8\x42\x5d\xeb\xe4\xb7\x3f\x11\x52\x4f\x08\x8f\x6c\x44\x8a\x74\xed\xc6\xda\x8d\x36\xdb\x75\x83\x3b\xf3\xc1\x5b\x5f\x2b\x9e\x6e\x95\x0f\xd5\x52\x0e\xd6\xc4\x35\x06\xb9\x26\x6b\x03\xda\xc1\x9d\xf2\xa6\xd2\x44\x4a\x32\xed\xf0\x47\x9b\x20\xe5\x5d\xe4\xd4\x55\xfe\x45\x9e\x25\x5e\x00\x0f\x3d\x9e\x31\x66\x16\xb8\xd0\x60\x9f\x8f\x60\x56\x23\x32\xeb\x8c\xef\xf3\x09\x4a\x9c\x8f\x6d\xc2\xd8\x20\x36\x34\x1b\x32\x5c\x82\xf7\x91\x44\xb3\xee\x2d\xae\xd6\x92\x7a\xb5\x8a\xec\x79\xb1\x2f\xe7\xe3\x3b\x67\xa8\xae\xb0\x0d\xd5\x98\xe4\xdf\xba\x59\x39\x71\x61\xe6\xfe\x6a\xbc\x8e\x3a\xb5\x13\x32\x42\x39\xaf\x9d\xe0\xd8\xad\xdd\x5b\x73\xe7\x86\xab\x18\x66\xf5\x86\x0f\x37\x8a\xfa\x11\xb6\xfd\x75\xd9\x2e\x10\x6d\x53\x94\xe9\x6d\xe2\x50\x09\xa9\xdd\x72\xe9\x50\xa2\xc2\x42\x08\xe3\xcb\x6b\x69\x3c\x96\x22\x4b\x3f\xb4\xc6\x95\xb2\x52\x30\x96\xa5\xf0\xfc\xeb\x2f\x5e\x3d\xfd\xe6\x43\xa8\xed\x08\x5e\x51\xe3\xae\xa5\xf1\x23\x41\xdf\xa9\x38\xbf\xb1\xe0\x4a\x91\x74\xa6\xfd\x81\xed\x40\xb4\x00\xcb\xad\x95\x9d\xa7\x38\xed\x44\xb3\x2d\xcb\x29\x4e\xdd\x56\xd3\xc6\x8b\x85\x44\x3a\xe6\x9d\xb8\x77\xdc\xb7\x37\xa1\x33\x8c\x75\x77\x69\x6d\x81\x4a\x3a\x9e\x5c\x09\x5b\xaf\x12\x0d\x5b\x49\x7c\x9c\x51\x89\x91\x0d\x47\x6b\x1c\xdf\x29\xeb\x57\xb2\xd7\xbc\xb2\x30\x47\xe3\x2a\x5b\x7b\x0a\x99\xf1\xcb\x7b\x16\x81\x5a\xdf\x60\x22\xa4\x16\x0b\x95\xff\xde\x1a\xd9\xce\xa3\x9c\x24\xcd\x0d\xeb\x83\xd5\xa7\xf9\x2a\xa4\x3a\x9d\x3c\x18\xde\xde\x1a\xc2\x67\x0f\xbc\x76\x12\x77\x23\x6c\x0f\x07\x87\x7b\x2d\x84\x09\x39\xa3\x7c\x7c\x95\xd4\x73\x24\x3e\xdf\xb8\xdf\xdf\xdd\xae\xfa\x91\xe6\x56\x6f\xf3\xe9\xbd\xf5\xcf\xd3\xa3\x41\x90\xd1\x84\xce\xf9\x9a\x72\x8d\x63\x94\x1d\xc2\xdd\x23\x17\x20\x31\x14\x32\x9a\x13\x4b\xc4\xb1\xc2\x6b\x93\xd9\x3f\xa5\x69\x37\x9d\x94\x8c\xf1\xba\x54\xf6\x4c\xd3\xcb\xb3\xe4\x04\x25\x2c\x7d\xbc\x62\xda\xde\x68\xb9\x4d\x4e\xd1\x1f\x5f\x9b\xe4\xd0\xc9\x04\x29\x4a\xb0\xa2\x34\xe3\x97\x4a\xa5\x3b\xfd\x3e\x44\x9d\x49\x0e\x16\x20\x57\x6c\x49\x2d\x57\xb9\xeb\x7e\x67\xc5\x10\x51\x4e\x1a\x6e\x68\xb2\x1d\x71\x7b\xc0\x28\xf2\xc5\xb3\x3d\xf2\xb1\x16\xc7\xd6\x7f\x7e\x51\xd0\x8a\x1c\x3f\x3e\xc5\xe9\xb1\xab\x41\x7e\xbd\x68\x79\xa9\xa4\x09\x91\xd3\xe6\xf7\xbc\x2a\x69\x99\x61\x25\x8f\xf9\x5d\x81\x91\x61\x38\x0a\xa0\x51\x4e\x8b\x6f\xa7\x38\x1d\x05\xe0\xfa\x79\xca\xc1\xce\x20\x6e\xf2\x5b\x8a\xab\x5a\xb8\x5c\x92\x72\x6b\x75\x14\x43\x0d\xa3\x02\x29\x53\x19\x61\x6c\x0a\x34\x2a\x71\x8c\x68\x23\x27\x9a\x6d\xb7\x76\xb6\xee\x1c\xb8\x11\x6d\xe9\x14\x31\x05\xc2\x58\x9d\x6f\x1e\x40\x25\xba\x2d\xa2\x75\xfc\x61\x7f\xfb\x73\x47\x20\x07\x19\x24\x54\x83\xe1\xb2\x6a\x61\x2d\x50\x7f\x77\x77\x6b\x98\x73\x11\x9c\x4d\x5d\x9f\x4d\xf9\xb8\xa2\x5f\x78\x6b\xb3\xc8\x49\xb8\x63\x07\x4d\xbb\x5e\x2e\x2a\xc8\x14\x82\xa9\xa8\x76\x3a\x26\xca\x8d\x8f\xa7\x38\x0d\x60\x74\x59\xee\xab\xde\xc5\xc5\x85\xf1\xc3\x60\x6f\x6b\xb8\x71\x30\x18\x7a\x01\xdc\xdf\xd8\x39\xdc\x9a\x95\x5e\xf0\xd6\xbc\x11\x34\x71\x94\x26\x3a\x53\x06\x6d\xcd\x66\x7c\xa8\xe9\x19\x7a\x35\x94\xf5\x16\x0a\x49\x44\xc6\xed\x0e\x6f\x5a\xe8\x8f\x6f\xde\x9c\x55\x61\xd7\x4f\x52\x21\x35\xe1\x1a\x86\x19\x43\x65\x97\x3f\xee\xc1\x06\x3b\x27\x53\x05\xa9\xc4\x98\x5e\xb8\x5d\x4d\xc1\x39\xd5\x93\xdc\xe0\xa6\x1c\x07\x30\x72\x05\xb3\x47\xa3\x91\x0f\xa3\x4c\x99\x67\xf3\xc5\x09\xf3\x49\x0f\x0e\x15\xba\x99\xcd\xda\x37\x64\x44\x52\x6d\x6c\x50\x81\x1a\xe3\x98\xb7\xe3\x0a\xef\x53\x87\x57\xb9\xfc\x7c\x82\x1c\xa6\x22\x83\x73\x23\x67\xe9\xfa\xdc\x29\x80\x67\xc8\xad\x6c\x22\xd3\xce\x65\xa8\x4a\xfd\xb6\x2e\x48\x92\xb2\x62\xa1\xcf\xd3\x4c\x07\xe0\xbd\xf8\xe3\x9f\x5e\x3d\x7b\xf2\xea\xe9\x93\xe7\x5f\xfe\xee\xf9\x57\xbf\x7a\xf9\xdb\xbf\xbc\xf8\xe2\xef\xdf\xfe\xeb\x9b\x17\x3f\x7b\xe6\xa6\x4b\x37\xe9\x07\xad\x4c\x2c\x1a\xb3\x4b\xcf\x6e\x48\x41\xb9\x67\xf8\x66\x02\x65\x59\x62\x2b\x72\xd5\xbe\x55\x70\xd4\xa6\x5c\x51\x77\xfa\xb7\x6d\x02\x92\x13\x64\xf9\x6b\xad\xba\x54\x48\xd6\x32\x4d\xcc\x5a\xc5\x2a\xd1\x9d\xfc\x57\x11\xa9\xdc\x5f\xd0\x88\x30\xa4\x09\x61\x0d\x1a\xaf\x7f\xf9\xeb\xd7\x4f\xfe\xe0\x15\x65\xea\xa8\x24\xd5\x94\xe6\xbb\xd2\xd4\xfe\xfa\x5d\xed\x40\x89\xfa\xfc\xcf\xbf\x79\xfe\xf5\x97\xdd\xe8\x98\x10\xca\xde\x82\xff\xfa\xe7\x4f\x5f\x3e\xfd\x5b\x4d\x43\xfb\x70\xd4\xa8\x7c\x83\x4c\x9b\x08\xc9\xab\x6e\xd9\xfd\x3c\xf4\xca\x48\x37\x24\xf3\x97\xca\xb0\x55\x3c\x57\x6f\x4e\xa4\x23\xbf\x6c\x76\x6a\xa1\x52\x6c\xdd\x0f\xab\xca\x5e\x1a\x37\xaf\xe8\x35\xd7\xd7\xea\x38\x6d\x15\x6e\xc3\xa0\xd8\xb8\x3f\xb9\x39\x6b\xc6\xf9\x9e\x14\x51\x16\xea\x3c\x75\x43\xa2\x71\x2c\xe4\xd4\x66\xaf\x7a\xd7\x40\x4f\x73\x5a\xdf\x5f\x00\xec\x1a\x90\x4e\xe4\x42\xb3\x6b\xe4\xca\x66\x61\x84\xab\x04\x49\x25\x0d\xf1\x6d\xd9\xb2\x67\x81\xde\x94\x2c\xb9\x48\xf6\xe0\xed\xfb\x35\xd8\x7b\xc5\x7b\xe1\xed\x3c\xe2\xcb\xd7\xa2\x66\xe7\x0b\xc7\x85\x14\x25\x40\x69\xbe\xca\x00\x25\x52\xe9\x26\x8b\x55\x4f\x8d\x7a\x70\x75\x24\x47\xd3\x98\x79\x86\xcc\x39\xfd\xfd\xb3\xc4\xed\x06\xf7\xfb\x7b\xae\x8e\xbe\xfc\xfd\x2f\xdc\xce\xf0\xff\xad\xe0\xbf\x71\x2b\xa0\xea\xf8\x8c\xa6\x75\x02\xb5\x63\xcc\x92\xc2\xfd\xfe\xde\x77\xbd\x13\x7c\xf8\xd2\x6f\xc3\xb8\x9c\x7b\x1f\xd6\x5a\x3c\xc7\xb6\x52\x7d\xed\x7a\x81\xff\xec\xab\x6f\xff\xf1\xd7\xb9\xa8\x7f\xf1\xd3\x7f\x1a\xef\xbf\x63\xec\xff\x87\x04\xc4\x1b\x42\xf6\x7f\x36\x3b\xdf\x25\x78\xf3\x38\x89\xda\x4d\x4b\xb0\x7f\x78\x6f\xa9\x11\xce\xcb\xa6\x64\x6b\xa1\x49\xb3\x8b\x29\x3d\xdd\x11\xc9\x95\x8d\xf3\x50\x6e\x45\x71\xcd\x50\xf3\xf5\xb9\x3c\x4c\xb9\x52\xcc\xa3\x59\xd9\xd7\x0f\x51\xa5\x82\x2b\xac\xcf\x5f\x4e\x6b\x37\x6b\x99\xf9\xad\x07\xbb\x02\x12\x22\x4f\x23\x71\xce\x7d\xe0\x02\xf0\x22\x65\x84\x13\x33\xa3\x95\x77\x7c\x8b\xb0\x9f\x85\x21\x2a\x55\xd2\x6c\x99\xad\xd7\xeb\xd5\x2d\x60\x47\xa0\x86\x05\x72\x80\x56\xa2\x19\xea\x5b\x52\x9a\x01\xb4\x49\x1b\xcd\xa2\x6d\x5c\xcd\xc3\x71\x28\x22\x4b\x30\x41\xa5\xdc\xb1\x87\xe7\xd0\xea\x87\x0b\xb3\x62\xc4\x4b\xa8\x52\x94\x8f\x8f\xdd\x1d\xe2\x28\x30\x6a\xba\x67\xb3\x2d\x9f\xd1\x08\xa3\x79\xd0\xc7\x19\xca\xa9\x83\xb4\x8f\xab\xf9\x81\x61\x82\x5c\x97\x48\x00\x05\x1a\xe5\x67\x84\xd1\xc8\x1d\x15\x8c\x02\x18\x62\x8c\x12\x79\x88\x51\x7e\x17\xc7\x85\x36\x73\xbc\xaa\x2e\x44\x6b\xcc\x24\x32\x6b\xe2\x51\x00\x9b\x84\x1b\xd0\x08\x35\xca\x84\x72\xb4\x93\x3f\x14\x00\x6a\x42\x53\x38\x41\x7d\x8e\x98\x4f\xf2\xaa\xa0\x45\x92\x13\x3a\xce\x44\xa6\x4a\xd1\xdd\xe5\x1c\xb5\x77\xc7\x90\xf1\x90\x21\x91\x65\x38\x6c\x67\x34\x42\x46\x79\x35\xc1\x0e\xcc\x00\x6f\xc6\xf0\x7c\x78\x35\xce\x03\x3d\xc1\x4a\xdb\xdc\x64\x4b\x06\xc8\x95\x04\x1b\x65\xcb\xc5\xf0\x7a\xdb\x5d\x79\x81\xf5\x2a\x68\x01\x9f\xdc\x04\x1a\x5b\xd5\x95\xbb\x71\xcd\xed\xfc\x69\x0f\xf2\x53\x1f\xeb\x4d\x17\x80\x34\x06\x6a\xca\x2c\x50\x05\x94\xab\x2c\x8e\x69\x48\x91\xbb\x48\xfd\x41\x0f\xfa\xf7\xf6\x06\xc3\x83\x8d\xdd\x83\x00\xee\xa3\xa4\xf1\xd4\x4c\xb8\x39\xae\xb2\xc7\x40\x70\x82\x26\x71\x40\xd8\xb0\xee\xc1\x16\x57\x99\x44\x3b\xff\x9e\xe2\x74\xc5\xde\xe1\x41\x4a\xa8\x74\xc7\x0d\xa1\x60\x82\xc3\x52\xb0\xec\x03\xf6\xc6\x3d\xa8\xed\x0e\x65\x4f\x56\xcc\xff\xb0\x3b\x38\xb8\x02\xc0\xb7\x00\x0b\xff\x0e\x00\x00\xff\xff\xf4\xb1\x29\x89\xe7\x1f\x00\x00") + +func yaoAssistantsQuerydslPromptsJoinYmlBytes() ([]byte, error) { + return bindataRead( + _yaoAssistantsQuerydslPromptsJoinYml, + "yao/assistants/querydsl/prompts/join.yml", + ) +} + +func yaoAssistantsQuerydslPromptsJoinYml() (*asset, error) { + bytes, err := yaoAssistantsQuerydslPromptsJoinYmlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "yao/assistants/querydsl/prompts/join.yml", size: 8167, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _yaoAssistantsQuerydslPromptsYml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x58\x5b\x6b\x1c\xc9\x15\x7e\xd7\xaf\x38\xb4\x76\x91\x04\xad\x91\xec\x04\x12\x1a\x4b\xa0\xb5\x2e\xf1\x62\x6b\x94\x19\xd9\xc1\x18\xe3\xa9\xe9\x3e\x3d\x53\x56\x75\x55\xbb\xaa\x5a\x3b\x13\x65\x60\x93\xa7\xdd\x40\x60\x21\x79\x0c\x84\x04\x42\xf2\xe4\x90\x97\xe4\x17\x59\xde\xfc\x8b\x50\x55\x7d\xef\x96\xac\x38\x7e\x58\x0c\x9e\x56\xd5\xb9\x7c\xe7\x5a\xa7\x6a\x1d\x7e\x9e\xa1\x5c\x1e\x8e\x1f\xc3\x09\x72\x94\x44\x0b\x09\x07\x33\xe4\x1a\xb6\xe1\x09\xa1\x1c\xce\xa4\x48\x52\x0d\x9b\x87\x18\x93\x8c\xe9\x9d\x2f\x88\xa2\xa1\xe5\xa2\xa8\xb6\xd6\xb6\x41\x0a\x86\x01\xa8\xa5\xd2\x98\xac\x01\x84\x82\x6b\xe4\x3a\x80\x5f\xad\x01\x00\x3c\x17\x19\x10\x89\x40\x2a\x45\xb3\x42\xd1\x00\x1e\x0a\x7e\x89\x52\x03\x27\x3a\x93\x84\x01\x23\x7c\x96\x91\x19\xc2\x1b\x27\x1f\x28\xd7\x02\x9e\x13\x51\x71\x7f\x39\x1e\x9e\x42\x2c\x64\x42\xf4\x60\xcd\xaa\x58\x5f\x6f\xed\x8e\xc3\x39\x26\xc4\xee\x4d\x26\x93\xd7\x4a\x70\xfb\x7d\x65\xff\x07\xf0\x3e\x53\x96\xc0\x0b\xc0\x9b\x6b\x9d\x06\x3b\x3b\x86\x66\xdb\xad\x0e\x84\x9c\xed\x44\x92\xc4\x7a\x7b\xf7\x27\x3b\x6e\x6d\xdd\xf3\x0b\x5e\x4d\x35\x43\xc3\x59\xa8\xac\xb6\x22\x54\xa1\xa4\xa9\xa6\x82\x1b\x82\x13\x91\x39\x5c\x70\x28\x12\xe3\xc9\x71\x8a\x21\x8d\x69\x08\x8f\x0b\x2b\x63\x21\x21\x22\x9a\x4c\x89\x2a\x4d\xae\xa9\x5a\xa6\x56\x93\x98\xbe\xc6\x50\xd7\xf5\xc4\x94\x53\xa3\x46\x79\x41\x69\x15\x80\x87\x8b\x54\xa2\x52\x4e\x7f\xb5\x5e\x13\xa5\xb4\xa4\x7c\x56\x8a\xea\x83\x7d\x4c\x91\x45\x50\x89\x1a\xc0\x78\xc9\x35\x59\x04\x10\x9b\x1d\x1f\x34\x99\x32\x1c\xe4\x7f\x04\xc7\x4f\x4f\x1f\x6e\x12\x39\x53\x5b\xbe\x23\x00\xa2\x80\x30\x4a\x94\x57\x2a\x59\x55\xfa\xbc\x50\xf0\x88\xea\x5b\x20\xb6\xac\xed\x83\xe8\xbc\x5a\x49\x6a\xd0\xa6\x52\xa4\x28\xb5\xf1\x64\x53\x03\x80\x67\x01\x9a\xe5\x8e\x47\xea\x18\x2d\xa9\x48\x7b\xe9\xfc\x0e\x98\x3d\x1f\xf6\x7d\xd8\xdf\xf3\xe1\x81\x0f\x0f\xcc\xcf\xbe\x0f\x8c\x5e\xa0\x0f\x09\xd1\xe1\xdc\x07\xca\x7d\xa0\xaa\xab\xe2\x92\xb0\x0c\x9d\x96\x96\xcc\x87\x22\x49\x4d\xd1\x38\x8a\x2e\x36\xd9\xc4\x36\x15\x82\x21\xe1\x0e\x9c\xad\x52\x2f\x80\x98\x30\x85\x1d\xd6\xbd\x5e\x7d\xe3\xb9\x90\x7a\x4e\x78\x64\x33\x52\xa4\x7b\x1b\x7b\x1b\x5d\xb5\xfb\x86\x77\xe5\x83\xb7\xbf\x57\x7c\x3d\x28\x3f\xaa\xa5\x9c\xac\xc9\x6b\x1c\x72\x47\xd5\x86\xb4\x47\x3b\xe5\x4d\xa3\x89\x94\x64\xd9\x13\x8f\xae\x40\xca\xfb\xc4\xa9\x9b\xe2\x8b\x3c\x4b\xbc\x00\x5e\x78\x3c\x63\xcc\x2c\x70\xa1\xc1\x7e\xbf\x84\x55\x4d\xc8\xaa\x37\xbf\xbf\x9a\xa3\xc4\x76\x6e\x13\xc6\x86\xb1\x91\xd9\xc0\x70\x05\xde\x67\x12\xcd\xba\xb7\xbe\x53\x2b\xea\x9d\x2a\xb3\xdb\xb0\xaf\xda\xf9\x9d\x2b\x54\x37\xf8\x86\x6a\x4c\xf2\xbd\x7e\x55\x0e\x2e\xac\xdc\xbf\x9a\xae\x97\xbd\xd6\x09\x19\xa1\x6c\x5b\x27\x38\xf6\x5b\xf7\xc1\xda\xd9\x70\x1d\xc3\xac\x6e\xf8\xb0\x51\xf4\x8f\xb0\x1b\xaf\xab\x6e\x83\xe8\xba\xa2\x2c\x6f\x93\x87\x4a\x48\xed\x96\xcb\x80\x12\x15\x16\x20\x4c\x2c\xef\x64\xf1\x4c\x8a\x2c\xfd\xd4\x16\x57\xc6\x4a\xc1\x58\x96\xc2\xbb\xef\xbe\xf9\xfe\xed\x9f\x3f\x85\xd9\x4e\xe0\x0d\x3d\xee\x4e\x16\xbf\x16\xf4\x7f\x6a\xce\xb7\x36\x5c\x29\x92\xde\xb2\x3f\x37\x87\x08\x68\x01\x56\x5b\xa7\x3a\x2f\x70\xd9\xcb\xf6\xa5\xa0\x1c\x2e\x70\xe9\x8e\x9a\x2e\x5f\x2c\x24\xd2\x19\xef\xe5\x3d\x76\x7b\xb7\xb1\x33\x8c\x75\x7f\x6b\xed\x90\x4a\x3a\x9b\xdf\x48\x5b\xef\x12\x0d\x5f\x49\x7c\x93\x51\x89\x91\x4d\x47\xeb\x1c\xdf\x19\xeb\x57\xd8\x6b\x51\x59\x6b\xc9\xb8\xc9\xd7\x9e\x42\x66\xe2\xf2\x91\x4d\xa0\x36\x37\x98\x0c\xa9\xe5\x42\x15\xbf\x0f\x66\xb6\x8b\x28\x27\x49\xf3\xc0\xfa\x64\xfd\xa9\xdd\x85\x54\x6f\x90\x87\xa3\xc3\xa3\x11\x7c\xf1\xdc\xeb\x16\x71\x3f\xc3\xc9\x68\xf8\xf4\xac\xc3\x30\x27\x97\x94\xcf\x6e\x42\xdd\x12\xf1\xb3\x83\x67\x8f\x4e\x4f\xaa\x79\xa4\x79\xd4\xdb\x7a\xfa\x68\xfb\xf3\xf2\x68\x08\x64\x34\xa1\xad\x58\x53\xae\x71\x86\xb2\x07\xdc\x13\xb2\x00\x89\xa1\x90\x51\x0b\x96\x88\x63\x85\x77\x16\x33\xbe\xa0\x69\xbf\x9c\x94\xcc\xf0\xae\x52\xce\xcc\xd0\xcb\xb3\x64\x8a\x12\x36\xef\x6d\x9b\xb1\x37\xda\xea\x8a\x53\xf4\x97\x77\x16\x39\x72\x98\x20\x45\x09\x16\x4a\x33\x7f\xa9\x54\xba\x37\xee\x23\xd4\x99\xe4\x60\x09\x72\xc3\x36\xd5\x56\x55\xbb\xee\x77\x55\x5c\x22\xca\x9b\xc6\xc3\x22\xca\x70\x6c\xef\x20\x76\xbd\x5c\x54\x90\x29\x04\x53\xa3\xf6\x22\x45\x94\xbb\x90\x5c\xe0\x32\x80\xc9\x55\xd9\xa9\xbd\xc5\x62\x61\x6c\x19\x9e\x1d\x8d\x0e\xce\x87\x23\x2f\x80\x67\x07\x8f\x9f\x1e\xad\x26\x56\xdc\x36\x4c\xbc\x3d\x6f\x02\x4d\x1e\xa5\x89\xce\x94\x61\xdb\xb3\x39\x14\x6a\x7a\x89\x5e\x8d\x65\xbf\xc3\x92\x4a\x1a\xa2\xe1\x30\x33\xd9\xbd\xdd\xdd\x3a\x71\x57\x81\xf1\x5e\x31\xdd\xdd\xfb\x69\x8d\xd6\x0e\x6f\x6d\x6a\x5b\xe9\x7e\x39\xd9\x79\x9f\x6b\x54\xfa\x73\x83\xa7\x70\x95\xbb\x29\x1e\x2d\x48\x92\x32\x54\x6e\xf9\x11\x4f\x33\x1d\x80\x77\xfd\xa7\xbf\x7e\xff\x8f\xbf\x5c\x7f\xfb\xf5\xf5\x1f\xbf\x7d\xff\x87\xbf\x5f\x7f\xf3\x6f\x77\x5d\x70\x57\xb7\xa0\x7b\x77\x73\xfa\x02\xf0\x32\x65\x6a\xdf\x37\x37\x09\x96\x25\xb6\xb2\x8a\x63\xb8\x22\xa2\x91\xa1\x28\xb2\xe7\xd1\xa1\x05\x4a\xa6\xc8\xf2\x3f\xcb\x1c\xa9\x58\x0a\x7b\xba\x8d\xae\x64\x7c\xf7\xb7\xdf\xbf\xfb\xee\x77\x7d\xcc\x98\x10\xca\x3e\xc0\xfd\x9f\xdf\xbc\x7d\xff\xf6\x9f\x7d\xdc\x55\x64\x6f\x61\x7f\xff\xdb\x7f\x5d\x7f\xfd\x6b\xcf\x65\xe4\xcb\x2a\x31\xcd\xef\x30\xd3\xc6\xad\xb9\xa7\xca\xc3\xe0\x45\xee\x87\xc2\xb4\x12\x65\xae\xf0\xa5\x5f\x76\xf8\xca\xad\x45\x77\xb9\xbf\xbb\x6a\x86\xec\x98\xf2\x08\x5c\xd6\x81\xa5\x06\x33\x62\x61\x04\xd3\xa5\x6b\xfb\x3f\xfc\x00\x9e\x1a\x92\x8f\x0d\xc0\xd8\x11\xfd\x3f\x01\xb8\xcd\xef\xe5\x39\xf9\xe2\xc3\x35\x6f\x04\x94\x87\xe0\x0b\x2b\xde\x8c\xcd\x56\x70\x27\x7e\xeb\xeb\x30\x42\x95\x0a\xae\xb0\xde\xb3\x1c\x64\xd7\x9f\x04\x67\xcb\x01\x9c\x0a\x48\x88\xbc\x88\xc4\x57\xdc\x07\x2e\x00\x17\x29\x23\x9c\x98\xbe\x56\xbe\xb4\xac\xc3\x38\x0b\x43\x54\xaa\x94\x69\x37\xf2\x6e\x5a\x3e\xc3\x44\x54\x62\xa8\xd9\xb2\xeb\x91\xc1\x60\x50\x37\xdf\x3e\x26\x34\xcd\xcf\x29\x7a\xec\x58\x87\x23\x29\x85\x6c\xaa\xfe\xc5\x1c\x39\x50\x93\xa3\x40\x15\x50\xae\xb2\x38\xa6\x21\x45\xae\x41\x48\xa0\xfc\x92\x30\x1a\xf9\x20\x1d\x42\xb4\x02\x8c\xd1\x05\x34\xbb\x62\x6b\xd8\x7c\xbc\x0a\x45\x64\xf1\x24\xa8\x94\x3b\xd9\x3c\xa7\xb4\x7e\x7e\xe4\x88\xdc\x86\xe1\x50\x41\xd1\x2c\x13\xaa\x14\xe5\xb3\x57\xee\xe1\x68\x12\x18\xaf\xba\x6f\x48\xa5\xb8\xa4\x11\x46\x6d\xd2\x37\xc6\x6b\x8e\xd2\x7e\xee\xe4\x53\x62\x62\x6c\x68\x33\xe5\x06\xbd\xb2\x29\x32\x09\x60\x84\x31\x4a\xe4\x21\x46\xf9\xf3\x8b\xb9\xad\x52\x9e\xeb\x2c\xb8\x48\x32\xa5\xb3\x4c\x64\xaa\x54\xe6\xde\x50\xa8\x7d\xab\x83\x8c\x87\x0c\x89\xf4\x81\x23\x46\x90\x08\x89\x10\xa1\x26\x94\xa9\xba\xa1\x98\x77\xf2\x8e\xe7\x9a\x36\xb7\xbc\xe7\x1a\x82\x89\x4d\x39\xfc\xae\x6e\x12\x60\xc1\xb5\xf8\x1d\xd0\xba\x4b\x6e\x15\xd5\xf0\x4f\x4b\x94\x7b\xda\xda\x58\x2c\x16\x1b\x10\x09\x54\xd6\x57\xb8\xa0\xaa\xe6\xb1\xae\xc4\x96\xef\x7a\xe1\x51\x05\x25\x99\x0f\x29\x43\xa2\xb0\x08\x5d\xc3\x9f\x5e\x55\x94\x27\x19\x8d\x90\x51\x8e\xca\xae\xdc\x1b\xc0\x90\xb3\xa5\x1d\x20\x2c\x78\x05\xa6\x48\x40\xcf\x4b\x49\x51\x91\x49\x9b\x86\xc8\xb5\xcf\x81\x29\xfe\x2d\x2b\xe1\xfe\x00\xf2\x47\x5a\xb0\xc5\x63\xae\x57\xf7\x77\x81\xc6\xd6\x4e\xe5\x5e\x1f\xf3\x4c\xfa\xd1\xa0\xa8\xd9\xaa\x22\x0c\x65\x6f\x21\x59\x8e\x1f\x0f\xe0\xd1\x93\xb3\xe1\xe8\xfc\xe0\xf4\x3c\x80\x67\x28\x69\xbc\x84\xa5\xc8\x72\x5e\x65\x1f\x09\x61\x8a\xe6\x1a\x03\xc2\x36\x97\x01\x1c\x71\x95\x49\x04\xc2\x98\x99\x81\xb6\xed\x7b\x16\xa4\x84\x4a\x37\x28\x85\x82\x09\x0e\x9b\xc1\x96\x0f\x38\x98\x0d\xe0\xb6\xd1\x05\x4e\x87\xe7\x37\x10\xf8\x96\x60\xed\xbf\x01\x00\x00\xff\xff\xfa\xbb\x0f\xa9\xcc\x16\x00\x00") func yaoAssistantsQuerydslPromptsYmlBytes() ([]byte, error) { return bindataRead( @@ -1935,7 +2020,27 @@ func yaoAssistantsQuerydslPromptsYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/assistants/querydsl/prompts.yml", size: 1155, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/assistants/querydsl/prompts.yml", size: 5836, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _yaoAssistantsQuerydslSrcIndexTs = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\x54\x5d\x73\xe2\x36\x14\x7d\xf7\xaf\x38\xf5\x43\x06\x76\x8c\xe9\xb3\x29\xbb\xa5\x59\x4a\xd8\x49\x20\x85\x26\x9d\xce\xce\x4e\x46\xb1\xaf\x41\x8b\x91\x5c\x49\xde\x85\x59\xf8\xef\x1d\xd9\x92\x03\x6c\x92\x97\x20\xdd\xaf\x73\xcf\x39\x72\xff\xdd\xbb\x00\xef\xf0\x57\x45\x6a\xff\x71\x79\x8b\x09\x09\x52\xcc\x48\x85\xd1\x8a\x84\x41\x0f\x37\x52\x6e\x74\x80\x3a\x6d\x99\x92\x60\x8a\x4b\x8d\xce\x37\xce\xb0\x25\xc3\x32\x66\x58\xac\xdd\x7d\x37\xb1\x59\x40\x0f\x61\xce\x0b\x43\x2a\x44\xfd\x97\xe0\x9f\x9b\xf1\x62\x8c\x54\x8a\x8c\x1b\x2e\x85\x46\x67\x18\xa1\xe0\x1b\x8a\xc0\x45\x84\xf9\x22\x82\x20\x6d\x28\xeb\xb6\x1d\xd8\x6a\xa5\x68\xc5\x6c\x7a\x88\x04\x93\xc5\xfc\xe1\x1e\x7f\xfc\x1b\xe1\x7a\xfe\x30\xfb\x3b\xc2\xf2\xe1\x2e\xc2\xe8\x71\x12\xe1\x66\xf4\x38\x9d\x4d\xda\xc2\xaf\x92\x0b\x37\xd8\x8e\xbe\xab\x0a\xc3\x7b\x86\x3d\x17\x84\x4f\xf3\xe9\x0c\xff\x55\xa4\x38\xf9\x9d\xa6\x39\x84\x34\xd0\x25\xa5\x3c\xe7\x94\x45\xa8\x34\x69\x64\x94\xb3\xaa\x30\x28\x95\xdc\x96\x46\xc7\xfb\x6d\x81\xce\x33\xd3\x3c\xf5\xf5\x16\x69\x3f\x08\xfa\x7d\xfc\x6e\x74\x4f\xc8\x74\x4d\xe9\xa6\x3e\x3f\xb2\x82\x67\xf0\xa4\x40\xb0\x2d\x69\x98\x35\x33\xd8\xb2\x12\x46\xba\xa6\x28\x15\x69\x32\x1a\x5c\xf8\x31\x7d\x64\x5c\x51\x6a\xa4\xda\x07\xa9\x14\xda\xe0\x71\x74\x3b\xfd\xf8\xb4\xbc\x1e\xcf\x46\x8b\xe9\x7c\x89\x21\x3e\x7b\x6e\xa3\x73\x8e\x22\xb7\x79\x84\x30\x95\xdb\xb2\xa0\x5d\xf8\x65\x10\x04\x4e\xe1\x6b\x45\xcc\x10\xd6\x52\x6e\xd0\x83\xa6\x82\x52\xa3\xcf\x81\xe0\x99\x69\xca\x20\xc5\xcf\xc2\xd6\xab\xe6\x95\x48\xed\x24\xd7\xab\x13\x00\xa9\xd9\x25\x60\xd6\x29\xf1\xb5\x14\x86\x76\x26\x0a\x80\x2d\x69\xcd\x56\xa4\x7d\xe8\xae\x39\x7f\xfe\x62\x83\xb2\xac\x0d\xf0\x21\xc1\x82\x52\xa9\xb2\xdf\xb4\x51\x5c\xac\x22\x30\xb1\x7f\x1f\x74\x7d\x8d\xb5\x5d\x33\x67\x41\xba\x94\x42\x13\x0e\x10\x55\x51\xe0\x47\x00\xf4\xfb\x98\x90\x79\xa1\x38\x57\x72\xdb\xa2\xb6\xb8\x6a\xee\xda\xf0\xd0\x4f\x8d\x7d\xce\x87\x76\x35\x1c\x0e\x76\x8d\x57\x22\x83\x66\xd0\x34\xc7\xb7\x73\x41\x4f\xbc\xa2\xc8\x54\x4a\xc0\xac\x09\xa9\x54\xaa\x86\x9a\x71\xb1\x72\x94\x06\x00\xcf\xd1\x31\xfb\x92\x64\x7e\x82\x67\x38\x44\xd8\xec\x1d\xe2\xea\xea\x52\xe4\x98\x8b\xb4\xa8\x32\xd2\x9d\xf6\x61\x75\xeb\xb5\xe1\xe7\x35\x07\x38\xfd\x9e\x9a\x61\x49\x3b\x20\xaa\xc3\x47\xbb\xc0\x31\x68\xb6\x98\x49\xaf\x72\xcf\x1a\xfc\x35\x7f\x07\x6d\x7b\xcb\xf3\x20\x38\xb6\xe6\x99\xd1\xce\x78\xeb\xd0\xce\x28\x66\xbd\xd3\x7e\x33\x3e\x2d\xe7\xb3\x46\x81\xdb\xdb\x3b\x28\x27\xd7\xb9\x65\x6c\x87\xb7\x0d\x53\xb2\x7d\x21\x59\xe6\x23\x36\xd9\xea\x7f\xdf\x5c\xbf\x98\xc2\x07\x5e\xb3\x44\x23\x79\xe3\xfc\x7a\xe4\xd0\xb7\x8d\x5f\x2e\x07\x81\x53\xe4\x97\x93\xc4\xc3\x01\x27\xc7\x38\xb5\xb8\x84\x79\x83\x71\x6b\x91\x04\x3f\x40\x4a\x49\x95\x20\xa4\x6d\x69\xf6\x4f\x7e\xe9\x30\xf2\xe6\x4f\x10\x36\x6c\xd8\x6a\xca\x50\xe7\xc1\xf5\x0e\x71\xbc\x94\xc8\xc3\xaf\xe3\x18\xe2\x67\x40\x03\xa7\xe4\x83\x26\x58\xe2\xe2\x71\xa3\x44\x43\xbf\x54\xa8\x05\xed\x19\x59\x90\x62\xc2\x78\xa1\xb8\x14\x6d\xfb\x4c\x17\x18\xe2\x5e\xc9\x94\xb4\xee\x84\x97\x5d\xc2\xc8\x03\xe8\x0e\x1c\x4f\xb6\xe2\xea\x0a\xce\xc0\x75\xbd\xf5\xae\x7c\xfe\x4a\xa9\xa9\xbd\x3b\xaf\x7f\xc6\x1b\xda\x6b\x9b\xdd\x8d\x0b\x12\x2b\xb3\xc6\x7b\xfc\x7a\x49\xa1\x23\xcf\x76\x39\xf3\xe6\xb8\x45\x8a\x9c\xf1\xe2\xe4\x5d\xd5\x2c\xe3\x3b\x37\x6b\x48\xc5\x57\x5c\xb0\xc2\x43\x0c\x2e\xa4\x71\xc2\x38\x99\x5a\x79\xda\xd6\x4f\x4d\xeb\x30\x72\x19\x2f\x3a\xfd\x59\x07\xec\x77\xd9\x65\xbf\xe1\xe8\xb6\x54\xb1\xef\x89\x87\xe1\x74\xb4\xff\x8e\xf6\xc9\xfc\x1f\x00\x00\xff\xff\x45\x41\x5c\xac\x51\x07\x00\x00") + +func yaoAssistantsQuerydslSrcIndexTsBytes() ([]byte, error) { + return bindataRead( + _yaoAssistantsQuerydslSrcIndexTs, + "yao/assistants/querydsl/src/index.ts", + ) +} + +func yaoAssistantsQuerydslSrcIndexTs() (*asset, error) { + bytes, err := yaoAssistantsQuerydslSrcIndexTsBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "yao/assistants/querydsl/src/index.ts", size: 1873, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1955,7 +2060,7 @@ func yaoAssistantsTitlePackageYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/assistants/title/package.yao", size: 178, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/assistants/title/package.yao", size: 178, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1975,7 +2080,7 @@ func yaoAssistantsTitlePromptsYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/assistants/title/prompts.yml", size: 958, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/assistants/title/prompts.yml", size: 958, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1995,7 +2100,7 @@ func yaoDataIcons404Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/icons/404.png", size: 9342, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/icons/404.png", size: 9342, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2015,7 +2120,7 @@ func yaoDataIconsIconIcns() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/icons/icon.icns", size: 67465, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/icons/icon.icns", size: 67465, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2035,7 +2140,7 @@ func yaoDataIconsIconIco() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/icons/icon.ico", size: 54993, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/icons/icon.ico", size: 54993, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2055,7 +2160,7 @@ func yaoDataIconsIconPng() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/icons/icon.png", size: 34558, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/icons/icon.png", size: 34558, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2075,7 +2180,7 @@ func yaoDataIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/index.html", size: 282, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/index.html", size: 282, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2095,7 +2200,7 @@ func yaoDataKbProvidersChunkingSemanticEnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/chunking/semantic/en.json", size: 5543, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/chunking/semantic/en.json", size: 5543, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2115,7 +2220,7 @@ func yaoDataKbProvidersChunkingSemanticZhCnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/chunking/semantic/zh-cn.json", size: 5446, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/chunking/semantic/zh-cn.json", size: 5446, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2135,7 +2240,7 @@ func yaoDataKbProvidersChunkingStructuredEnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/chunking/structured/en.json", size: 2423, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/chunking/structured/en.json", size: 2423, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2155,7 +2260,7 @@ func yaoDataKbProvidersChunkingStructuredZhCnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/chunking/structured/zh-cn.json", size: 2321, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/chunking/structured/zh-cn.json", size: 2321, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2175,7 +2280,7 @@ func yaoDataKbProvidersConverterMcpEnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/converter/mcp/en.json", size: 4235, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/converter/mcp/en.json", size: 4235, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2195,7 +2300,7 @@ func yaoDataKbProvidersConverterMcpZhCnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/converter/mcp/zh-cn.json", size: 4060, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/converter/mcp/zh-cn.json", size: 4060, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2215,7 +2320,7 @@ func yaoDataKbProvidersConverterOcrEnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/converter/ocr/en.json", size: 6631, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/converter/ocr/en.json", size: 6631, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2235,7 +2340,7 @@ func yaoDataKbProvidersConverterOcrZhCnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/converter/ocr/zh-cn.json", size: 6501, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/converter/ocr/zh-cn.json", size: 6501, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2255,7 +2360,7 @@ func yaoDataKbProvidersConverterOfficeEnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/converter/office/en.json", size: 5476, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/converter/office/en.json", size: 5476, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2275,7 +2380,7 @@ func yaoDataKbProvidersConverterOfficeZhCnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/converter/office/zh-cn.json", size: 5356, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/converter/office/zh-cn.json", size: 5356, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2295,7 +2400,7 @@ func yaoDataKbProvidersConverterUtf8EnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/converter/utf8/en.json", size: 292, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/converter/utf8/en.json", size: 292, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2315,7 +2420,7 @@ func yaoDataKbProvidersConverterUtf8ZhCnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/converter/utf8/zh-cn.json", size: 281, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/converter/utf8/zh-cn.json", size: 281, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2335,7 +2440,7 @@ func yaoDataKbProvidersConverterVideoEnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/converter/video/en.json", size: 6411, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/converter/video/en.json", size: 6411, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2355,7 +2460,7 @@ func yaoDataKbProvidersConverterVideoZhCnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/converter/video/zh-cn.json", size: 6297, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/converter/video/zh-cn.json", size: 6297, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2375,7 +2480,7 @@ func yaoDataKbProvidersConverterVisionEnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/converter/vision/en.json", size: 4085, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/converter/vision/en.json", size: 4085, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2395,7 +2500,7 @@ func yaoDataKbProvidersConverterVisionZhCnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/converter/vision/zh-cn.json", size: 3949, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/converter/vision/zh-cn.json", size: 3949, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2415,7 +2520,7 @@ func yaoDataKbProvidersConverterWhisperEnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/converter/whisper/en.json", size: 4449, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/converter/whisper/en.json", size: 4449, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2435,7 +2540,7 @@ func yaoDataKbProvidersConverterWhisperZhCnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/converter/whisper/zh-cn.json", size: 4312, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/converter/whisper/zh-cn.json", size: 4312, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2455,7 +2560,7 @@ func yaoDataKbProvidersEmbeddingFastembedEnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/embedding/fastembed/en.json", size: 6865, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/embedding/fastembed/en.json", size: 6865, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2475,7 +2580,7 @@ func yaoDataKbProvidersEmbeddingFastembedZhCnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/embedding/fastembed/zh-cn.json", size: 6685, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/embedding/fastembed/zh-cn.json", size: 6685, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2495,7 +2600,7 @@ func yaoDataKbProvidersEmbeddingOpenaiEnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/embedding/openai/en.json", size: 5636, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/embedding/openai/en.json", size: 5636, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2515,7 +2620,7 @@ func yaoDataKbProvidersEmbeddingOpenaiZhCnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/embedding/openai/zh-cn.json", size: 5463, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/embedding/openai/zh-cn.json", size: 5463, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2535,7 +2640,7 @@ func yaoDataKbProvidersExtractionOpenaiEnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/extraction/openai/en.json", size: 9110, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/extraction/openai/en.json", size: 9110, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2555,7 +2660,7 @@ func yaoDataKbProvidersExtractionOpenaiZhCnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/extraction/openai/zh-cn.json", size: 8827, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/extraction/openai/zh-cn.json", size: 8827, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2575,7 +2680,7 @@ func yaoDataKbProvidersFetcherHttpEnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/fetcher/http/en.json", size: 5885, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/fetcher/http/en.json", size: 5885, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2595,7 +2700,7 @@ func yaoDataKbProvidersFetcherHttpZhCnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/fetcher/http/zh-cn.json", size: 5925, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/fetcher/http/zh-cn.json", size: 5925, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2615,7 +2720,7 @@ func yaoDataKbProvidersFetcherMcpEnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/fetcher/mcp/en.json", size: 6819, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/fetcher/mcp/en.json", size: 6819, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2635,7 +2740,7 @@ func yaoDataKbProvidersFetcherMcpZhCnJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/kb/providers/fetcher/mcp/zh-cn.json", size: 6611, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/data/kb/providers/fetcher/mcp/zh-cn.json", size: 6611, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2655,7 +2760,7 @@ func yaoFieldsModelTransJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/fields/model.trans.json", size: 14938, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/fields/model.trans.json", size: 14938, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2675,7 +2780,7 @@ func yaoLangsEnUsJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/en-US.json", size: 66, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/langs/en-US.json", size: 66, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2695,7 +2800,7 @@ func yaoLangsZhCnGlobalYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-cn/global.yml", size: 1762, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/langs/zh-cn/global.yml", size: 1762, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2715,7 +2820,7 @@ func yaoLangsZhCnLoginsAdminLoginYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-cn/logins/admin.login.yml", size: 94, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/langs/zh-cn/logins/admin.login.yml", size: 94, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2735,7 +2840,7 @@ func yaoLangsZhCnLoginsUserLoginYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-cn/logins/user.login.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/langs/zh-cn/logins/user.login.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2755,7 +2860,7 @@ func yaoLangsZhHkGlobalYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-hk/global.yml", size: 1762, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/langs/zh-hk/global.yml", size: 1762, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2775,7 +2880,7 @@ func yaoLangsZhHkLoginsAdminLoginYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-hk/logins/admin.login.yml", size: 94, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/langs/zh-hk/logins/admin.login.yml", size: 94, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2795,7 +2900,7 @@ func yaoLangsZhHkLoginsUserLoginYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-hk/logins/user.login.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/langs/zh-hk/logins/user.login.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2815,7 +2920,7 @@ func yaoModelsAgentAssistantModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/agent/assistant.mod.yao", size: 6945, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/models/agent/assistant.mod.yao", size: 6945, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2835,7 +2940,7 @@ func yaoModelsAgentChatModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/agent/chat.mod.yao", size: 3093, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/models/agent/chat.mod.yao", size: 3093, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2855,7 +2960,7 @@ func yaoModelsAgentMessageModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/agent/message.mod.yao", size: 3712, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/models/agent/message.mod.yao", size: 3712, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2875,7 +2980,7 @@ func yaoModelsAgentResumeModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/agent/resume.mod.yao", size: 3896, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/models/agent/resume.mod.yao", size: 3896, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2895,7 +3000,7 @@ func yaoModelsAgentSearchModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/agent/search.mod.yao", size: 3103, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/models/agent/search.mod.yao", size: 3103, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2915,7 +3020,7 @@ func yaoModelsAttachmentModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/attachment.mod.yao", size: 4687, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/models/attachment.mod.yao", size: 4687, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2935,7 +3040,7 @@ func yaoModelsAuditModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/audit.mod.yao", size: 5588, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/models/audit.mod.yao", size: 5588, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2955,7 +3060,7 @@ func yaoModelsConfigModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/config.mod.yao", size: 1649, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/models/config.mod.yao", size: 1649, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2975,7 +3080,7 @@ func yaoModelsDslModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/dsl.mod.yao", size: 3826, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/models/dsl.mod.yao", size: 3826, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2995,7 +3100,7 @@ func yaoModelsInvitationModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/invitation.mod.yao", size: 6693, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/models/invitation.mod.yao", size: 6693, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3015,7 +3120,7 @@ func yaoModelsJobCategoryModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/job/category.mod.yao", size: 2041, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/models/job/category.mod.yao", size: 2041, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3035,7 +3140,7 @@ func yaoModelsJobExecutionModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/job/execution.mod.yao", size: 7201, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/models/job/execution.mod.yao", size: 7201, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3055,7 +3160,7 @@ func yaoModelsJobJobModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/job/job.mod.yao", size: 6330, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/models/job/job.mod.yao", size: 6330, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3075,7 +3180,7 @@ func yaoModelsJobLogModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/job/log.mod.yao", size: 4711, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/models/job/log.mod.yao", size: 4711, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3095,7 +3200,7 @@ func yaoModelsKbCollectionModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/kb/collection.mod.yao", size: 5390, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/models/kb/collection.mod.yao", size: 5390, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3115,7 +3220,7 @@ func yaoModelsKbDocumentModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/kb/document.mod.yao", size: 9906, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/models/kb/document.mod.yao", size: 9906, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3135,7 +3240,7 @@ func yaoModelsMemberModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/member.mod.yao", size: 14798, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/models/member.mod.yao", size: 14798, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3155,7 +3260,7 @@ func yaoModelsRoleModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/role.mod.yao", size: 6434, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/models/role.mod.yao", size: 6434, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3175,7 +3280,7 @@ func yaoModelsTeamModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/team.mod.yao", size: 15823, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/models/team.mod.yao", size: 15823, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3195,7 +3300,7 @@ func yaoModelsUserOauth_accountModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/user/oauth_account.mod.yao", size: 6928, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/models/user/oauth_account.mod.yao", size: 6928, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3215,7 +3320,7 @@ func yaoModelsUserTypeModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/user/type.mod.yao", size: 7502, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/models/user/type.mod.yao", size: 7502, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3235,7 +3340,7 @@ func yaoModelsUserModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/user.mod.yao", size: 12335, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/models/user.mod.yao", size: 12335, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3255,7 +3360,7 @@ func yaoReleaseAppYaz() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/release/app.yaz", size: 181682, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/release/app.yaz", size: 181682, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3275,7 +3380,7 @@ func yaoStoresAgentCacheLruYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/stores/agent/cache.lru.yao", size: 301, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/stores/agent/cache.lru.yao", size: 301, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3295,7 +3400,7 @@ func yaoStoresAgentMemoryBadgerYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/stores/agent/memory.badger.yao", size: 352, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/stores/agent/memory.badger.yao", size: 352, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3315,7 +3420,7 @@ func yaoStoresCacheLruYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/stores/cache.lru.yao", size: 285, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/stores/cache.lru.yao", size: 285, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3335,7 +3440,7 @@ func yaoStoresKbCacheLruYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/stores/kb/cache.lru.yao", size: 304, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/stores/kb/cache.lru.yao", size: 304, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3355,7 +3460,7 @@ func yaoStoresKbStoreBadgerYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/stores/kb/store.badger.yao", size: 349, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/stores/kb/store.badger.yao", size: 349, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3375,7 +3480,7 @@ func yaoStoresOauthCacheLruYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/stores/oauth/cache.lru.yao", size: 301, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/stores/oauth/cache.lru.yao", size: 301, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3395,7 +3500,7 @@ func yaoStoresOauthClientBadgerYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/stores/oauth/client.badger.yao", size: 352, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/stores/oauth/client.badger.yao", size: 352, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3415,7 +3520,7 @@ func yaoStoresOauthStoreBadgerYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/stores/oauth/store.badger.yao", size: 376, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/stores/oauth/store.badger.yao", size: 376, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3435,7 +3540,7 @@ func yaoStoresStoreBadgerYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/stores/store.badger.yao", size: 341, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/stores/store.badger.yao", size: 341, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3455,7 +3560,7 @@ func yaoUploadersAttachmentLocalYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/uploaders/attachment.local.yao", size: 1163, mode: os.FileMode(420), modTime: time.Unix(1765935236, 0)} + info := bindataFileInfo{name: "yao/uploaders/attachment.local.yao", size: 1163, mode: os.FileMode(420), modTime: time.Unix(1766059893, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3592,7 +3697,12 @@ var _bindata = map[string]func() (*asset, error){ "yao/assistants/prompt/package.yao": yaoAssistantsPromptPackageYao, "yao/assistants/prompt/prompts.yml": yaoAssistantsPromptPromptsYml, "yao/assistants/querydsl/package.yao": yaoAssistantsQuerydslPackageYao, + "yao/assistants/querydsl/prompts/aggregation.yml": yaoAssistantsQuerydslPromptsAggregationYml, + "yao/assistants/querydsl/prompts/complex.yml": yaoAssistantsQuerydslPromptsComplexYml, + "yao/assistants/querydsl/prompts/filter.yml": yaoAssistantsQuerydslPromptsFilterYml, + "yao/assistants/querydsl/prompts/join.yml": yaoAssistantsQuerydslPromptsJoinYml, "yao/assistants/querydsl/prompts.yml": yaoAssistantsQuerydslPromptsYml, + "yao/assistants/querydsl/src/index.ts": yaoAssistantsQuerydslSrcIndexTs, "yao/assistants/title/package.yao": yaoAssistantsTitlePackageYao, "yao/assistants/title/prompts.yml": yaoAssistantsTitlePromptsYml, "yao/data/icons/404.png": yaoDataIcons404Png, @@ -3887,7 +3997,16 @@ var _bintree = &bintree{nil, map[string]*bintree{ }}, "querydsl": {nil, map[string]*bintree{ "package.yao": {yaoAssistantsQuerydslPackageYao, map[string]*bintree{}}, + "prompts": {nil, map[string]*bintree{ + "aggregation.yml": {yaoAssistantsQuerydslPromptsAggregationYml, map[string]*bintree{}}, + "complex.yml": {yaoAssistantsQuerydslPromptsComplexYml, map[string]*bintree{}}, + "filter.yml": {yaoAssistantsQuerydslPromptsFilterYml, map[string]*bintree{}}, + "join.yml": {yaoAssistantsQuerydslPromptsJoinYml, map[string]*bintree{}}, + }}, "prompts.yml": {yaoAssistantsQuerydslPromptsYml, map[string]*bintree{}}, + "src": {nil, map[string]*bintree{ + "index.ts": {yaoAssistantsQuerydslSrcIndexTs, map[string]*bintree{}}, + }}, }}, "title": {nil, map[string]*bintree{ "package.yao": {yaoAssistantsTitlePackageYao, map[string]*bintree{}}, diff --git a/go.mod b/go.mod index 20de134a..5116db79 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/elazarl/go-bindata-assetfs v1.0.1 github.com/emersion/go-imap v1.2.1 github.com/evanw/esbuild v0.25.4 - github.com/expr-lang/expr v1.17.3 + github.com/expr-lang/expr v1.17.7 github.com/fatih/color v1.18.0 github.com/fsnotify/fsnotify v1.9.0 github.com/gin-gonic/gin v1.10.1 diff --git a/go.sum b/go.sum index a4d631d8..4c5af8f0 100644 --- a/go.sum +++ b/go.sum @@ -81,6 +81,8 @@ github.com/evanw/esbuild v0.25.4 h1:k1bTSim+usBG27w7BfOCorhgx3tO+6bAfMj5pR+6SKg= github.com/evanw/esbuild v0.25.4/go.mod h1:D2vIQZqV/vIf/VRHtViaUtViZmG7o+kKmlBfVQuRi48= github.com/expr-lang/expr v1.17.3 h1:myeTTuDFz7k6eFe/JPlep/UsiIjVhG61FMHFu63U7j0= github.com/expr-lang/expr v1.17.3/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= +github.com/expr-lang/expr v1.17.7 h1:Q0xY/e/2aCIp8g9s/LGvMDCC5PxYlvHgDZRQ4y16JX8= +github.com/expr-lang/expr v1.17.7/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= diff --git a/yao/assistants/keyword/prompts.yml b/yao/assistants/keyword/prompts.yml index 0cd4696a..fa4a3d3d 100644 --- a/yao/assistants/keyword/prompts.yml +++ b/yao/assistants/keyword/prompts.yml @@ -1,21 +1,25 @@ - role: system content: | - Extract keywords from text content. + You are a keyword extraction tool, NOT a chatbot. Do NOT answer questions or provide explanations. + Your ONLY job: analyze text and output a JSON array of keywords with weights. - Task: - 1. Analyze input text - 2. Extract important keywords - 3. Return JSON format - 4. Match input language + Output format: ["keyword:weight", ...] - Response Format (JSON only): - ```json - {"keywords": ["keyword1", "keyword2", ...]} - ``` + Weight: + - 1.0: Core topic + - 0.8-0.9: Key concepts + - 0.6-0.7: Supporting themes + - 0.4-0.5: Peripheral concepts - Guidelines: - - Extract 5-15 keywords based on content length - - Prioritize nouns, proper nouns, key concepts - - Include single words and short phrases - - Exclude common stop words - - Keywords MUST be in the same language as input + Examples: + - Input(EN): "Developers frustrated with callback hell. ES2017 async/await improved readability." + - Output: ["async/await:1", "asynchronous programming:0.9", "ES2017:0.8", "code readability:0.7"] + + - Input(中文): "用户反馈APP启动慢、页面卡顿。需要优化首屏加载和内存占用。" + - Output: ["性能优化:1", "启动速度:0.9", "内存管理:0.8", "用户体验:0.7"] + + Rules: + - ONLY output JSON array, nothing else + - Max 5 keywords, sorted by weight + - Summarize related concepts + - Match input language (EN→EN, 中文→中文) diff --git a/yao/assistants/keyword/src/index.ts b/yao/assistants/keyword/src/index.ts index 26d37ae6..bf18267d 100644 --- a/yao/assistants/keyword/src/index.ts +++ b/yao/assistants/keyword/src/index.ts @@ -1,13 +1,20 @@ /** * Keyword Extraction Agent - Next Hook - * Parses LLM response and extracts keywords with error tolerance + * Parses LLM response and extracts keywords with weight + * Format: ["keyword:weight", ...] -> [{k, w}, ...] */ // @ts-nocheck +/** Keyword with weight */ +interface Keyword { + k: string; // keyword + w: number; // weight (0.1-1.0) +} + /** * Next hook - processes keyword extraction response - * Uses text.ExtractJSON for fault-tolerant JSON extraction from LLM output + * Parses format: ["keyword1:0.9", "keyword2:0.8", ...] */ function Next( ctx: agent.Context, @@ -21,22 +28,17 @@ function Next( } const content = completion.content; - let keywords: string[] = []; + let keywords: Keyword[] = []; try { - // Use text.ExtractJSON for fault-tolerant extraction - // Handles markdown code blocks, broken JSON, etc. - const parsed = Process("text.ExtractJSON", content) as { - keywords?: string[]; - } | null; + // Extract JSON array from response + const parsed = Process("text.ExtractJSON", content) as string[] | null; - if (parsed && Array.isArray(parsed.keywords)) { - keywords = parsed.keywords.filter( - (k) => typeof k === "string" && k.trim().length > 0 - ); + if (parsed && Array.isArray(parsed)) { + keywords = parseKeywordArray(parsed); } } catch (e) { - // If extraction fails, try to extract keywords from text + // If extraction fails, try to extract from text keywords = extractKeywordsFromText(content); } @@ -45,6 +47,9 @@ function Next( keywords = extractKeywordsFromText(content); } + // Sort by weight descending and limit to 5 + keywords = keywords.sort((a, b) => b.w - a.w).slice(0, 5); + // Return parsed keywords return { data: { @@ -54,49 +59,99 @@ function Next( } /** - * Extract keywords from plain text when JSON parsing fails - * Handles formats like: - * - Comma-separated: "keyword1, keyword2, keyword3" - * - Line-separated: "keyword1\nkeyword2\nkeyword3" - * - Bullet points: "- keyword1\n- keyword2" - * - Numbered: "1. keyword1\n2. keyword2" + * Parse keyword array format: ["keyword:weight", ...] + * Examples: ["AI:0.9", "机器学习:0.8", "deep learning:0.7"] */ -function extractKeywordsFromText(text: string): string[] { - const keywords: string[] = []; +function parseKeywordArray(items: (string | any)[]): Keyword[] { + const keywords: Keyword[] = []; - // Remove common prefixes/suffixes - let cleaned = text - .replace(/^[\s\S]*?keywords?[\s::]*\[?/i, "") // Remove "keywords:" prefix - .replace(/\][\s\S]*$/, "") // Remove trailing ] - .trim(); - - // Try line-by-line extraction - const lines = cleaned.split(/[\n\r]+/); - - for (const line of lines) { - // Remove bullet points, numbers, quotes - let keyword = line - .replace(/^[\s\-\*\•\d\.]+/, "") // Remove bullets/numbers - .replace(/^["'`]+|["'`]+$/g, "") // Remove quotes - .replace(/,\s*$/, "") // Remove trailing comma - .trim(); - - // Skip empty or too long - if (keyword.length > 0 && keyword.length < 100) { - // Split by comma if contains multiple - if (keyword.includes(",")) { - const parts = keyword.split(",").map((p) => p.trim()); - for (const part of parts) { - if (part.length > 0 && part.length < 100) { - keywords.push(part); - } - } - } else { - keywords.push(keyword); + for (const item of items) { + if (typeof item === "string") { + const parsed = parseKeywordString(item); + if (parsed) { + keywords.push(parsed); + } + } else if (item && typeof item === "object" && item.k) { + // Fallback: handle {k, w} format + const k = String(item.k).trim(); + const w = + typeof item.w === "number" ? Math.min(1.0, Math.max(0.1, item.w)) : 0.5; + if (k.length > 0) { + keywords.push({ k, w }); } } } - // Deduplicate - return [...new Set(keywords)]; + return keywords; +} + +/** + * Parse single keyword string: "keyword:weight" or "keyword" + */ +function parseKeywordString(str: string): Keyword | null { + const trimmed = str.trim().replace(/^["']+|["']+$/g, ""); // Remove quotes + if (!trimmed) return null; + + // Try to split by last colon (keyword may contain colons) + const lastColonIdx = trimmed.lastIndexOf(":"); + if (lastColonIdx > 0) { + const keyword = trimmed.substring(0, lastColonIdx).trim(); + const weightStr = trimmed.substring(lastColonIdx + 1).trim(); + const weight = parseFloat(weightStr); + + if (keyword && !isNaN(weight)) { + return { + k: keyword, + w: Math.min(1.0, Math.max(0.1, weight)), + }; + } + } + + // No weight found, return with default weight + return { k: trimmed, w: 0.5 }; +} + +/** + * Extract keywords from plain text when JSON parsing fails + */ +function extractKeywordsFromText(text: string): Keyword[] { + const keywords: Keyword[] = []; + + // Try to find array-like content + const arrayMatch = text.match(/\[([^\]]+)\]/); + if (arrayMatch) { + const items = arrayMatch[1].split(","); + for (const item of items) { + const parsed = parseKeywordString(item); + if (parsed) { + keywords.push(parsed); + } + } + if (keywords.length > 0) return keywords; + } + + // Fallback: line-by-line extraction + const lines = text.split(/[\n\r,]+/); + let defaultWeight = 1.0; + + for (const line of lines) { + let cleaned = line + .replace(/^[\s\-\*\•\d\.\[\]"'`]+/, "") // Remove prefixes + .replace(/[\]"'`]+$/, "") // Remove suffixes + .trim(); + + if (cleaned.length > 0 && cleaned.length < 100) { + const parsed = parseKeywordString(cleaned); + if (parsed) { + // Use parsed weight or assign decreasing default + if (parsed.w === 0.5) { + parsed.w = Math.max(0.1, defaultWeight); + defaultWeight -= 0.1; + } + keywords.push(parsed); + } + } + } + + return keywords; } diff --git a/yao/assistants/needsearch/prompts.yml b/yao/assistants/needsearch/prompts.yml index abecba6f..ece7ea76 100644 --- a/yao/assistants/needsearch/prompts.yml +++ b/yao/assistants/needsearch/prompts.yml @@ -1,20 +1,57 @@ # Need Search Agent - role: system content: | - Classify if user query needs external search. + You are a search intent classifier. Analyze user input and classify whether external search is needed. - ## Rules - NO SEARCH: greetings, chitchat, math, code generation, text processing, general knowledge - WEB: real-time data (weather, news, prices), current events, recent info - KB: documentation, how-to, configuration, FAQ - DB: user data, orders, records, business data + ## Your Task + - Classify the user's query into search categories + - Output MUST be a JSON with exactly these 3 fields: need_search, search_types, confidence + - DO NOT extract keywords, DO NOT answer the question, DO NOT add explanations - ## Response (JSON only) - {"need_search": bool, "search_types": ["web"|"kb"|"db"], "confidence": 0-1} + ## Classification Rules + + ### need_search=false (No search needed) + Use when the question can be answered from LLM's internal knowledge: + - Greetings & chitchat: "hello", "how are you", casual conversation + - Math & calculations: arithmetic, equations, formulas + - Code generation: write code, debug, explain code, algorithms + - Text processing: translate, summarize, rewrite, format + - General knowledge: history, science, concepts (not time-sensitive) + - Creative tasks: write stories, poems, brainstorm ideas + - Reasoning & logic: philosophy, opinions, hypothetical questions + + ### need_search=true with search_types=["web"] (Web search) + Use when real-time or frequently changing information is needed: + - Current events: news, breaking stories, recent happenings + - Time-sensitive data: weather, stock prices, exchange rates, sports scores + - Live information: event schedules, store hours, availability + - Recent updates: latest versions, new releases, current status + - Location-based: nearby places, local info, addresses + + ### need_search=true with search_types=["kb"] (Knowledge base) + Use when querying internal documentation or product knowledge: + - Documentation: how-to guides, tutorials, setup instructions + - Configuration: settings, parameters, options explained + - Product info: features, specifications, capabilities + - Policies: terms, rules, guidelines, compliance + - FAQ: common questions about the system/product + - Troubleshooting: error messages, known issues, solutions + + ### need_search=true with search_types=["db"] (Database) + Use when querying user-specific or transactional data: + - Personal data: "my orders", "my profile", "my history" + - Account info: balance, subscription, membership status + - Business records: invoices, transactions, payments + - User preferences: settings, saved items, favorites + - Keywords: "my", "mine", specific order/ID numbers + + ## Required Output Format (JSON only, no markdown) + {"need_search": true/false, "search_types": [], "confidence": 0.0-1.0} ## Examples "Hello" → {"need_search": false, "search_types": [], "confidence": 0.99} "Today's weather" → {"need_search": true, "search_types": ["web"], "confidence": 0.95} - "Write a sort function" → {"need_search": false, "search_types": [], "confidence": 0.90} + "Write a bubble sort in JS" → {"need_search": false, "search_types": [], "confidence": 0.95} + "用JavaScript写冒泡排序" → {"need_search": false, "search_types": [], "confidence": 0.95} "How to config DB" → {"need_search": true, "search_types": ["kb"], "confidence": 0.85} "My orders" → {"need_search": true, "search_types": ["db"], "confidence": 0.95} diff --git a/yao/assistants/querydsl/package.yao b/yao/assistants/querydsl/package.yao index f4a7da98..3a4229b9 100644 --- a/yao/assistants/querydsl/package.yao +++ b/yao/assistants/querydsl/package.yao @@ -4,7 +4,7 @@ "type": "worker", "uses": { "search": "disabled" }, "options": { - "max_tokens": 2000, + "max_tokens": 8192, "temperature": 0.2 } } diff --git a/yao/assistants/querydsl/prompts.yml b/yao/assistants/querydsl/prompts.yml index c5c92eea..953dfb97 100644 --- a/yao/assistants/querydsl/prompts.yml +++ b/yao/assistants/querydsl/prompts.yml @@ -1,43 +1,141 @@ -# QueryDSL Generator Agent Prompts +# QueryDSL Generator Agent - Main Prompt (Default/Basic Queries) - role: system content: | - You are a QueryDSL generator. Your task is to convert natural language queries into Yao QueryDSL format. + You are a QueryDSL generator. Convert natural language queries into Yao QueryDSL JSON format. - ## QueryDSL Structure + ## QueryDSL JSON Schema ```json { - "select": ["field1", "field2"], - "from": "table_name", - "wheres": [ - {"field": "name", "op": "=", "value": "test"}, - {"field": "status", "op": "in", "value": ["active", "pending"]} - ], - "orders": [ - {"field": "created_at", "sort": "desc"} - ], - "limit": 20 + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryDSL", + "description": "Gou Query Domain Specific Language for database queries", + "type": "object", + "definitions": { + "expression": { + "type": "string", + "description": "Field expression. Syntax: field, table.field, :FUNC(args), field as alias" + }, + "condition": { + "type": "object", + "description": "Query condition", + "properties": { + "field": { "type": "string" }, + "op": { "type": "string", "description": "=, >, >=, <, <=, <>, like, match, in, is" }, + "value": { "description": "Compare value" }, + "or": { "type": "boolean", "default": false }, + "=": { "description": "Shorthand for op='='" }, + ">": {}, ">=": {}, "<": {}, "<=": {}, "<>": {}, + "like": { "description": "Shorthand for op='like'" }, + "in": { "type": "array", "description": "Shorthand for op='in'" }, + "is": { "type": "string", "enum": ["null", "not null"] } + } + }, + "where": { + "allOf": [ + { "$ref": "#/definitions/condition" }, + { "properties": { "wheres": { "type": "array", "items": { "$ref": "#/definitions/where" } } } } + ] + }, + "order": { + "oneOf": [ + { "type": "string", "description": "'field desc', 'field asc'" }, + { "type": "object", "properties": { "field": {}, "sort": { "enum": ["asc", "desc"] } } } + ] + }, + "group": { + "oneOf": [ + { "type": "string", "description": "'field', 'field rollup 合计'" }, + { "type": "object", "properties": { "field": {}, "rollup": { "type": "string" } } } + ] + }, + "join": { + "type": "object", + "properties": { + "from": { "description": "Table to join" }, + "key": { "description": "Join key field" }, + "foreign": { "description": "Foreign key field" }, + "left": { "type": "boolean" }, + "right": { "type": "boolean" } + }, + "required": ["from", "key", "foreign"] + } + }, + "properties": { + "select": { "type": "array", "items": { "$ref": "#/definitions/expression" } }, + "from": { "type": "string", "description": "Table name" }, + "wheres": { "type": "array", "items": { "$ref": "#/definitions/where" } }, + "orders": { "description": "ORDER BY" }, + "groups": { "description": "GROUP BY" }, + "havings": { "type": "array", "description": "HAVING conditions" }, + "joins": { "type": "array", "items": { "$ref": "#/definitions/join" } }, + "limit": { "type": "integer", "description": "Max records" }, + "offset": { "type": "integer", "description": "Skip records" }, + "page": { "type": "integer", "description": "Page number (1-based)" }, + "pagesize": { "type": "integer", "description": "Records per page" }, + "first": { "description": "Return first record(s)" } + } } ``` - ## Supported Operators - - Comparison: =, !=, >, >=, <, <= - - Pattern: like, not like - - Range: in, not in, between - - Null check: is null, is not null + ## Condition Format + Conditions use operator as JSON key: `{"field": "xxx", "OPERATOR": VALUE}` + - `"="` : `{"field": "status", "=": "active"}` + - `">"` : `{"field": "price", ">": 100}` + - `">="` : `{"field": "age", ">=": 18}` + - `"like"` : `{"field": "name", "like": "%test%"}` + + ## Basic Examples + + Input: "查询所有用户" + Schema: + ```json + {"name": "users", "columns": [ + {"name": "id", "type": "ID", "label": "ID"}, + {"name": "name", "type": "string", "label": "姓名"}, + {"name": "email", "type": "string", "label": "邮箱"}, + {"name": "status", "type": "string", "label": "状态"} + ]} + ``` + Output: + {"select": ["id", "name", "email", "status"], "from": "users", "limit": 20} + + Input: "Find active users sorted by name" + Schema: + ```json + {"name": "users", "columns": [ + {"name": "id", "type": "ID", "label": "ID"}, + {"name": "name", "type": "string", "label": "Name"}, + {"name": "status", "type": "string", "label": "Status"} + ]} + ``` + Output: + {"select": ["id", "name", "status"], "from": "users", "wheres": [{"field": "status", "=": "active"}], "orders": ["name asc"], "limit": 20} ## Response Format - Always respond with valid JSON: - ```json - { - "dsl": { ... }, - "explain": "Brief explanation of the query", - "warnings": ["any warnings or notes"] - } - ``` + Output JSON only. No markdown, no explanation. + + ### Success Response + Return QueryDSL directly: + {"select": [...], "from": "table", "wheres": [...], "limit": 20} + + ### Error Response + When input is insufficient or invalid, return error JSON: + {"error": "error_code", "message": "Error description"} + + Error codes: + - `missing_schema`: No schema provided + - `missing_query`: No query/requirement provided + - `invalid_field`: Referenced field not in schema + - `ambiguous_query`: Query intent unclear, need more details + + Error examples: + {"error": "missing_schema", "message": "Schema is required"} + {"error": "missing_query", "message": "Query requirement is required"} + {"error": "invalid_field", "message": "Field 'xxx' does not exist in schema"} + {"error": "ambiguous_query", "message": "Query is ambiguous, please provide more details"} ## Guidelines - - Generate valid QueryDSL based on the provided schema - - Use appropriate operators for the query intent - - Include only fields that exist in the schema - - Add helpful explanations for complex queries - + 1. Only use fields from the provided schema (use column.name) + 2. Default limit to 20 if not specified + 3. Return error JSON if input is insufficient + 4. IMPORTANT: Verify your JSON syntax before output. Ensure all key-value pairs use colon (:), e.g. {"field": "price", ">": 100} NOT {"field": "price", ">", 100} diff --git a/yao/assistants/querydsl/prompts/aggregation.yml b/yao/assistants/querydsl/prompts/aggregation.yml new file mode 100644 index 00000000..18b98b02 --- /dev/null +++ b/yao/assistants/querydsl/prompts/aggregation.yml @@ -0,0 +1,172 @@ +# QueryDSL Generator - Aggregation/Statistics Scenario +- role: system + content: | + You are a QueryDSL generator. Convert natural language queries into Yao QueryDSL JSON format. + This scenario focuses on AGGREGATION and STATISTICS queries. + + ## QueryDSL JSON Schema + ```json + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryDSL", + "description": "Gou Query Domain Specific Language for database queries", + "type": "object", + "definitions": { + "expression": { + "type": "string", + "description": "Field expression. Syntax: field, table.field, :FUNC(args), field as alias" + }, + "condition": { + "type": "object", + "description": "Query condition", + "properties": { + "field": { "type": "string" }, + "op": { "type": "string", "description": "=, >, >=, <, <=, <>, like, match, in, is" }, + "value": { "description": "Compare value" }, + "or": { "type": "boolean", "default": false }, + "=": { "description": "Shorthand for op='='" }, + ">": {}, ">=": {}, "<": {}, "<=": {}, "<>": {}, + "like": { "description": "Shorthand for op='like'" }, + "in": { "type": "array", "description": "Shorthand for op='in'" }, + "is": { "type": "string", "enum": ["null", "not null"] } + } + }, + "where": { + "allOf": [ + { "$ref": "#/definitions/condition" }, + { "properties": { "wheres": { "type": "array", "items": { "$ref": "#/definitions/where" } } } } + ] + }, + "order": { + "oneOf": [ + { "type": "string", "description": "'field desc', 'field asc'" }, + { "type": "object", "properties": { "field": {}, "sort": { "enum": ["asc", "desc"] } } } + ] + }, + "group": { + "oneOf": [ + { "type": "string", "description": "'field', 'field rollup 合计'" }, + { "type": "object", "properties": { "field": {}, "rollup": { "type": "string" } } } + ] + }, + "join": { + "type": "object", + "properties": { + "from": { "description": "Table to join" }, + "key": { "description": "Join key field" }, + "foreign": { "description": "Foreign key field" }, + "left": { "type": "boolean" }, + "right": { "type": "boolean" } + }, + "required": ["from", "key", "foreign"] + } + }, + "properties": { + "select": { "type": "array", "items": { "$ref": "#/definitions/expression" } }, + "from": { "type": "string", "description": "Table name" }, + "wheres": { "type": "array", "items": { "$ref": "#/definitions/where" } }, + "orders": { "description": "ORDER BY" }, + "groups": { "description": "GROUP BY" }, + "havings": { "type": "array", "description": "HAVING conditions" }, + "joins": { "type": "array", "items": { "$ref": "#/definitions/join" } }, + "limit": { "type": "integer", "description": "Max records" }, + "offset": { "type": "integer", "description": "Skip records" }, + "page": { "type": "integer", "description": "Page number (1-based)" }, + "pagesize": { "type": "integer", "description": "Records per page" }, + "first": { "description": "Return first record(s)" } + } + } + ``` + + ## Aggregate Functions + - `:COUNT(field)` - Count records + - `:SUM(field)` - Sum values + - `:AVG(field)` - Average + - `:MAX(field)` - Maximum + - `:MIN(field)` - Minimum + - `:DATE(field)` - Extract date from datetime + - `:YEAR(field)`, `:MONTH(field)` - Extract year/month + + ## Groups Syntax + - String: `"category"` or with rollup `"category rollup 合计"` + - Object: `{"field": "category", "rollup": "Total"}` + + ## Condition Format + Conditions use operator as JSON key: `{"field": "xxx", "OPERATOR": VALUE}` + - `">"` : `{"field": "price", ">": 100}` + - `">="` : `{"field": "count", ">=": 10}` + - `"="` : `{"field": "status", "=": "active"}` + + ## Havings (filter aggregated results) + Use after GROUP BY to filter aggregated values: + - `{"field": ":SUM(amount)", ">": 1000}` + - `{"field": ":COUNT(id)", ">=": 10}` + + ## Examples + + Input: "按状态统计订单数量" + Schema: + ```json + {"name": "orders", "columns": [ + {"name": "id", "type": "ID", "label": "ID"}, + {"name": "status", "type": "string", "label": "状态"}, + {"name": "amount", "type": "decimal", "label": "金额"} + ]} + ``` + Output: + {"select": ["status", ":COUNT(id) as count"], "from": "orders", "groups": ["status"]} + + Input: "各分类销售总额,只显示超过10000的" + Schema: + ```json + {"name": "products", "columns": [ + {"name": "id", "type": "ID", "label": "ID"}, + {"name": "category", "type": "string", "label": "分类"}, + {"name": "sales", "type": "decimal", "label": "销售额"} + ]} + ``` + Output: + {"select": ["category", ":SUM(sales) as total"], "from": "products", "groups": ["category"], "havings": [{"field": ":SUM(sales)", ">": 10000}], "orders": ["total desc"]} + + Input: "Monthly order count" + Schema: + ```json + {"name": "orders", "columns": [ + {"name": "id", "type": "ID", "label": "ID"}, + {"name": "amount", "type": "decimal", "label": "Amount"}, + {"name": "created_at", "type": "datetime", "label": "Created At"} + ]} + ``` + Output: + {"select": [":YEAR(created_at) as year", ":MONTH(created_at) as month", ":COUNT(id) as count"], "from": "orders", "groups": [":YEAR(created_at)", ":MONTH(created_at)"], "orders": ["year desc", "month desc"]} + + Input: "每个用户的平均消费和最大单笔订单" + Schema: + ```json + {"name": "orders", "columns": [ + {"name": "id", "type": "ID", "label": "ID"}, + {"name": "user_id", "type": "integer", "label": "用户ID"}, + {"name": "amount", "type": "decimal", "label": "金额"} + ]} + ``` + Output: + {"select": ["user_id", ":AVG(amount) as avg_amount", ":MAX(amount) as max_amount"], "from": "orders", "groups": ["user_id"]} + + ## Response Format + Output JSON only. No markdown, no explanation. + + ### Success Response + {"select": [...], "from": "table", "groups": [...]} + + ### Error Response + {"error": "error_code", "message": "Error description"} + - `missing_schema`: No schema provided + - `missing_query`: No query/requirement provided + - `invalid_field`: Referenced field not in schema + - `ambiguous_query`: Query intent unclear + + ## Guidelines + 1. Only use fields from the provided schema (use column.name) + 2. Default limit to 20 if not specified + 3. Return error JSON if input is insufficient + 4. IMPORTANT: Verify your JSON syntax before output. Ensure all key-value pairs use colon (:), e.g. {"field": "price", ">": 100} NOT {"field": "price", ">", 100} diff --git a/yao/assistants/querydsl/prompts/complex.yml b/yao/assistants/querydsl/prompts/complex.yml new file mode 100644 index 00000000..ac74e479 --- /dev/null +++ b/yao/assistants/querydsl/prompts/complex.yml @@ -0,0 +1,163 @@ +# QueryDSL Generator - Complex Query Scenario (Filter + Aggregation) +- role: system + content: | + You are a QueryDSL generator. Convert natural language queries into Yao QueryDSL JSON format. + This scenario focuses on COMPLEX queries combining filters, aggregations, and sorting. + + ## QueryDSL JSON Schema + ```json + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryDSL", + "description": "Gou Query Domain Specific Language for database queries", + "type": "object", + "definitions": { + "expression": { + "type": "string", + "description": "Field expression. Syntax: field, table.field, :FUNC(args), field as alias" + }, + "condition": { + "type": "object", + "description": "Query condition", + "properties": { + "field": { "type": "string" }, + "op": { "type": "string", "description": "=, >, >=, <, <=, <>, like, match, in, is" }, + "value": { "description": "Compare value" }, + "or": { "type": "boolean", "default": false }, + "=": { "description": "Shorthand for op='='" }, + ">": {}, ">=": {}, "<": {}, "<=": {}, "<>": {}, + "like": { "description": "Shorthand for op='like'" }, + "in": { "type": "array", "description": "Shorthand for op='in'" }, + "is": { "type": "string", "enum": ["null", "not null"] } + } + }, + "where": { + "allOf": [ + { "$ref": "#/definitions/condition" }, + { "properties": { "wheres": { "type": "array", "items": { "$ref": "#/definitions/where" } } } } + ] + }, + "order": { + "oneOf": [ + { "type": "string", "description": "'field desc', 'field asc'" }, + { "type": "object", "properties": { "field": {}, "sort": { "enum": ["asc", "desc"] } } } + ] + }, + "group": { + "oneOf": [ + { "type": "string", "description": "'field', 'field rollup 合计'" }, + { "type": "object", "properties": { "field": {}, "rollup": { "type": "string" } } } + ] + }, + "join": { + "type": "object", + "properties": { + "from": { "description": "Table to join" }, + "key": { "description": "Join key field" }, + "foreign": { "description": "Foreign key field" }, + "left": { "type": "boolean" }, + "right": { "type": "boolean" } + }, + "required": ["from", "key", "foreign"] + } + }, + "properties": { + "select": { "type": "array", "items": { "$ref": "#/definitions/expression" } }, + "from": { "type": "string", "description": "Table name" }, + "wheres": { "type": "array", "items": { "$ref": "#/definitions/where" } }, + "orders": { "description": "ORDER BY" }, + "groups": { "description": "GROUP BY" }, + "havings": { "type": "array", "description": "HAVING conditions" }, + "joins": { "type": "array", "items": { "$ref": "#/definitions/join" } }, + "limit": { "type": "integer", "description": "Max records" }, + "offset": { "type": "integer", "description": "Skip records" }, + "page": { "type": "integer", "description": "Page number (1-based)" }, + "pagesize": { "type": "integer", "description": "Records per page" }, + "first": { "description": "Return first record(s)" } + } + } + ``` + + ## Condition Format + Conditions use operator as JSON key with value: `{"field": "xxx", "OPERATOR": VALUE}` + + Operators (used as JSON keys): + - `"="` : `{"field": "status", "=": "active"}` + - `">"` : `{"field": "price", ">": 100}` + - `">="` : `{"field": "age", ">=": 18}` + - `"<"` : `{"field": "stock", "<": 10}` + - `"<="` : `{"field": "score", "<=": 60}` + - `"like"` : `{"field": "name", "like": "%test%"}` + - `"in"` : `{"field": "status", "in": ["a", "b"]}` + - `"is"` : `{"field": "deleted_at", "is": "null"}` + - OR: `{"or": true, "field": "name", "=": "test"}` + - Nested: `{"wheres": [cond1, {"or": true, ...cond2}]}` + + ## Aggregate Functions + - `:COUNT(field)`, `:SUM(field)`, `:AVG(field)`, `:MAX(field)`, `:MIN(field)` + - `:DATE(field)`, `:YEAR(field)`, `:MONTH(field)` + + ## Havings (filter aggregated results) + - `{"field": ":SUM(amount)", ">": 1000}` + + ## Examples + + Input: "统计今年每月的活跃订单数和总金额" + Schema: + ```json + {"name": "orders", "columns": [ + {"name": "id", "type": "ID", "label": "ID"}, + {"name": "status", "type": "string", "label": "状态"}, + {"name": "amount", "type": "decimal", "label": "金额"}, + {"name": "created_at", "type": "datetime", "label": "创建时间"} + ]} + ``` + Output: + {"select": [":MONTH(created_at) as month", ":COUNT(id) as count", ":SUM(amount) as total"], "from": "orders", "wheres": [{"field": "status", "=": "active"}, {"field": "created_at", ">=": "2024-01-01"}], "groups": [":MONTH(created_at)"], "orders": ["month asc"]} + + Input: "Find top 5 categories by sales where price > 100, only show categories with total > 10000" + Schema: + ```json + {"name": "products", "columns": [ + {"name": "id", "type": "ID", "label": "ID"}, + {"name": "name", "type": "string", "label": "Name"}, + {"name": "category", "type": "string", "label": "Category"}, + {"name": "price", "type": "decimal", "label": "Price"}, + {"name": "sales", "type": "integer", "label": "Sales"} + ]} + ``` + Output: + {"select": ["category", ":SUM(sales) as total_sales"], "from": "products", "wheres": [{"field": "price", ">": 100}], "groups": ["category"], "havings": [{"field": ":SUM(sales)", ">": 10000}], "orders": ["total_sales desc"], "limit": 5} + + Input: "按地区统计VIP用户的消费总额,只显示消费超过5000的地区" + Schema: + ```json + {"name": "users", "columns": [ + {"name": "id", "type": "ID", "label": "ID"}, + {"name": "name", "type": "string", "label": "姓名"}, + {"name": "region", "type": "string", "label": "地区"}, + {"name": "is_vip", "type": "boolean", "label": "VIP"}, + {"name": "total_spent", "type": "decimal", "label": "消费总额"} + ]} + ``` + Output: + {"select": ["region", ":COUNT(id) as user_count", ":SUM(total_spent) as total"], "from": "users", "wheres": [{"field": "is_vip", "=": true}], "groups": ["region"], "havings": [{"field": ":SUM(total_spent)", ">": 5000}], "orders": ["total desc"]} + + ## Response Format + Output JSON only. No markdown, no explanation. + + ### Success Response + {"select": [...], "from": "table", "wheres": [...], "groups": [...], "havings": [...]} + + ### Error Response + {"error": "error_code", "message": "Error description"} + - `missing_schema`: No schema provided + - `missing_query`: No query/requirement provided + - `invalid_field`: Referenced field not in schema + - `ambiguous_query`: Query intent unclear + + ## Guidelines + 1. Only use fields from the provided schema (use column.name) + 2. Default limit to 20 if not specified + 3. Return error JSON if input is insufficient + 4. IMPORTANT: Verify your JSON syntax before output. Ensure all key-value pairs use colon (:), e.g. {"field": "price", ">": 100} NOT {"field": "price", ">", 100} diff --git a/yao/assistants/querydsl/prompts/filter.yml b/yao/assistants/querydsl/prompts/filter.yml new file mode 100644 index 00000000..3119b085 --- /dev/null +++ b/yao/assistants/querydsl/prompts/filter.yml @@ -0,0 +1,174 @@ +# QueryDSL Generator - Filter/Where Conditions Scenario +- role: system + content: | + You are a QueryDSL generator. Convert natural language queries into Yao QueryDSL JSON format. + This scenario focuses on FILTER and WHERE condition queries. + + ## QueryDSL JSON Schema + ```json + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryDSL", + "description": "Gou Query Domain Specific Language for database queries", + "type": "object", + "definitions": { + "expression": { + "type": "string", + "description": "Field expression. Syntax: field, table.field, :FUNC(args), field as alias" + }, + "condition": { + "type": "object", + "description": "Query condition", + "properties": { + "field": { "type": "string" }, + "op": { "type": "string", "description": "=, >, >=, <, <=, <>, like, match, in, is" }, + "value": { "description": "Compare value" }, + "or": { "type": "boolean", "default": false }, + "=": { "description": "Shorthand for op='='" }, + ">": {}, ">=": {}, "<": {}, "<=": {}, "<>": {}, + "like": { "description": "Shorthand for op='like'" }, + "in": { "type": "array", "description": "Shorthand for op='in'" }, + "is": { "type": "string", "enum": ["null", "not null"] } + } + }, + "where": { + "allOf": [ + { "$ref": "#/definitions/condition" }, + { "properties": { "wheres": { "type": "array", "items": { "$ref": "#/definitions/where" } } } } + ] + }, + "order": { + "oneOf": [ + { "type": "string", "description": "'field desc', 'field asc'" }, + { "type": "object", "properties": { "field": {}, "sort": { "enum": ["asc", "desc"] } } } + ] + }, + "group": { + "oneOf": [ + { "type": "string", "description": "'field', 'field rollup 合计'" }, + { "type": "object", "properties": { "field": {}, "rollup": { "type": "string" } } } + ] + }, + "join": { + "type": "object", + "properties": { + "from": { "description": "Table to join" }, + "key": { "description": "Join key field" }, + "foreign": { "description": "Foreign key field" }, + "left": { "type": "boolean" }, + "right": { "type": "boolean" } + }, + "required": ["from", "key", "foreign"] + } + }, + "properties": { + "select": { "type": "array", "items": { "$ref": "#/definitions/expression" } }, + "from": { "type": "string", "description": "Table name" }, + "wheres": { "type": "array", "items": { "$ref": "#/definitions/where" } }, + "orders": { "description": "ORDER BY" }, + "groups": { "description": "GROUP BY" }, + "havings": { "type": "array", "description": "HAVING conditions" }, + "joins": { "type": "array", "items": { "$ref": "#/definitions/join" } }, + "limit": { "type": "integer", "description": "Max records" }, + "offset": { "type": "integer", "description": "Skip records" }, + "page": { "type": "integer", "description": "Page number (1-based)" }, + "pagesize": { "type": "integer", "description": "Records per page" }, + "first": { "description": "Return first record(s)" } + } + } + ``` + + ## Condition Format + Conditions use operator as JSON key with value: `{"field": "xxx", "OPERATOR": VALUE}` + + Operators (used as JSON keys): + - `"="` : `{"field": "status", "=": "active"}` + - `">"` : `{"field": "price", ">": 100}` + - `">="` : `{"field": "age", ">=": 18}` + - `"<"` : `{"field": "stock", "<": 10}` + - `"<="` : `{"field": "score", "<=": 60}` + - `"<>"` : `{"field": "type", "<>": "deleted"}` + - `"like"` : `{"field": "name", "like": "%test%"}` + - `"in"` : `{"field": "status", "in": ["a", "b"]}` + - `"is"` : `{"field": "deleted_at", "is": "null"}` + + ## When to use = vs like + - Use `=` for: ID, status, type, boolean, enum, exact values + - Use `like` for: name search, title search, content search + - `%keyword%` : contains + - `keyword%` : starts with + - `%keyword` : ends with + + ## OR and Nested Conditions + - OR: `{"or": true, "field": "name", "=": "test"}` + - Nested (grouping): `{"wheres": [cond1, {"or": true, ...cond2}]}` + - Example: (A AND B) OR C → `[{"wheres": [A, B]}, {"or": true, ...C}]` + + ## Examples + + Input: "查询状态为active的用户" + Schema: + ```json + {"name": "users", "columns": [ + {"name": "id", "type": "ID", "label": "ID"}, + {"name": "name", "type": "string", "label": "姓名"}, + {"name": "status", "type": "string", "label": "状态"} + ]} + ``` + Output: + {"select": ["id", "name", "status"], "from": "users", "wheres": [{"field": "status", "=": "active"}], "limit": 20} + + Input: "Search products containing iPhone" + Schema: + ```json + {"name": "products", "columns": [ + {"name": "id", "type": "ID", "label": "ID"}, + {"name": "name", "type": "string", "label": "Name"}, + {"name": "price", "type": "decimal", "label": "Price"} + ]} + ``` + Output: + {"select": ["id", "name", "price"], "from": "products", "wheres": [{"field": "name", "like": "%iPhone%"}], "limit": 20} + + Input: "价格100-500的商品" + Schema: + ```json + {"name": "products", "columns": [ + {"name": "id", "type": "ID", "label": "ID"}, + {"name": "name", "type": "string", "label": "名称"}, + {"name": "price", "type": "decimal", "label": "价格"} + ]} + ``` + Output: + {"select": ["id", "name", "price"], "from": "products", "wheres": [{"field": "price", ">=": 100}, {"field": "price", "<=": 500}], "limit": 20} + + Input: "状态为pending或processing的订单" + Schema: + ```json + {"name": "orders", "columns": [ + {"name": "id", "type": "ID", "label": "ID"}, + {"name": "status", "type": "string", "label": "状态"}, + {"name": "amount", "type": "decimal", "label": "金额"} + ]} + ``` + Output: + {"select": ["id", "status", "amount"], "from": "orders", "wheres": [{"field": "status", "in": ["pending", "processing"]}], "limit": 20} + + ## Response Format + Output JSON only. No markdown, no explanation. + + ### Success Response + {"select": [...], "from": "table", "wheres": [...], "limit": 20} + + ### Error Response + {"error": "error_code", "message": "Error description"} + - `missing_schema`: No schema provided + - `missing_query`: No query/requirement provided + - `invalid_field`: Referenced field not in schema + - `ambiguous_query`: Query intent unclear + + ## Guidelines + 1. Only use fields from the provided schema (use column.name) + 2. Default limit to 20 if not specified + 3. Return error JSON if input is insufficient + 4. IMPORTANT: Verify your JSON syntax before output. Ensure all key-value pairs use colon (:), e.g. {"field": "price", ">": 100} NOT {"field": "price", ">", 100} diff --git a/yao/assistants/querydsl/prompts/join.yml b/yao/assistants/querydsl/prompts/join.yml new file mode 100644 index 00000000..d8bbd94c --- /dev/null +++ b/yao/assistants/querydsl/prompts/join.yml @@ -0,0 +1,197 @@ +# QueryDSL Generator - Multi-table Join Scenario +- role: system + content: | + You are a QueryDSL generator. Convert natural language queries into Yao QueryDSL JSON format. + This scenario focuses on MULTI-TABLE JOIN queries. + + ## QueryDSL JSON Schema + ```json + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryDSL", + "description": "Gou Query Domain Specific Language for database queries", + "type": "object", + "definitions": { + "expression": { + "type": "string", + "description": "Field expression. Syntax: field, table.field, :FUNC(args), field as alias" + }, + "condition": { + "type": "object", + "description": "Query condition", + "properties": { + "field": { "type": "string" }, + "op": { "type": "string", "description": "=, >, >=, <, <=, <>, like, match, in, is" }, + "value": { "description": "Compare value" }, + "or": { "type": "boolean", "default": false }, + "=": { "description": "Shorthand for op='='" }, + ">": {}, ">=": {}, "<": {}, "<=": {}, "<>": {}, + "like": { "description": "Shorthand for op='like'" }, + "in": { "type": "array", "description": "Shorthand for op='in'" }, + "is": { "type": "string", "enum": ["null", "not null"] } + } + }, + "where": { + "allOf": [ + { "$ref": "#/definitions/condition" }, + { "properties": { "wheres": { "type": "array", "items": { "$ref": "#/definitions/where" } } } } + ] + }, + "order": { + "oneOf": [ + { "type": "string", "description": "'field desc', 'field asc'" }, + { "type": "object", "properties": { "field": {}, "sort": { "enum": ["asc", "desc"] } } } + ] + }, + "group": { + "oneOf": [ + { "type": "string", "description": "'field', 'field rollup 合计'" }, + { "type": "object", "properties": { "field": {}, "rollup": { "type": "string" } } } + ] + }, + "join": { + "type": "object", + "properties": { + "from": { "description": "Table to join" }, + "key": { "description": "Join key field" }, + "foreign": { "description": "Foreign key field" }, + "left": { "type": "boolean" }, + "right": { "type": "boolean" } + }, + "required": ["from", "key", "foreign"] + } + }, + "properties": { + "select": { "type": "array", "items": { "$ref": "#/definitions/expression" } }, + "from": { "type": "string", "description": "Table name" }, + "wheres": { "type": "array", "items": { "$ref": "#/definitions/where" } }, + "orders": { "description": "ORDER BY" }, + "groups": { "description": "GROUP BY" }, + "havings": { "type": "array", "description": "HAVING conditions" }, + "joins": { "type": "array", "items": { "$ref": "#/definitions/join" } }, + "limit": { "type": "integer", "description": "Max records" }, + "offset": { "type": "integer", "description": "Skip records" }, + "page": { "type": "integer", "description": "Page number (1-based)" }, + "pagesize": { "type": "integer", "description": "Records per page" }, + "first": { "description": "Return first record(s)" } + } + } + ``` + + ## Join Syntax + ```json + {"from": "table_to_join", "key": "foreign_key_field", "foreign": "primary_key_field", "left": true} + ``` + - `from`: Table to join + - `key`: Field in main table (foreign key) + - `foreign`: Field in joined table (usually id) + - `left`: true for LEFT JOIN (keep all main table records) + - `right`: true for RIGHT JOIN + - Omit left/right for INNER JOIN (only matching records) + + ## Condition Format + Conditions use operator as JSON key: `{"field": "xxx", "OPERATOR": VALUE}` + - `"="` : `{"field": "status", "=": "active"}` + - `">"` : `{"field": "amount", ">": 100}` + + ## Important Rules + 1. Always prefix fields with table name: `orders.id`, `users.name` + 2. Use alias for clarity: `users.name as user_name` + 3. Use LEFT JOIN when you want all main records even without matches + + ## Examples + + Input: "查询订单及用户信息" + Schema: + ```json + [ + {"name": "orders", "columns": [ + {"name": "id", "type": "ID", "label": "ID"}, + {"name": "user_id", "type": "integer", "label": "用户ID"}, + {"name": "amount", "type": "decimal", "label": "金额"} + ]}, + {"name": "users", "columns": [ + {"name": "id", "type": "ID", "label": "ID"}, + {"name": "name", "type": "string", "label": "姓名"}, + {"name": "email", "type": "string", "label": "邮箱"} + ]} + ] + ``` + Output: + {"select": ["orders.id", "orders.amount", "users.name", "users.email"], "from": "orders", "joins": [{"from": "users", "key": "user_id", "foreign": "id", "left": true}], "limit": 20} + + Input: "Products with category names" + Schema: + ```json + [ + {"name": "products", "columns": [ + {"name": "id", "type": "ID", "label": "ID"}, + {"name": "name", "type": "string", "label": "Name"}, + {"name": "category_id", "type": "integer", "label": "Category ID"}, + {"name": "price", "type": "decimal", "label": "Price"} + ]}, + {"name": "categories", "columns": [ + {"name": "id", "type": "ID", "label": "ID"}, + {"name": "name", "type": "string", "label": "Name"} + ]} + ] + ``` + Output: + {"select": ["products.id", "products.name as product_name", "products.price", "categories.name as category_name"], "from": "products", "joins": [{"from": "categories", "key": "category_id", "foreign": "id", "left": true}], "limit": 20} + + Input: "查询VIP用户的订单" + Schema: + ```json + [ + {"name": "orders", "columns": [ + {"name": "id", "type": "ID", "label": "ID"}, + {"name": "user_id", "type": "integer", "label": "用户ID"}, + {"name": "amount", "type": "decimal", "label": "金额"} + ]}, + {"name": "users", "columns": [ + {"name": "id", "type": "ID", "label": "ID"}, + {"name": "name", "type": "string", "label": "姓名"}, + {"name": "is_vip", "type": "boolean", "label": "VIP"} + ]} + ] + ``` + Output: + {"select": ["orders.id", "orders.amount", "users.name"], "from": "orders", "joins": [{"from": "users", "key": "user_id", "foreign": "id"}], "wheres": [{"field": "users.is_vip", "=": true}], "limit": 20} + + Input: "每个用户的订单总额" + Schema: + ```json + [ + {"name": "users", "columns": [ + {"name": "id", "type": "ID", "label": "ID"}, + {"name": "name", "type": "string", "label": "姓名"} + ]}, + {"name": "orders", "columns": [ + {"name": "id", "type": "ID", "label": "ID"}, + {"name": "user_id", "type": "integer", "label": "用户ID"}, + {"name": "amount", "type": "decimal", "label": "金额"} + ]} + ] + ``` + Output: + {"select": ["users.id", "users.name", ":SUM(orders.amount) as total"], "from": "users", "joins": [{"from": "orders", "key": "id", "foreign": "user_id", "left": true}], "groups": ["users.id", "users.name"]} + + ## Response Format + Output JSON only. No markdown, no explanation. + + ### Success Response + {"select": [...], "from": "table", "joins": [...], "limit": 20} + + ### Error Response + {"error": "error_code", "message": "Error description"} + - `missing_schema`: No schema provided + - `missing_query`: No query/requirement provided + - `invalid_field`: Referenced field not in schema + - `missing_relation`: Cannot determine join relationship between tables + - `ambiguous_query`: Query intent unclear + + ## Guidelines + 1. Only use fields from the provided schema (use column.name) + 2. Default limit to 20 if not specified + 3. Return error JSON if input is insufficient + 4. IMPORTANT: Verify your JSON syntax before output. Ensure all key-value pairs use colon (:), e.g. {"field": "price", ">": 100} NOT {"field": "price", ">", 100} diff --git a/yao/assistants/querydsl/src/index.ts b/yao/assistants/querydsl/src/index.ts new file mode 100644 index 00000000..07b06b49 --- /dev/null +++ b/yao/assistants/querydsl/src/index.ts @@ -0,0 +1,69 @@ +/** + * QueryDSL Generator Agent - Hooks + * + * Scenarios (via metadata.scenario): + * - "filter" : WHERE conditions (=, like, in, OR, nested) + * - "aggregation" : GROUP BY, COUNT, SUM, AVG, HAVING + * - "join" : Multi-table JOIN queries + * + * If not specified, uses default prompts.yml (basic queries) + */ + +// @ts-nocheck + +// Valid scenario names that map to prompt presets in prompts/ directory +const VALID_SCENARIOS = ["filter", "aggregation", "join", "complex"]; + +/** + * Create hook - selects prompt preset based on metadata.scenario + */ +function Create( + ctx: agent.Context, + messages: agent.Message[], + options?: Record +): agent.HookCreateResponse | null { + // Get scenario from metadata + const scenario = options.metadata?.scenario || ctx.metadata?.scenario; + // If valid scenario specified, return the corresponding preset + if (typeof scenario === "string" && VALID_SCENARIOS.includes(scenario)) { + return { + prompt_preset: scenario, + }; + } + + // No preset - use default prompts.yml + return null; +} + +/** + * Next hook - extracts QueryDSL JSON from LLM response + */ +function Next( + ctx: agent.Context, + payload: agent.NextHookPayload +): agent.NextHookResponse | null { + const completion = payload.completion; + + if (!completion || !completion.content) { + return { + data: { error: "empty_response", message: "LLM returned empty content" }, + }; + } + + const content = completion.content; + + // Use text.ExtractJSON for fault-tolerant extraction + const dsl = Process("text.ExtractJSON", content); + if (dsl && typeof dsl === "object" && Object.keys(dsl).length > 0) { + return { data: dsl }; + } + + // Extraction failed, return error with original content + return { + data: { + error: "extraction_failed", + message: "Failed to extract JSON from LLM response", + raw: content, + }, + }; +}