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.02 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{f as r,g as n,h as o}from"./chunk-A65FQHKW.js";var l=class{validateCredentials(t){let i=[],e=[];if(t.provider||i.push("Provider is required"),t.model||i.push("Model is required"),t.apiKey){let s=this.validateApiKey(t.apiKey,t.provider);i.push(...s.errors),e.push(...s.warnings)}let a=this.validateSettings(t);return i.push(...a.errors),e.push(...a.warnings),{isValid:i.length===0,errors:i,warnings:e}}validateApiKey(t,i){let e=[],a=[];if(!t.trim())return e.push("API key cannot be empty"),{isValid:!1,errors:e,warnings:a};switch(o(t)||e.push(`Invalid API key format for provider: ${i}`),i){case"openai":t.startsWith("sk-")||a.push('OpenAI API keys typically start with "sk-"');break;case"anthropic":t.startsWith("sk-ant-")||a.push('Anthropic API keys typically start with "sk-ant-"');break;case"google":t.length<30&&a.push("Google API keys are typically longer than 30 characters");break}return{isValid:e.length===0,errors:e,warnings:a}}validateSettings(t){let i=[],e=[];return t.temperature!==void 0&&(r(t.temperature)||i.push("Temperature must be between 0 and 2")),t.maxTokens!==void 0&&(n(t.maxTokens)||i.push("Max tokens must be a positive integer")),t.language&&!["en","es","fr","de","it","pt","ru","ja","ko","zh"].includes(t.language)&&e.push(`Language "${t.language}" may not be fully supported`),{isValid:i.length===0,errors:i,warnings:e}}};export{l as a};
/* 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-TK3ACB5Q.js.map