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 1.76 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 o}from"./chunk-EQ3TMTCU.js";import{TooManyEmbeddingValuesForCallError as i}from"@ai-sdk/provider";import{createJsonResponseHandler as l,postJsonToApi as m}from"@ai-sdk/provider-utils";import{z as d}from"zod";var a=class{#e;#d;specificationVersion="v2";modelId;get provider(){return this.#e.provider}get maxEmbeddingsPerCall(){return this.#d.maxEmbeddingsPerCall??2048}get supportsParallelCalls(){return!1}constructor(n,e,s){this.modelId=n,this.#d=e,this.#e=s}async doEmbed({abortSignal:n,values:e}){if(e.length>this.maxEmbeddingsPerCall)throw new i({maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,modelId:this.modelId,provider:this.provider,values:e});let{responseHeaders:s,value:t}=await m({abortSignal:n,body:{input:e,model:this.modelId},failedResponseHandler:o,fetch:this.#e.fetch,headers:this.#e.headers(),successfulResponseHandler:l(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}}},g=d.object({embeddings:d.array(d.array(d.number())),prompt_eval_count:d.number().nullable()});export{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-77KIPQ6F.js.map