feat(ai): universal world AI engine supporting OpenAI, DeepSeek, Claude, OpenRouter, Mistral, Ollama, and custom endpoints

This commit is contained in:
Adam Eehan committed 2026-09-11 17:51:58 +05:30
1 parent b7ae6c9725
commit 2831b30ab7
4 files changed
+402 -103

No files matched your search

+14 -10
View File
@@ -163,21 +163,25 @@ let sum = nums.reduce(fn(acc, val) { return acc + val; }, 0); # 21
## 📦 Standard Library Modules
> 📚 **Detailed Documentation:** For complete syntax, parameters, and examples for all 14 built-in modules, visit the [**Modules Catalog (`modules/`)**](./modules/README.md).
### 🤖 Native AI Integration Engine (`ai`)
Directly integrate Generative AI (Google Gemini & Groq LLMs) natively in AiraLang:
### 🤖 Universal AI Integration Engine (`ai`)
Directly integrate Generative AI from ANY provider in the world natively in AiraLang (OpenAI, DeepSeek, Anthropic Claude, Google Gemini, Groq, OpenRouter, Mistral, Ollama, Perplexity, Cerebras, or custom servers):
```aira
import "ai";
# 1-line query to AI models
let answer = ai.ask("Explain cyber security defensive postures");
say answer;
# Set custom API keys or switch providers (auto-detects gsk_ for Groq, AIzaSy for Gemini)
# 1. Automatic Key Prefix Detection (Groq, OpenRouter, Claude, Cerebras, Gemini, etc.)
ai.set_key("gsk_YOUR_GROQ_KEY");
say ai.ask("Explain cyber security defensive postures");
# Summarize long text
let summary = ai.summarize("Long report text here...", 50);
say summary;
# 2. Explicit Provider Selection (DeepSeek, OpenAI, Mistral, etc.)
ai.set_provider("deepseek", "sk-YOUR_DEEPSEEK_KEY");
say ai.ask("Optimize this sorting algorithm");
# 3. 100% Offline Local AI with Ollama (Termux / PC)
ai.set_provider("ollama", model="llama3.2");
say ai.ask("Local offline AI query");
# 4. Custom Enterprise Server (vLLM, LM Studio, Localhost)
ai.set_endpoint("http://localhost:8000/v1/chat/completions", "token", "my-model");
```
### 💖 Cyber-Romance & Proposal Engine (`proposal`)