Overview

Gammal Tech AI provides access to powerful language models through a simple SDK. No API keys to manage, no usage tracking to implement — just call the methods and build amazing features.

🔑

No API Keys

Included with your Gammal Tech plan

Fast Responses

Optimized for low latency

💬

Conversational

Maintains chat context

🎯

Customizable

System prompts & parameters

Quick Start

One-line AI
// Simple question/answer
const response = await GammalTech.ai.ask('What is the capital of France?');
console.log(response); // "The capital of France is Paris."

// Generate content
const description = await GammalTech.ai.ask('Write a product description for wireless earbuds');

// With conversation context (requires login)
const token = GammalTech.getToken();
const reply = await GammalTech.ai.chat(token, 'Tell me more about that');

Methods

GammalTech.ai.ask(message, options?) → Promise<string>

Single-turn AI completion. Perfect for one-off questions, content generation, and transformations. No conversation history maintained.

Parameter Type Description
message string The prompt or question to send to the AI
options.system string Optional system prompt to set AI behavior
options.maxTokens number Maximum response length (default: 1000)
Examples
// Simple question
const answer = await GammalTech.ai.ask('Explain quantum computing in simple terms');

// With system prompt
const poem = await GammalTech.ai.ask('Write about the ocean', {
    system: 'You are a poet who writes in haiku format.'
});

// Content transformation
const summary = await GammalTech.ai.ask(
    `Summarize this article in 3 bullet points: ${articleText}`
);

// Translation
const arabic = await GammalTech.ai.ask(
    `Translate to Arabic: ${englishText}`
);
GammalTech.ai.chat(token, message, options?) → Promise<string>

Multi-turn conversation with maintained context. The AI remembers previous messages in the session. Requires user authentication.

Parameter Type Description
token string User's auth token from GammalTech.getToken()
message string The user's message
options.system string System prompt (set once, persists in conversation)
options.reset boolean Clear conversation history and start fresh
Conversation example
const token = GammalTech.getToken();

// Start conversation with system prompt
let reply = await GammalTech.ai.chat(token, 'Hi! I need help planning a trip.', {
    system: 'You are a helpful travel assistant.'
});
console.log(reply); // "Hello! I'd love to help you plan..."

// Continue conversation (context maintained)
reply = await GammalTech.ai.chat(token, 'I want to visit Japan in spring.');
console.log(reply); // "Spring in Japan is beautiful! The cherry..."

// AI remembers context
reply = await GammalTech.ai.chat(token, 'What should I pack?');
console.log(reply); // "For your spring trip to Japan, I recommend..."

// Reset conversation
reply = await GammalTech.ai.chat(token, 'New topic!', { reset: true });

What Can You Build?

💬

Customer Support Bot

Answer FAQs, help users navigate your app, provide 24/7 support without human agents.

Build a Chatbot →

Content Generator

Generate product descriptions, blog posts, social media content, emails.

Content Generator →
🎯

Smart Personalization

Personalized recommendations, dynamic content, intelligent search.

Personalization →
🔄

Text Transformation

Summarization, translation, tone adjustment, format conversion.

Learn More →

System Prompts

System prompts define the AI's personality, knowledge, and behavior. They're powerful tools for customizing responses.

System prompt examples
// E-commerce assistant
const shopAssistant = {
    system: `You are a shopping assistant for TechStore.
    - Be friendly and helpful
    - Recommend products based on user needs
    - Always mention our 30-day return policy
    - Prices are in EGP`
};

await GammalTech.ai.ask('I need a laptop for video editing', shopAssistant);

// Code reviewer
const codeReviewer = {
    system: `You are a senior code reviewer.
    - Focus on security issues first
    - Suggest performance improvements
    - Be constructive, not critical
    - Provide code examples for fixes`
};

await GammalTech.ai.ask(`Review this code: ${userCode}`, codeReviewer);

// Language tutor
const arabicTutor = {
    system: `You are an Arabic language tutor.
    - Respond in both Arabic and English
    - Correct mistakes gently
    - Explain grammar rules when relevant
    - Use Modern Standard Arabic`
};

await GammalTech.ai.chat(token, 'How do I say "good morning"?', arabicTutor);
System Prompt Best Practices

• Be specific about the AI's role and personality
• Include any constraints or rules
• Mention the format you want responses in
• Keep it concise but comprehensive

Usage & Limits

💡 Fair Usage

AI usage is included with your Gammal Tech plan. There are fair usage limits to prevent abuse. For high-volume applications, contact us for enterprise plans.

Limit Value
Max input length 4,000 characters
Max output tokens 2,000 tokens (~1,500 words)
Conversation history Last 10 messages retained
Rate limit 60 requests/minute per user

Related Documentation

💬 Build a Chatbot — Complete chat UI implementation ✨ Content Generator — Generate and transform text 🎯 Smart Personalization — AI-powered recommendations
🤖

AI Prompt for Vibe Coding

AI Integration

Copy this prompt for help with AI integration:

I'm integrating Gammal Tech AI into my app. Methods: 1. GammalTech.ai.ask(message, options?) - Single-turn completion - No auth required - Options: { system, maxTokens } 2. GammalTech.ai.chat(token, message, options?) - Multi-turn conversation with context - Requires auth token - Options: { system, reset } System Prompt Example: ```javascript await GammalTech.ai.ask('Help me', { system: 'You are a helpful assistant for...' }); ``` Limits: - Input: 4,000 chars - Output: 2,000 tokens - History: 10 messages - Rate: 60 req/min Please help me: [DESCRIBE YOUR AI FEATURE]