UNPKG

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.13 kB
/* 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 s,b as l}from"./chunk-3HQ5HKAI.js";import{a as m}from"./chunk-WTN6X75T.js";import{a as n}from"./chunk-DZIEWBQ3.js";import{generateText as p,streamText as i}from"ai";var c=m,g=c.map(e=>({name:e,displayName:e})),R={name:"ollama",displayName:"\u{1F7E2} Ollama",models:g},O=async(e,r)=>{try{let t={};e.providerSettings&&"baseURL"in e.providerSettings&&(t.baseURL=e.providerSettings.baseURL);let a=s(Object.keys(t).length>0?t:void 0),o=i({model:a(e.model),prompt:r,temperature:e.temperature||.7,maxOutputTokens:e.maxTokens||2048});return{textStream:o.textStream,fullResponse:o.text}}catch(t){throw new Error(`Error calling Ollama streaming API: ${t instanceof Error?t.message:String(t)}`)}},f={name:"ollama",displayName:"\u{1F7E2} Ollama",async streamChat(e,r,t={}){let a={};return e.providerSettings&&"baseURL"in e.providerSettings&&(a.baseURL=e.providerSettings.baseURL),i({model:l(e.model,a),messages:r,temperature:e.temperature||t.temperature||.7,maxOutputTokens:e.maxTokens||t.maxTokens||2048}).textStream}},h=async e=>{let r=Date.now();try{let t={};e.credentials.providerSettings&&"baseURL"in e.credentials.providerSettings&&(t.baseURL=e.credentials.providerSettings.baseURL);let a=s(Object.keys(t).length>0?t:void 0),o=await p({model:a(e.credentials.model),system:e.systemPrompt,prompt:e.userPrompt}),d=Date.now()-r;return{command:n(o.text),generationTime:d}}catch(t){throw new Error(`Ollama exec generation failed: ${t}`)}};export{g as a,R as b,O as c,f as d,h 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-EIJWLKSV.js.map