UNPKG

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.72 kB
"use strict";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 _google = require('@ai-sdk/google');var _ai = require('ai');var l=["gemini-1.5-flash","gemini-1.5-flash-latest","gemini-1.5-flash-001","gemini-1.5-flash-002","gemini-1.5-flash-8b","gemini-1.5-flash-8b-latest","gemini-1.5-flash-8b-001","gemini-1.5-pro","gemini-1.5-pro-latest","gemini-1.5-pro-001","gemini-1.5-pro-002","gemini-2.0-flash","gemini-2.0-flash-001","gemini-2.0-flash-live-001","gemini-2.0-flash-lite","gemini-2.0-pro-exp-02-05","gemini-2.0-flash-thinking-exp-01-21","gemini-2.0-flash-exp","gemini-2.5-pro-exp-03-25","gemini-2.5-pro-preview-05-06","gemini-2.5-flash-preview-04-17","gemini-exp-1206","gemma-3-27b-it","learnlm-1.5-pro-experimental"],m= exports.a =l.map(e=>({name:e,displayName:e})),d= exports.b ={name:"google",displayName:"\u{1F534} Google (Gemini)",models:m},h= exports.c =async(e,r)=>{try{let o=e.providerSettings,i=_optionalChain([o, 'optionalAccess', _ => _.apiKey])||e.apiKey;if(!i)throw new Error("API key is required for Google");let s=_optionalChain([o, 'optionalAccess', _2 => _2.baseURL])||"https://generativelanguage.googleapis.com/v1beta",g=_google.createGoogleGenerativeAI.call(void 0, {apiKey:i,baseURL:s}),t=_ai.streamText.call(void 0, {model:g(e.model),prompt:r,temperature:e.temperature||.7,maxTokens:e.maxTokens||2048});return{textStream:t.textStream,fullResponse:t.text}}catch(o){throw new Error(`Error calling Google AI streaming API: ${o instanceof Error?o.message:String(o)}`)}};exports.a = m; exports.b = d; exports.c = h; /* 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-5CRCR6CM.cjs.map