rawi
Version:
Rawi (راوي) is the developer-friendly AI CLI that brings the power of 12 major AI providers directly to your terminal. With seamless shell integration, persistent conversations, and 200+ specialized prompt templates, Rawi transforms your command line into
4 lines • 2.38 kB
JavaScript
;Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/* Rawi (راوي) is the developer-friendly AI CLI that brings the power of 12 major AI providers directly to your terminal. With seamless shell integration, persistent conversations, and 200+ specialized prompt templates, Rawi transforms your command line into an intelligent development workspace. */
var _xai = require('@ai-sdk/xai');var _ai = require('ai');var g=["grok-3","grok-3-latest","grok-3-fast","grok-3-fast-latest","grok-3-mini","grok-3-mini-latest","grok-3-mini-fast","grok-3-mini-fast-latest","grok-2-vision-1212","grok-2-vision","grok-2-vision-latest","grok-2-image-1212","grok-2-image","grok-2-image-latest","grok-2-1212","grok-2","grok-2-latest","grok-vision-beta","grok-beta"],p= exports.a =g.map(e=>({name:e,displayName:e})),x= exports.b ={name:"xai",displayName:"\u{1F916} xAI (Grok)",models:p},l= exports.c =async(e,s)=>{try{let o=e.providerSettings,t=_optionalChain([o, 'optionalAccess', _ => _.apiKey])||e.apiKey;if(!t)throw new Error("API key is required for xAI");let i=_optionalChain([o, 'optionalAccess', _2 => _2.baseURL])||"https://api.x.ai/v1",a=_xai.createXai.call(void 0, {apiKey:t,baseURL:i}),r=_ai.streamText.call(void 0, {model:a(e.model),prompt:s,temperature:e.temperature||.7,maxTokens:e.maxTokens||2048});return{textStream:r.textStream,fullResponse:r.text}}catch(o){throw new Error(`Error calling xAI streaming API: ${o instanceof Error?o.message:String(o)}`)}};exports.a = p; exports.b = x; exports.c = l;
/* Rawi (راوي) is the developer-friendly AI CLI that brings the power of 12 major AI providers directly to your terminal. With seamless shell integration, persistent conversations, and 200+ specialized prompt templates, Rawi transforms your command line into an intelligent development workspace. */
//# sourceMappingURL=chunk-DQXNPI2P.cjs.map