Skip to main content

AI Features (Gemini)

The platform integrates Google's Gemini AI for ticket urgency analysis, text rewriting, and email parsing. These features help the team prioritize support tickets and improve communication quality.


Ticket Urgency Analysis

What It Does

When a support ticket arrives, the AI analyzes its content and provides:

  • Urgency Score (0–100) — How urgent is this issue?
  • Urgency Level — CRITICAL, HIGH, MEDIUM, or LOW
  • Summary — Brief description of the issue
  • Reasoning — Why it received this score
  • Timeline — Suggested response timeframe
  • Suggested Title — Improved ticket subject line

How It's Used

The osTicket system automatically sends new tickets to the Gemini endpoint. The urgency data is stored on the ticket and displayed to agents for prioritization.

Understanding Urgency Levels

LevelScoreWhat It MeansResponse Expected
🔴 CRITICAL75–100Production site down, data loss, security breachWithin 1 hour
🟠 HIGH50–74Major feature broken, significant impactSame business day
🟡 MEDIUM25–49Non-critical issue, limited impactWithin 2 business days
🟢 LOW0–24Enhancement request, minor cosmeticScheduled maintenance

Score Modifiers

The AI considers special factors:

FactorEffect
VIP client+10 points
Workaround available-15 points
Revenue impact mentioned+20–30 points
Multiple users affected+10–20 points
Security-related+30–40 points

Testing Urgency Analysis

From the Admin Dashboard

  1. Navigate to Suma Gemini → Test Tool
  2. Enter test ticket data:
    • Subject line
    • Body content
    • Client name
    • VIP flag
  3. Click Analyze
  4. View the full urgency response

Interpreting Results

Review the AI's reasoning to understand why it scored a ticket the way it did. If the scoring seems off:

  • Check if the ticket content is clear about the impact
  • VIP status adds 10 points regardless of content
  • Vague tickets tend to score MEDIUM by default

Text Rewriting

What It Does

Rewrites text content to be clearer, more professional, or follow specific guidelines.

Use Cases

  • Polishing ticket responses before sending to clients
  • Cleaning up technical notes for non-technical audiences
  • Reformatting documentation drafts

Using the Rewriter

  1. Navigate to the rewrite tool in the admin
  2. Paste the original text
  3. Optionally provide instructions (e.g., "Make more concise" or "Simplify for a non-technical reader")
  4. Click Rewrite
  5. Review and copy the improved text

Email Reply Parsing

What It Does

Extracts just the latest reply from a full email thread, stripping:

  • Quoted previous messages
  • Email signatures
  • Forwarding headers
  • Auto-generated disclaimers

Why It's Needed

Email clients format replies differently:

  • Gmail adds > prefixes to quoted text
  • Outlook uses From: ... Sent: ... separators
  • Mobile clients have inconsistent formatting
  • Corporate disclaimers bloat the content

The AI reliably isolates just the new content regardless of format.


Settings Overview

Accessing Settings

Navigate to WP Admin → Suma Gemini for all AI settings.

Available Settings

SettingDescriptionDefault
API KeyGoogle Gemini API key
Security KeyKey for external API access
Default ModelModel for general tasksgemini-2.5-flash
Urgency ModelModel for ticket analysisgemini-2.5-flash
Rate LimitMax requests per minute60
Cache TTLHow long to cache responses1 hour

Changing Models

If response quality needs adjustment:

  • gemini-2.5-pro — Slower but more capable for complex analysis
  • gemini-2.5-flash — Fast and good for most tasks (recommended)
  • Older models available as fallbacks

Clearing the Cache

AI responses are cached to avoid redundant API calls. Clear the cache when:

  • You've changed the AI model and want fresh results
  • A ticket was re-analyzed with new content
  • Testing with different prompts

How to Clear

  1. Navigate to Suma Gemini → Settings
  2. Click Clear Cache
  3. All cached urgency results and rewrites are purged
note

Clearing cache doesn't affect stored urgency scores on existing tickets. It only affects future analyses.


Rate Limiting

The system limits API calls to prevent excessive costs:

  • Default: 60 requests per 60 seconds
  • Applies per IP address
  • If rate limited, requests return a 429 error
  • Normal usage rarely hits this limit

When You Might Hit Rate Limits

  • Bulk re-analyzing many tickets simultaneously
  • Running load tests against the API
  • Multiple systems calling the endpoint concurrently

What to Do

Wait 60 seconds and try again. The limit resets automatically.


Troubleshooting

"AI analysis failed" on a Ticket

  1. Check that the Gemini API key is valid in settings
  2. Verify Google hasn't suspended the API key (quota exceeded)
  3. Check wp-content/debug.log for specific error messages
  4. The system retries 3 times with exponential backoff — if all fail, the error surfaces

Inconsistent Urgency Scores

AI scoring can vary slightly between identical requests due to model randomness. This is normal:

  • Scores may fluctuate ±5 points between identical analyses
  • The level (CRITICAL/HIGH/MEDIUM/LOW) should remain consistent
  • If wildly different, check that the model hasn't been changed

Slow Responses

  • Normal response time: 2–5 seconds
  • If consistently slow (>10s), check:
    • Network connectivity to Google's API
    • Whether the model is overloaded (try a different one)
    • Rate limiting may be causing queuing