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 • 4.32 kB
JavaScript
;Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } 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 _amazonbedrock = require('@ai-sdk/amazon-bedrock');var _ai = require('ai');var l=["amazon.titan-tg1-large","amazon.titan-text-express-v1","anthropic.claude-v2","anthropic.claude-v2:1","anthropic.claude-instant-v1","anthropic.claude-sonnet-4-20250514-v1:0","anthropic.claude-opus-4-20250514-v1:0","anthropic.claude-3-7-sonnet-20250219-v1:0","anthropic.claude-3-5-sonnet-20240620-v1:0","anthropic.claude-3-5-sonnet-20241022-v2:0","anthropic.claude-3-5-haiku-20241022-v1:0","anthropic.claude-3-sonnet-20240229-v1:0","anthropic.claude-3-haiku-20240307-v1:0","anthropic.claude-3-opus-20240229-v1:0","cohere.command-text-v14","cohere.command-light-text-v14","cohere.command-r-v1:0","cohere.command-r-plus-v1:0","meta.llama3-70b-instruct-v1:0","meta.llama3-8b-instruct-v1:0","meta.llama3-1-405b-instruct-v1:0","meta.llama3-1-70b-instruct-v1:0","meta.llama3-1-8b-instruct-v1:0","meta.llama3-2-11b-instruct-v1:0","meta.llama3-2-1b-instruct-v1:0","meta.llama3-2-3b-instruct-v1:0","meta.llama3-2-90b-instruct-v1:0","mistral.mistral-7b-instruct-v0:2","mistral.mixtral-8x7b-instruct-v0:1","mistral.mistral-large-2402-v1:0","mistral.mistral-small-2402-v1:0","amazon.titan-text-express-v1","amazon.titan-text-lite-v1"],p= exports.a =l.map(t=>({name:t,displayName:t})),k= exports.b ={name:"bedrock",displayName:"\u{1F7E0} Amazon Bedrock",models:p},h= exports.c =async(t,i)=>{try{let e=t.providerSettings,o=_optionalChain([e, 'optionalAccess', _ => _.region])||process.env.AWS_REGION||"us-east-1",a;if(_optionalChain([e, 'optionalAccess', _2 => _2.useProviderChain]))try{let{fromNodeProviderChain:r}=await Promise.resolve().then(() => _interopRequireWildcard(require("@aws-sdk/credential-providers")));a=_amazonbedrock.createAmazonBedrock.call(void 0, {region:o,credentialProvider:r()})}catch (e2){throw new Error("Failed to load AWS credential provider chain. Make sure you have installed @aws-sdk/credential-providers package: npm install @aws-sdk/credential-providers")}else{let r=_optionalChain([e, 'optionalAccess', _3 => _3.accessKeyId])||process.env.AWS_ACCESS_KEY_ID,n=_optionalChain([e, 'optionalAccess', _4 => _4.secretAccessKey])||process.env.AWS_SECRET_ACCESS_KEY,d=_optionalChain([e, 'optionalAccess', _5 => _5.sessionToken])||process.env.AWS_SESSION_TOKEN;if(!r||!n)throw new Error("AWS access key ID and secret access key are required for Amazon Bedrock");a=_amazonbedrock.createAmazonBedrock.call(void 0, {region:o,accessKeyId:r,secretAccessKey:n,sessionToken:d})}let s=_ai.streamText.call(void 0, {model:a(t.model),prompt:i,temperature:t.temperature||.7,maxTokens:t.maxTokens||2048});return{textStream:s.textStream,fullResponse:s.text}}catch(e){throw new Error(`Error calling Amazon Bedrock streaming API: ${e instanceof Error?e.message:String(e)}`)}};exports.a = p; exports.b = k; exports.c = h;
/* 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-YFAWY6KH.cjs.map