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.28 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 m}from"./chunk-DZIEWBQ3.js";import{createCerebras as i}from"@ai-sdk/cerebras";import{generateText as c,streamText as p}from"ai";var d=["llama3.1-8b","llama3.1-70b","llama3.3-70b"],b=d.map(e=>({name:e,displayName:e})),x={name:"cerebras",displayName:"\u{1F9E0} Cerebras",models:b},g=async(e,a)=>{try{let r=e.providerSettings,t=r?.apiKey||e.apiKey;if(!t)throw new Error("API key is required for Cerebras");let s=r?.baseURL||"https://api.cerebras.ai/v1",o=i({apiKey:t,baseURL:s}),n=p({model:o(e.model),prompt:a,temperature:e.temperature||.7,maxOutputTokens:e.maxTokens||2048});return{textStream:n.textStream,fullResponse:n.text}}catch(r){throw new Error(`Error calling Cerebras streaming API: ${r instanceof Error?r.message:String(r)}`)}},h={name:"cerebras",displayName:"\u{1F9E0} Cerebras",async streamChat(e,a,r={}){let t=e.providerSettings||{},s=t.apiKey||e.apiKey;if(!s)throw new Error("API key is required for Cerebras");let o=i({apiKey:s,baseURL:t.baseURL||"https://api.cerebras.ai/v1"});return p({model:o(e.model),messages:a,temperature:e.temperature||r.temperature||.7,maxOutputTokens:e.maxTokens||r.maxTokens||2048}).textStream}},f=async e=>{let a=Date.now();try{let r=e.credentials.providerSettings,t=r?.apiKey||e.credentials.apiKey;if(!t)throw new Error("API key is required for Cerebras");let s=i({apiKey:t,baseURL:r?.baseURL||"https://api.cerebras.ai/v1"}),o=await c({model:s(e.credentials.model),system:e.systemPrompt,prompt:e.userPrompt}),n=Date.now()-a;return{command:m(o.text),generationTime:n}}catch(r){throw new Error(`Cerebras exec generation failed: ${r}`)}};export{d as a,b,x as c,g as d,h as e,f};
/* 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-PSQR4KXO.js.map