Taskora Gemini Rules — Free Gemini Rules Template
    Neura MarketNeura Market/Gemini
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityDeepSeekDeepSeek
    CoPilotCoPilotStable DiffusionStable DiffusionMidjourneyMidjourney
    View All Directories
    OverviewRulesPromptsMCPsAgentsGamesBlogVideosGuidesCoursesCommunityGemsExtensionsTrending
    GeminiRulesTaskora Gemini Rules
    Back to Rules

    Taskora Gemini Rules

    kabilesh-c July 19, 2026
    0 copies 0 downloads
    Rule Content
    """Voice AI route — parses speech transcript into structured task data via Gemini."""
    
    import json
    import logging
    from datetime import date
    
    from fastapi import APIRouter, Depends, HTTPException, status
    from sqlalchemy.ext.asyncio import AsyncSession
    
    from app.api.deps import get_current_user
    from app.core.config import settings
    from app.db.database import get_db
    from app.db.models import User
    from app.schemas.task import VoiceParseRequest, VoiceParseResponse
    
    logger = logging.getLogger(__name__)
    
    router = APIRouter(prefix="/tasks", tags=["Voice AI"])
    
    SYSTEM_PROMPT = """You are a task parsing assistant. Extract task information from the user's speech.
    Return ONLY a valid JSON object with these exact keys:
      - title: string (required, concise task name, max 80 chars)
      - description: string or null (additional context from the speech)
      - priority: one of exactly "low", "medium", "high", "urgent"
      - due_date: ISO date string "YYYY-MM-DD" or null
    
    Priority inference rules:
      - "urgent", "ASAP", "immediately", "today" → "urgent"
      - "high priority", "important", "critical" → "high"
      - "low priority", "whenever", "someday" → "low"
      - default → "medium"
    
    Due date inference:
      - "today" → today's date
      - "tomorrow" → tomorrow's date
      - "next week" → 7 days from today
      - "by Friday" → next Friday's date
      - specific dates → parse them
      - no date mentioned → null
    
    Today's date for reference: {today}
    
    Return ONLY the JSON. No markdown, no explanation, no backticks."""
    
    
    @router.post(
        "/parse-voice",
        response_model=VoiceParseResponse,
        summary="Parse voice transcript into structured task data",
    )
    async def parse_voice_route(
        body: VoiceParseRequest,
        current_user: User = Depends(get_current_user),
        db: AsyncSession = Depends(get_db),
    ) -> VoiceParseResponse:
        """Use Groq to extract task fields from a voice transcript instantly."""
        if not settings.GROQ_API_KEY:
            raise HTTPException(
                status_code=status.HTTP_503_SERVICE_UNAVAILABLE,
                detail="Voice parsing unavailable — GROQ_API_KEY not configured in .env.",
            )
    
        try:
            import httpx
    
            today_str = date.today().isoformat()
            system = SYSTEM_PROMPT.format(today=today_str)
    
            logger.info("Starting Groq voice parse for transcript: '%s'", body.transcript)
    
            payload = {
                "model": "llama-3.1-8b-instant",
                "messages": [
                    {"role": "system", "content": system},
                    {"role": "user", "content": f"Extract task info from this speech: {body.transcript}"}
                ],
                "temperature": 0.1,
                "max_tokens": 256,
                "response_format": {"type": "json_object"}
            }
    
            async with httpx.AsyncClient() as client:
                response = await client.post(
                    "https://api.groq.com/openai/v1/chat/completions",
                    headers={
                        "Authorization": f"Bearer {settings.GROQ_API_KEY}",
                        "Content-Type": "application/json"
                    },
                    json=payload,
                    timeout=10.0
                )
                response.raise_for_status()
                data = response.json()
    
            raw = data["choices"][0]["message"]["content"]
            logger.info("Groq Analysis Response: %s", raw)
    
            parsed = json.loads(raw)
    
            return VoiceParseResponse(
                title=parsed.get("title", body.transcript[:80]),
                description=parsed.get("description"),
                priority=parsed.get("priority", "medium"),
                due_date=parsed.get("due_date"),
            )
    
        except json.JSONDecodeError as e:
            logger.error("Groq returned invalid JSON: %s", e)
            raise HTTPException(
                status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
                detail="Could not parse task from speech — AI returned invalid format.",
            )
        except httpx.HTTPStatusError as e:
            logger.error("Groq API HTTP error: %s (Status: %s)", e.response.text, e.response.status_code)
            raise HTTPException(
                status_code=status.HTTP_503_SERVICE_UNAVAILABLE,
                detail="Voice parsing failed: Groq API Error.",
            )
        except Exception as e:
            logger.error("Groq API error: %s", e)
            raise HTTPException(
                status_code=status.HTTP_503_SERVICE_UNAVAILABLE,
                detail=f"Voice parsing failed: {str(e)}",
            )
    

    Comments

    More Rules

    View all

    Sleepycat Seo Platform Gemini Rules

    A
    acovrp

    LITE IDE Gemini Rules

    H
    Heyz24

    Shadowtagai Monorepo V2 Gemini Rules

    S
    ShadowTag-v2

    WoKFlow Gemini Rules

    H
    howyongheng0313

    MetaPrompter Gemini Rules

    U
    ummerr

    Iilm Faculty Connect Gemini Rules

    R
    Rudrakshsachdev

    Stay up to date

    Get the latest Gemini prompts, rules, and resources delivered to your inbox weekly.

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for Gemini and more.

    Content Types

    • Rules
    • Prompts
    • MCPs
    • Agents
    • Guides

    Platforms

    • ChatGPT Directory
    • Claude Directory
    • Gemini Directory
    • Cursor Directory
    • Grok Directory
    • Perplexity Directory
    • DeepSeek Directory
    • CoPilot Directory
    • Stable Diffusion Directory
    • Midjourney Directory
    • All Directories

    Resources

    • Blog
    • Documentation
    • Help Center
    • Marketplace

    Legal

    • Privacy Policy
    • Terms of Service

    © 2026 Neura Market. All rights reserved.

    |

    Not affiliated with any AI platform vendors.

    Neura Market

    Custom AI Systems & Services

    Our team of experienced AI builders will help build custom AI systems, workflows, and solutions for your business.

    Request custom work

    Ready-made automations for this

    Workflows from the Neura Market marketplace related to this Gemini resource

    • Process Multiple Media Files in Telegram with Gemini AI & PostgreSQL Databasen8n · $24.99 · Related topic
    • Convert Telegram Messages to Professional LinkedIn Posts with Gemini AI & Approval Workflown8n · $24.99 · Related topic
    • Create Custom PDF Documents from Templates with Gemini & Google Driven8n · $24.99 · Related topic
    • Kubernetes RCA and Alerting Using Gemini, Loki, Prometheus, Slackn8n · $24.99 · Related topic
    Browse all workflows