Compare commits
1 Commits
gemini/iss
...
gemini/pas
| Author | SHA1 | Date | |
|---|---|---|---|
| 5dd8622539 |
@@ -115,7 +115,7 @@ display:
|
||||
tool_progress_command: false
|
||||
tool_progress: all
|
||||
privacy:
|
||||
redact_pii: true
|
||||
redact_pii: false
|
||||
tts:
|
||||
provider: edge
|
||||
edge:
|
||||
|
||||
50
tasks.py
50
tasks.py
@@ -226,32 +226,6 @@ def hermes_local(prompt, model=None, caller_tag=None, toolsets=None):
|
||||
return None
|
||||
return result.get("response")
|
||||
|
||||
PII_SCRUBBER_SYSTEM_PROMPT = (
|
||||
"You are a PII (Personally Identifiable Information) redaction middleware.\n"
|
||||
"Your ONLY task is to identify and replace PII with generic placeholders.\n"
|
||||
"Replace names with [NAME], email addresses with [EMAIL], phone numbers with [PHONE], and physical addresses with [ADDRESS].\n"
|
||||
"Do not change any other part of the text. Do not add any commentary.\n"
|
||||
"If no PII is found, return the input text exactly as it is."
|
||||
)
|
||||
|
||||
|
||||
@huey.task()
|
||||
def pii_scrubber(text):
|
||||
"""Redact PII from text using gemma2:2b."""
|
||||
result = run_hermes_local(
|
||||
prompt=text,
|
||||
model="gemma2:2b",
|
||||
caller_tag="pii-scrubber",
|
||||
system_prompt=PII_SCRUBBER_SYSTEM_PROMPT,
|
||||
disable_all_tools=True,
|
||||
skip_context_files=True,
|
||||
skip_memory=True,
|
||||
max_iterations=1,
|
||||
)
|
||||
if not result:
|
||||
return text
|
||||
return result.get("response", text)
|
||||
|
||||
|
||||
ARCHIVE_EPHEMERAL_SYSTEM_PROMPT = (
|
||||
"You are running a private archive-processing microtask for Timmy.\n"
|
||||
@@ -2152,3 +2126,27 @@ def cross_review_prs():
|
||||
continue
|
||||
|
||||
return {"reviews": len(results), "details": results}
|
||||
|
||||
def get_model_for_task(task_class, agent_name=None):
|
||||
"""Implement the Fallback Portfolio doctrine (docs/fallback-portfolios.md).
|
||||
|
||||
Reads fallback-portfolios.yaml and returns the primary model for the given task class.
|
||||
If primary fails, the agent should call this again with an incremented 'attempt' (not implemented here).
|
||||
"""
|
||||
import yaml
|
||||
portfolio_path = Path(__file__).parent / "fallback-portfolios.yaml"
|
||||
if not portfolio_path.exists():
|
||||
return "gemini-1.5-flash" # Default fallback
|
||||
|
||||
with open(portfolio_path, "r") as f:
|
||||
portfolios = yaml.safe_load(f)
|
||||
|
||||
# 1. Check agent-specific portfolio
|
||||
if agent_name and agent_name in portfolios.get("agents", {}):
|
||||
return portfolios["agents"][agent_name]["primary"]["model"]
|
||||
|
||||
# 2. Check task-class portfolio
|
||||
if task_class in portfolios.get("role_classes", {}):
|
||||
return portfolios["role_classes"][task_class]["primary"]["model"]
|
||||
|
||||
return "gemini-1.5-flash"
|
||||
|
||||
Reference in New Issue
Block a user