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.43 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 p}from"./chunk-DZIEWBQ3.js";import{createAnthropic as i}from"@ai-sdk/anthropic";import{generateText as m,streamText as c}from"ai";var d=["claude-opus-4-20250514","claude-sonnet-4-20250514","claude-3-7-sonnet-20250219","claude-3-5-sonnet-latest","claude-3-5-sonnet-20241022","claude-3-5-sonnet-20240620","claude-3-5-haiku-latest","claude-3-5-haiku-20241022","claude-3-opus-latest","claude-3-opus-20240229","claude-3-sonnet-20240229","claude-3-haiku-20240307"],h=d.map(e=>({name:e,displayName:e})),g={name:"anthropic",displayName:"\u{1F7E3} Anthropic (Claude)",models:h},x=async(e,o)=>{try{let t=e.providerSettings,a=t?.apiKey||e.apiKey;if(!a)throw new Error("API key is required for Anthropic");let r=t?.baseURL||"https://api.anthropic.com",n=i({apiKey:a,baseURL:r}),s=c({model:n(e.model),prompt:o,temperature:e.temperature||.7,maxOutputTokens:e.maxTokens||2048});return{textStream:s.textStream,fullResponse:s.text}}catch(t){throw new Error(`Error calling Anthropic streaming API: ${t instanceof Error?t.message:String(t)}`)}},A={name:"anthropic",displayName:"\u{1F7E0} Anthropic (Claude)",async streamChat(e,o,t={}){let r=(e.providerSettings||{}).apiKey||e.apiKey;if(!r)throw new Error("API key is required for Anthropic");let n=i({apiKey:r});return c({model:n(e.model),messages:o,temperature:e.temperature||t.temperature||.7,maxOutputTokens:e.maxTokens||t.maxTokens||2048}).textStream}},f=async e=>{let o=Date.now();try{let t=e.credentials.providerSettings,a=i({apiKey:e.credentials.apiKey,baseURL:t?.baseURL}),r=await m({model:a(e.credentials.model),system:e.systemPrompt,prompt:e.userPrompt}),n=Date.now()-o;return{command:p(r.text),generationTime:n}}catch(t){throw new Error(`Anthropic exec generation failed: ${t}`)}};export{h as a,g as b,x as c,A as d,f 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-23CD3UYQ.js.map