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 2.55 kB
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/* 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. */ var _qwen = require('@ai-sdk-community/qwen');var _ai = require('ai');var m=["qwen2.5-14b-instruct-1m","qwen2.5-72b-instruct","qwen2.5-32b-instruct","qwen2.5-14b-instruct","qwen2.5-7b-instruct","qwen2-57b-a14b-instruct","qwen2.5-7b-instruct-1m","qwen-max","qwen-max-latest","qwen-max-2025-01-25","qwen-plus","qwen-plus-latest","qwen-plus-2025-01-25","qwen-turbo","qwen-turbo-latest","qwen-turbo-2024-11-01","qwen-vl-max","qwen-vl-plus","qwen2.5-vl-72b-instruct","qwen2.5-vl-7b-instruct","qwen2.5-vl-3b-instruct"],p= exports.a =m.map(e=>({name:e,displayName:e})),q= exports.b ={name:"qwen",displayName:"\u{1F7E1} Qwen (Alibaba Cloud)",models:p},u= exports.c =async(e,r)=>{try{let t=e.providerSettings,n=_optionalChain([t, 'optionalAccess', _ => _.apiKey])||e.apiKey;if(!n)throw new Error("API key is required for Qwen");let s=_optionalChain([t, 'optionalAccess', _2 => _2.baseURL])||"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",a=_qwen.createQwen.call(void 0, {apiKey:n,baseURL:s}),o=_ai.streamText.call(void 0, {model:a(e.model),prompt:r,temperature:e.temperature||.7,maxTokens:e.maxTokens||2048});return{textStream:o.textStream,fullResponse:o.text}}catch(t){throw new Error(`Error calling Qwen streaming API: ${t instanceof Error?t.message:String(t)}`)}};exports.a = p; exports.b = q; exports.c = u; /* 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-ADQVXX4K.cjs.map