feat: Add plugin configuration options to installer
- Max gems per turn (2/5/10/custom) - Minimum similarity score (0.5/0.7/0.9/custom) - Plugin config written to plugin-config.json - Summary shows plugin settings
This commit is contained in:
49
install.py
49
install.py
@@ -132,6 +132,21 @@ def install_full():
|
|||||||
}, "1", True),
|
}, "1", True),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# Plugin config prompts (full mode only)
|
||||||
|
plugin_prompts = [
|
||||||
|
("max_recall_results", "Max gems per turn (injection)", {
|
||||||
|
"1": ("2", "conservative, less context bloat"),
|
||||||
|
"2": ("5", "balanced, recommended"),
|
||||||
|
"3": ("10", "more context, higher recall")
|
||||||
|
}, "2", True),
|
||||||
|
|
||||||
|
("min_recall_score", "Minimum similarity score", {
|
||||||
|
"1": ("0.5", "loose matching, more gems"),
|
||||||
|
"2": ("0.7", "balanced, recommended"),
|
||||||
|
"3": ("0.9", "strict matching, only strong matches")
|
||||||
|
}, "2", True),
|
||||||
|
]
|
||||||
|
|
||||||
idx = 0
|
idx = 0
|
||||||
while idx < len(prompts):
|
while idx < len(prompts):
|
||||||
key, question, options, default_key, allow_custom = prompts[idx]
|
key, question, options, default_key, allow_custom = prompts[idx]
|
||||||
@@ -151,6 +166,23 @@ def install_full():
|
|||||||
config[key] = value
|
config[key] = value
|
||||||
idx += 1
|
idx += 1
|
||||||
|
|
||||||
|
# Process plugin prompts
|
||||||
|
idx = 0
|
||||||
|
while idx < len(plugin_prompts):
|
||||||
|
key, question, options, default_key, allow_custom = plugin_prompts[idx]
|
||||||
|
value, go_back = prompt_inline(question, options, default_key, allow_custom)
|
||||||
|
|
||||||
|
if go_back:
|
||||||
|
if idx > 0:
|
||||||
|
idx -= 1
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
# Go back to main prompts
|
||||||
|
return False
|
||||||
|
|
||||||
|
config[key] = value
|
||||||
|
idx += 1
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def install_simple():
|
def install_simple():
|
||||||
@@ -222,6 +254,19 @@ def write_config():
|
|||||||
with open(config_path, 'w') as f:
|
with open(config_path, 'w') as f:
|
||||||
json.dump(output, f, indent=2)
|
json.dump(output, f, indent=2)
|
||||||
|
|
||||||
|
# Write plugin config for full mode
|
||||||
|
if config["mode"] == "full":
|
||||||
|
plugin_config = {
|
||||||
|
"collectionName": config["target_collection"],
|
||||||
|
"captureCollection": config["source_collection"],
|
||||||
|
"maxRecallResults": int(config.get("max_recall_results", 5)),
|
||||||
|
"minRecallScore": float(config.get("min_recall_score", 0.7)),
|
||||||
|
"qdrantUrl": config["qdrant_url"]
|
||||||
|
}
|
||||||
|
plugin_path = script_dir / "plugin-config.json"
|
||||||
|
with open(plugin_path, 'w') as f:
|
||||||
|
json.dump(plugin_config, f, indent=2)
|
||||||
|
|
||||||
return config_path
|
return config_path
|
||||||
|
|
||||||
def show_summary():
|
def show_summary():
|
||||||
@@ -241,8 +286,12 @@ def show_summary():
|
|||||||
print(f"Ollama URL: {config['ollama_url']}")
|
print(f"Ollama URL: {config['ollama_url']}")
|
||||||
print(f"Curator LLM: {config['curator_model']}")
|
print(f"Curator LLM: {config['curator_model']}")
|
||||||
print(f"Target collection: {config['target_collection']}")
|
print(f"Target collection: {config['target_collection']}")
|
||||||
|
print(f"\nPlugin settings:")
|
||||||
|
print(f" Max gems per turn: {config.get('max_recall_results', 5)}")
|
||||||
|
print(f" Min similarity score: {config.get('min_recall_score', 0.7)}")
|
||||||
else:
|
else:
|
||||||
print("Target collection: (none - simple mode)")
|
print("Target collection: (none - simple mode)")
|
||||||
|
print("Plugin injection: (disabled - simple mode)")
|
||||||
|
|
||||||
print("=" * 60)
|
print("=" * 60)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user