Add FTS lookup for seeded Civitai Krea2 prompt examples.
Index Assistent/civitai-examples.jsonl without embeddings and expose AssistentLookupExamples plus ask:examples hop for remix references. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -421,6 +421,30 @@ public partial class SwarmAssistentExtension
|
||||
+ "omit ask:inventory unless you need a different query.\n```json\n"
|
||||
+ rows.ToString(Newtonsoft.Json.Formatting.None) + "\n```";
|
||||
}
|
||||
if (tool == "ask_examples")
|
||||
{
|
||||
string q = patch?["example_query"]?.ToString()?.Trim()
|
||||
?? patch?["memory_query"]?.ToString()?.Trim()
|
||||
?? "";
|
||||
string rating = patch?["example_rating"]?.ToString()?.Trim();
|
||||
string sig = "ask_examples:" + q.ToLowerInvariant() + ":" + (rating ?? "");
|
||||
if (!hopDone.Add(sig))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(q))
|
||||
{
|
||||
return
|
||||
"ask:examples needs example_query (tags / short scene). "
|
||||
+ "Retry with \"ask\":[\"examples\"], \"example_query\":\"redhead stockings cinematic\".";
|
||||
}
|
||||
int lim = Config.LoadAssistant(pid)["examples_hop_limit"]?.Value<int?>() ?? 5;
|
||||
JArray examples = Memory?.LookupExamples(q, lim, rating) ?? [];
|
||||
return
|
||||
"ask:examples — Civitai Krea2 prompt references (FTS, no embeddings). "
|
||||
+ "These are EXAMPLES to remix, not copy 1:1. Prefer craft over pasting.\n```json\n"
|
||||
+ examples.ToString(Newtonsoft.Json.Formatting.None) + "\n```";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user