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