rawi
Version:
Rawi (راوي) is the developer-friendly AI CLI that brings the power of 11 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
JavaScript
/* Rawi (راوي) is the developer-friendly AI CLI that brings the power of 11 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. */
import{a as g}from"./chunk-DZIEWBQ3.js";import{createGoogleGenerativeAI as n}from"@ai-sdk/google";import{generateText as l,streamText as m}from"ai";var p=["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","gemini-2.5-flash","gemini-2.5-flash-lite","gemini-2.5-pro-exp-03-25","gemini-2.5-flash-preview-04-17","gemini-exp-1206","gemma-3-12b-it","gemma-3-27b-it"],d=p.map(e=>({name:e,displayName:e})),y={name:"google",displayName:"\u{1F534} Google (Gemini)",models:d},x=async(e,r)=>{try{let o=e.providerSettings,i=o?.apiKey||e.apiKey;if(!i)throw new Error("API key is required for Google");let t=o?.baseURL||"https://generativelanguage.googleapis.com/v1beta",s=n({apiKey:i,baseURL:t}),a=m({model:s(e.model),prompt:r,temperature:e.temperature||.7,maxOutputTokens:e.maxTokens||2048});return{textStream:a.textStream,fullResponse:a.text}}catch(o){throw new Error(`Error calling Google AI streaming API: ${o instanceof Error?o.message:String(o)}`)}},G={name:"google",displayName:"\u{1F534} Google (Gemini)",async streamChat(e,r,o={}){let t=(e.providerSettings||{}).apiKey||e.apiKey;if(!t)throw new Error("API key is required for Google");let s=n({apiKey:t});return m({model:s(e.model),messages:r,temperature:e.temperature||o.temperature||.7,maxOutputTokens:e.maxTokens||o.maxTokens||2048}).textStream}},u=async e=>{let r=Date.now();try{let o=e.credentials.providerSettings,i=n({apiKey:e.credentials.apiKey,baseURL:o?.baseURL}),t=await l({model:i(e.credentials.model),system:e.systemPrompt,prompt:e.userPrompt}),s=Date.now()-r;return{command:g(t.text),generationTime:s}}catch(o){throw new Error(`Google exec generation failed: ${o}`)}};export{d as a,y as b,x as c,G as d,u as e};
/* Rawi (راوي) is the developer-friendly AI CLI that brings the power of 11 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-WXJU5KQM.js.map