forked from Rockachopa/Timmy-time-dashboard
feat: add timmy interview command for structured agent initialization (#87)
This commit is contained in:
committed by
GitHub
parent
add3f7a07a
commit
ab014dc5c6
@@ -55,6 +55,43 @@ def status(
|
||||
timmy.print_response(TIMMY_STATUS_PROMPT, stream=False)
|
||||
|
||||
|
||||
@app.command()
|
||||
def interview(
|
||||
backend: Optional[str] = _BACKEND_OPTION,
|
||||
model_size: Optional[str] = _MODEL_SIZE_OPTION,
|
||||
):
|
||||
"""Initialize Timmy and run a structured interview.
|
||||
|
||||
Asks Timmy a series of questions about his identity, capabilities,
|
||||
values, and operation to verify he is working correctly.
|
||||
"""
|
||||
from timmy.interview import InterviewEntry, format_transcript, run_interview
|
||||
from timmy.session import chat
|
||||
|
||||
typer.echo("Initializing Timmy for interview...\n")
|
||||
|
||||
# Force agent creation by calling chat once with a warm-up prompt
|
||||
try:
|
||||
chat("Hello, Timmy. We're about to start your interview.", session_id="interview")
|
||||
except Exception as exc:
|
||||
typer.echo(f"Warning: Initialization issue — {exc}", err=True)
|
||||
|
||||
def _on_answer(entry: InterviewEntry) -> None:
|
||||
typer.echo(f"[{entry.category}]")
|
||||
typer.echo(f" Q: {entry.question}")
|
||||
typer.echo(f" A: {entry.answer}")
|
||||
typer.echo()
|
||||
|
||||
typer.echo("Starting interview...\n")
|
||||
transcript = run_interview(
|
||||
chat_fn=lambda msg: chat(msg, session_id="interview"),
|
||||
on_answer=_on_answer,
|
||||
)
|
||||
|
||||
# Print full transcript at the end
|
||||
typer.echo("\n" + format_transcript(transcript))
|
||||
|
||||
|
||||
@app.command()
|
||||
def up(
|
||||
dev: bool = typer.Option(False, "--dev", help="Enable hot-reload for development"),
|
||||
|
||||
Reference in New Issue
Block a user