// agent

My Idea Clarifier Chat Canvas

by [email protected] · Aug 18, 2026 Public

Choose how to run this agent

Local runs on your GPU. For usable speed it needs a WebGPU-capable browser — Chrome or Edge on a machine with a graphics card, or an Apple Silicon Mac. Without a supported GPU, pick OpenAI or Anthropic above instead.
Try it now

Requires an API key and an AgentOp account.

4 downloads
0 forks
0.0 rating

Description

Based on the Idea Clarifier Chat Canvas template.

Source Code

agent.py
async def process_user_query(query: str) -> str:
    """Process a rough user request into a clearer output.

    Args:
        query: The user's raw request, including selected mode and text.

    Returns:
        A refined and useful response.
    """
    system_prompt = globals().get("TEMPLATE_SYSTEM_PROMPT", "")
    if not system_prompt:
        system_prompt = (
            "You clarify messy user input. "
            "Read the request carefully. "
            "If the input is vague, still be helpful. "
            "Follow the selected mode if present. "
            "For clarify mode, produce a cleaner request. "
            "For summarize mode, produce a short summary with bullets. "
            "For rewrite mode, rewrite into polished prose. "
            "For plan mode, produce practical next steps. "
            "Be concise, structured, and useful."
        )
    result = await call_llm(query, system_prompt)
    return str(result)