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.54 kB
"use strict";Object.defineProperty(exports, "__esModule", {value: true});/* 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. */ var _chunkBO5UW3VLcjs = require('./chunk-BO5UW3VL.cjs');var _chunkRYVLVSXYcjs = require('./chunk-RYVLVSXY.cjs');var _chunkYTPAJ6Q2cjs = require('./chunk-YTPAJ6Q2.cjs');var _ai = require('ai');var c=_chunkRYVLVSXYcjs.a,g= exports.a =c.map(e=>({name:e,displayName:e})),R= exports.b ={name:"ollama",displayName:"\u{1F7E2} Ollama",models:g},O= exports.c =async(e,r)=>{try{let t={};e.providerSettings&&"baseURL"in e.providerSettings&&(t.baseURL=e.providerSettings.baseURL);let a=_chunkBO5UW3VLcjs.a.call(void 0, Object.keys(t).length>0?t:void 0),o=_ai.streamText.call(void 0, {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= exports.d ={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),_ai.streamText.call(void 0, {model:_chunkBO5UW3VLcjs.b.call(void 0, e.model,a),messages:r,temperature:e.temperature||t.temperature||.7,maxOutputTokens:e.maxTokens||t.maxTokens||2048}).textStream}},h= exports.e =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=_chunkBO5UW3VLcjs.a.call(void 0, Object.keys(t).length>0?t:void 0),o=await _ai.generateText.call(void 0, {model:a(e.credentials.model),system:e.systemPrompt,prompt:e.userPrompt}),d=Date.now()-r;return{command:_chunkYTPAJ6Q2cjs.a.call(void 0, o.text),generationTime:d}}catch(t){throw new Error(`Ollama exec generation failed: ${t}`)}};exports.a = g; exports.b = R; exports.c = O; exports.d = f; exports.e = h; /* 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-GBWNCRXL.cjs.map