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.18 kB
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class;/* 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 _chunk6UQXXL2Ocjs = require('./chunk-6UQXXL2O.cjs');var _provider = require('@ai-sdk/provider');var _providerutils = require('@ai-sdk/provider-utils');var _zod = require('zod');var a= (_class =class{#e;#d;__init() {this.specificationVersion="v2"}get provider(){return this.#e.provider}get maxEmbeddingsPerCall(){return _nullishCoalesce(this.#d.maxEmbeddingsPerCall, () => (2048))}get supportsParallelCalls(){return!1}constructor(n,e,s){;_class.prototype.__init.call(this);this.modelId=n,this.#d=e,this.#e=s}async doEmbed({abortSignal:n,values:e}){if(e.length>this.maxEmbeddingsPerCall)throw new (0, _provider.TooManyEmbeddingValuesForCallError)({maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,modelId:this.modelId,provider:this.provider,values:e});let{responseHeaders:s,value:t}=await _providerutils.postJsonToApi.call(void 0, {abortSignal:n,body:{input:e,model:this.modelId},failedResponseHandler:_chunk6UQXXL2Ocjs.a,fetch:this.#e.fetch,headers:this.#e.headers(),successfulResponseHandler:_providerutils.createJsonResponseHandler.call(void 0, g),url:`${this.#e.baseURL}/embed`}),r=t;return{embeddings:r.embeddings,response:{headers:s},usage:r.prompt_eval_count?{tokens:r.prompt_eval_count}:void 0}}}, _class),g=_zod.z.object({embeddings:_zod.z.array(_zod.z.array(_zod.z.number())),prompt_eval_count:_zod.z.number().nullable()});exports.a = a; /* 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-FBMPTSBO.cjs.map