UNPKG

rawi

Version:

Rawi (راوي) is the developer-friendly AI CLI that brings the power of 12 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 1.8 kB
/* Rawi (راوي) is the developer-friendly AI CLI that brings the power of 12 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{createAzure as i}from"@ai-sdk/azure";import{streamText as a}from"ai";var m=[],d={name:"azure",displayName:"\u{1F537} Azure OpenAI",models:m},g=async(e,t)=>{try{if(!e.apiKey)throw new Error("API key is required for Azure OpenAI");if(!e.providerSettings||!("resourceName"in e.providerSettings))throw new Error("Azure resource name is required");let r=e.providerSettings.resourceName,s="apiVersion"in e.providerSettings?e.providerSettings.apiVersion:"2024-10-01-preview",n=i({apiKey:e.apiKey,resourceName:r,apiVersion:s}),o=a({model:n(e.model),prompt:t,temperature:e.temperature||.7,maxTokens:e.maxTokens||2048});return{textStream:o.textStream,fullResponse:o.text}}catch(r){throw r instanceof Error&&(r.message.includes("not found")||r.message.includes("does not exist")||r.message.includes("deployment"))?new Error(`Error calling Azure OpenAI streaming API: Deployment "${e.model}" not found. Make sure you've correctly entered your deployment name (not the model name like "gpt-4"). Original error: ${r.message}`):new Error(`Error calling Azure OpenAI streaming API: ${r instanceof Error?r.message:String(r)}`)}};export{m as a,d as b,g as c}; /* Rawi (راوي) is the developer-friendly AI CLI that brings the power of 12 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-XKCX7BHW.js.map