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:
@@ -240,6 +240,37 @@ public partial class SwarmAssistentExtension
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<JObject> AssistentLookupExamples(Session session, string query, int limit = 5, string rating = null)
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
if (Memory is null)
|
||||
{
|
||||
return new JObject { ["error"] = "memory not ready" };
|
||||
}
|
||||
query = (query ?? "").Trim();
|
||||
if (query.Length < 1)
|
||||
{
|
||||
return new JObject { ["error"] = "query required" };
|
||||
}
|
||||
try
|
||||
{
|
||||
JArray examples = Memory.LookupExamples(query, limit, rating);
|
||||
return new JObject
|
||||
{
|
||||
["success"] = true,
|
||||
["query"] = query,
|
||||
["rating"] = rating ?? "",
|
||||
["examples"] = examples,
|
||||
["indexed"] = Memory.ExampleCount(),
|
||||
["path"] = Memory.FindCivitaiExamplesJsonl() ?? "",
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new JObject { ["error"] = $"example lookup: {ex.Message}" };
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<JObject> AssistentClearMemory(Session session, string scope = null, string kind = null, string persona = null)
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
|
||||
Reference in New Issue
Block a user