@camidevv/mid-ai 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +88 -0
- package/dist/chat.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/message.js +1 -0
- package/package.json +49 -0
- package/types/chat.d.ts +12 -0
- package/types/index.d.ts +2 -0
- package/types/types/message.d.ts +10 -0
package/README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# MID AI
|
|
2
|
+
|
|
3
|
+
MID AI is a project created from the need to have a tool that would allow me to have an artificial intelligence API for university projects, prototypes or personal small projects, but quickly, No registration, no need to associate my credit card and so on.
|
|
4
|
+
|
|
5
|
+
Descripción
|
|
6
|
+
-----------
|
|
7
|
+
MID AI es una biblioteca/paquete pensada para ofrecer una API de acceso a modelos de inteligencia artificial de forma rápida y práctica para proyectos académicos, prototipos y proyectos personales de pequeña escala. Su objetivo es minimizar la fricción: sin registros obligatorios, sin necesidad de asociar tarjetas de crédito para empezar a probar (modo básico).
|
|
8
|
+
|
|
9
|
+
Principales características
|
|
10
|
+
---------------------------
|
|
11
|
+
- Inicio rápido: puedes usar el paquete con una configuración mínima.
|
|
12
|
+
- Modo sin claves API: si solo necesitas hasta 15 peticiones por minuto puedes no proporcionar claves.
|
|
13
|
+
- Soporte para múltiples proveedores de modelos (ver lista abajo).
|
|
14
|
+
- Configuración por variables de entorno para añadir tus credenciales y aumentar límites.
|
|
15
|
+
- Diseño pensado para prototipos y uso académico/personal.
|
|
16
|
+
|
|
17
|
+
Instalación
|
|
18
|
+
----------
|
|
19
|
+
Instala desde npm:
|
|
20
|
+
|
|
21
|
+
- Pública:
|
|
22
|
+
- `npm install mid-ai`
|
|
23
|
+
- Desarrollo/local:
|
|
24
|
+
- `npm link` (si estás desarrollando localmente)
|
|
25
|
+
|
|
26
|
+
Uso rápido
|
|
27
|
+
----------
|
|
28
|
+
1. Importa el cliente desde el paquete (ejemplo genérico):
|
|
29
|
+
- `import { MidAI } from 'mid-ai'`
|
|
30
|
+
|
|
31
|
+
2. Llamada simple (modo sin claves, hasta 15 peticiones/minuto):
|
|
32
|
+
- Crea el cliente sin credenciales y haz peticiones básicas a los modelos disponibles en el modo gratuito.
|
|
33
|
+
|
|
34
|
+
Limitaciones y claves API
|
|
35
|
+
-------------------------
|
|
36
|
+
- Límite por defecto (sin proporcionar claves): 15 peticiones por minuto.
|
|
37
|
+
- Si tu caso de uso solo requiere esta tasa, no necesitas configurar ni proporcionar claves API.
|
|
38
|
+
- Si necesitas más capacidad y/o acceso a modelos adicionales, debes proporcionar claves API de los proveedores que quieras usar.
|
|
39
|
+
- Es altamente recomendable proporcionar tus propias claves/credenciales personales para cada proveedor porque:
|
|
40
|
+
- Te permiten acceder a mayores cuotas y a modelos adicionales.
|
|
41
|
+
- Evitan la dependencia de tokens compartidos o limitados por el paquete.
|
|
42
|
+
- Recomendación concreta: el `token personal de GitHub` (GitHub Personal Access Token) es uno de los que más modelos puede proporcionar al integrarse con ciertos gateways que usan credenciales de GitHub para desbloquear modelos. Si vas a añadir una sola credencial, esta suele ser la más útil.
|
|
43
|
+
- Google Gemini suele ofrecer muchas peticiones y modelos si se configura correctamente (consulta la documentación de Google para detalles sobre cuotas y permisos).
|
|
44
|
+
|
|
45
|
+
Configuración de proveedores
|
|
46
|
+
----------------------------
|
|
47
|
+
Puedes configurar proveedores mediante variables de entorno. Ejemplos de nombres de variables sugeridos (ajusta a tus necesidades o a la configuración interna del paquete):
|
|
48
|
+
|
|
49
|
+
- `MIDAI_GITHUB_TOKEN` — Token personal de GitHub (recomendado si quieres muchos modelos).
|
|
50
|
+
- `MIDAI_GEMINI_KEY` — Credenciales para Google Gemini (si corresponde).
|
|
51
|
+
- `CEREBRAS_API_KEY` — Credencial para Cerebras.
|
|
52
|
+
- `OPENROUTER_API_KEY` — Credencial para OpenRouter.
|
|
53
|
+
- `AISTUDIO_API_KEY` — Credencial para AI Studio (Google).
|
|
54
|
+
- `GROQ_API_KEY` — Credencial para Groq.
|
|
55
|
+
|
|
56
|
+
Manejar múltiples proveedores
|
|
57
|
+
-----------------------------
|
|
58
|
+
- El paquete intentará seleccionar el mejor proveedor disponible según la configuración y las claves provistas.
|
|
59
|
+
- Si no hay claves, se activará el modo limitado (15 rpm).
|
|
60
|
+
- Si has proporcionado varias claves, el paquete balanceará/seleccionará según disponibilidad y políticas internas (ver configuración avanzada en la documentación del paquete o en el código fuente).
|
|
61
|
+
|
|
62
|
+
Proveedores y enlaces
|
|
63
|
+
---------------------
|
|
64
|
+
A continuación algunos de los proveedores mencionados y sus páginas oficiales:
|
|
65
|
+
|
|
66
|
+
- Cerebras: https://www.cerebras.ai/
|
|
67
|
+
- OpenRouter: https://openrouter.ai/
|
|
68
|
+
- AI Studio (Google Gemini): https://aistudio.google.com/
|
|
69
|
+
- Groq: https://groq.com/
|
|
70
|
+
|
|
71
|
+
Buenas prácticas
|
|
72
|
+
----------------
|
|
73
|
+
- Para desarrollos locales y pruebas, usa el modo sin claves hasta 15 rpm para evitar exponer credenciales.
|
|
74
|
+
- Para integraciones serias y despliegues, añade credenciales personales por proveedor y revisa límites de cuota y facturación de cada servicio.
|
|
75
|
+
- Mantén tus tokens en variables de entorno seguras, no los incluyas en el código ni en repositorios públicos.
|
|
76
|
+
- Revisa las políticas de uso de cada proveedor (limites, términos y privacidad).
|
|
77
|
+
|
|
78
|
+
Licencia
|
|
79
|
+
--------
|
|
80
|
+
MIT — consulta el archivo `LICENSE` del repositorio para más detalles.
|
|
81
|
+
|
|
82
|
+
Contacto
|
|
83
|
+
--------
|
|
84
|
+
Para preguntas o mejoras sobre el paquete, abre un issue en el repositorio o contacta al mantenedor (información de contacto en el repositorio).
|
|
85
|
+
|
|
86
|
+
Notas finales
|
|
87
|
+
-------------
|
|
88
|
+
MID AI está pensado como una herramienta práctica para acelerar el desarrollo de proyectos pequeños/academicos. Si necesitas un uso en producción con alta disponibilidad y límites elevados, configura las claves de los proveedores adecuados y revisa sus condiciones de servicio.
|
package/dist/chat.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a0_0x38e5(_0x8206f0,_0x5ca5ce){_0x8206f0=_0x8206f0-0x19c;const _0xcd2535=a0_0x5738();let _0x14f84e=_0xcd2535[_0x8206f0];if(a0_0x38e5['BJBJNH']===undefined){var _0x3dc533=function(_0x1498d5){const _0x4c9aa8='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x45e84a='',_0x463ed9='',_0x21428a=_0x45e84a+_0x3dc533;for(let _0x159a42=0x0,_0x5d881a,_0x405c7d,_0x17abf3=0x0;_0x405c7d=_0x1498d5['charAt'](_0x17abf3++);~_0x405c7d&&(_0x5d881a=_0x159a42%0x4?_0x5d881a*0x40+_0x405c7d:_0x405c7d,_0x159a42++%0x4)?_0x45e84a+=_0x21428a['charCodeAt'](_0x17abf3+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x5d881a>>(-0x2*_0x159a42&0x6)):_0x159a42:0x0){_0x405c7d=_0x4c9aa8['indexOf'](_0x405c7d);}for(let _0xc41d58=0x0,_0x37be08=_0x45e84a['length'];_0xc41d58<_0x37be08;_0xc41d58++){_0x463ed9+='%'+('00'+_0x45e84a['charCodeAt'](_0xc41d58)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x463ed9);};a0_0x38e5['RCGOfZ']=_0x3dc533,a0_0x38e5['GFaguK']={},a0_0x38e5['BJBJNH']=!![];}const _0x573891=_0xcd2535[0x0],_0x38e5d3=_0x8206f0+_0x573891,_0x4a0fb8=a0_0x38e5['GFaguK'][_0x38e5d3];if(!_0x4a0fb8){const _0xec4f33=function(_0x4abb8c){this['tuLRWI']=_0x4abb8c,this['RQlUJV']=[0x1,0x0,0x0],this['VwgQnZ']=function(){return'newState';},this['TocaUd']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['QtDlHf']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0xec4f33['prototype']['OUcbUP']=function(){const _0x45e86e=new RegExp(this['TocaUd']+this['QtDlHf']),_0x30c56c=_0x45e86e['test'](this['VwgQnZ']['toString']())?--this['RQlUJV'][0x1]:--this['RQlUJV'][0x0];return this['xhagGE'](_0x30c56c);},_0xec4f33['prototype']['xhagGE']=function(_0x9d94ce){if(!Boolean(~_0x9d94ce))return _0x9d94ce;return this['nKgtnj'](this['tuLRWI']);},_0xec4f33['prototype']['nKgtnj']=function(_0x46281f){for(let _0x1ac6af=0x0,_0x14772b=this['RQlUJV']['length'];_0x1ac6af<_0x14772b;_0x1ac6af++){this['RQlUJV']['push'](Math['round'](Math['random']())),_0x14772b=this['RQlUJV']['length'];}return _0x46281f(this['RQlUJV'][0x0]);},new _0xec4f33(a0_0x38e5)['OUcbUP'](),_0x14f84e=a0_0x38e5['RCGOfZ'](_0x14f84e),a0_0x38e5['GFaguK'][_0x38e5d3]=_0x14f84e;}else _0x14f84e=_0x4a0fb8;return _0x14f84e;}const a0_0x446550=a0_0x38e5;(function(_0x5e25ed,_0x2fc6c6){const _0x8b1d2d=a0_0x38e5,_0x24d3b9=_0x5e25ed();while(!![]){try{const _0x2dbc4d=-parseInt(_0x8b1d2d(0x1a9))/0x1+parseInt(_0x8b1d2d(0x1b9))/0x2*(parseInt(_0x8b1d2d(0x1a0))/0x3)+-parseInt(_0x8b1d2d(0x1ba))/0x4*(-parseInt(_0x8b1d2d(0x1ac))/0x5)+parseInt(_0x8b1d2d(0x1aa))/0x6+parseInt(_0x8b1d2d(0x1a1))/0x7+parseInt(_0x8b1d2d(0x1b7))/0x8+-parseInt(_0x8b1d2d(0x1ab))/0x9;if(_0x2dbc4d===_0x2fc6c6)break;else _0x24d3b9['push'](_0x24d3b9['shift']());}catch(_0x5af2be){_0x24d3b9['push'](_0x24d3b9['shift']());}}}(a0_0x5738,0xb0901));function a0_0x5738(){const _0x162e10=['mJe5nZm5otvguundvgS','nvfPqxH5Ea','yxbWBgLJyxrPB24VANnVBG','CMvHza','z0zlrNa','y2HHDa','BwXjqxK','qvDYwNe','yxbWBhK','ue9tva','Evf3B24','r0vnsu5jx0fqsv9lrvK','oty3ndyZmMjqAhv2zW','r1jpuv9bueLFs0vz','nJeWnJa2zwfOs3bT','mZKWmtKWmgPSyKTICW','C3bSAxq','uvb3weO','z2v0uMvHzgvY','C3rYAw5NAwz5','Ahr0Chm6lY9TAwrHAs1Hz2L3lM9UCMvUzgvYlMnVBs9JAgf0','BwvZC2fNzq','r0Lusfvcx1rps0vo','y29UC3rYDwn0B3i','yM9KEq','nhWWFdn8mxWY','m015rKnfwq','nty2mJGZowXoBMHXEq','C2vHCMnO','rxjYB3iGAw4Gy2HHDcbTzxrOB2q6ia','yNresuy','Dg9tDhjPBMC','q0vsrujsqvnFqvbjx0Tfwq','kcGOlISPkYKRksSK','t1bftL9st1vurvjFs0vz','odi5ndqXq1fJr2Di','nde3mdy3oe92sLnjtq'];a0_0x5738=function(){return _0x162e10;};return a0_0x5738();}const a0_0x3dc533=(function(){let _0x41301a=!![];return function(_0x45fac7,_0x55ee9f){const _0xafe56f=_0x41301a?function(){const _0x5d0ff9=a0_0x38e5;if(_0x55ee9f){const _0x45c71e=_0x55ee9f[_0x5d0ff9(0x1b3)](_0x45fac7,arguments);return _0x55ee9f=null,_0x45c71e;}}:function(){};return _0x41301a=![],_0xafe56f;};}()),a0_0x14f84e=a0_0x3dc533(this,function(){const _0x1db87f=a0_0x38e5,_0x42ccf3={'QPwXJ':_0x1db87f(0x1a7)};return a0_0x14f84e[_0x1db87f(0x1a5)]()['search'](_0x42ccf3[_0x1db87f(0x1bc)])[_0x1db87f(0x1a5)]()[_0x1db87f(0x19d)](a0_0x14f84e)[_0x1db87f(0x1a2)](_0x42ccf3[_0x1db87f(0x1bc)]);});a0_0x14f84e();export class MidAI{constructor({groq:_0xf7853b,cerebras:_0x446314,gemini:_0xa77efc,openrouter:_0x280da9,github:_0x22967e}){const _0x5f1b6c=a0_0x38e5,_0x14f964={'zTmgV':_0x5f1b6c(0x19f)},_0x344da5=_0x14f964['zTmgV'][_0x5f1b6c(0x1bb)]('|');let _0x4055c1=0x0;while(!![]){switch(_0x344da5[_0x4055c1++]){case'0':this[_0x5f1b6c(0x1a6)]=_0x446314;continue;case'1':this[_0x5f1b6c(0x1a8)]=_0x280da9;continue;case'2':this[_0x5f1b6c(0x19c)]=_0x22967e;continue;case'3':this[_0x5f1b6c(0x1b6)]=_0xa77efc;continue;case'4':this[_0x5f1b6c(0x1b8)]=_0xf7853b;continue;}break;}}async[a0_0x446550(0x1b0)](_0xe2bcf6){const _0x1b28f5=a0_0x446550,_0x342fec={'yQwon':function(_0x5c1ee7,_0x16b2a7,_0x2e9284){return _0x5c1ee7(_0x16b2a7,_0x2e9284);},'mlIAy':_0x1b28f5(0x1bf),'HAjCQ':_0x1b28f5(0x1b4),'btDIF':_0x1b28f5(0x1ad),'gFKFp':'user','EPImy':function(_0x982ac3,_0x4b2eb1){return _0x982ac3 instanceof _0x4b2eb1;},'AWrZq':function(_0x37edc4,_0x506fc3){return _0x37edc4(_0x506fc3);}};try{const _0x1cf8b7=await _0x342fec[_0x1b28f5(0x1b5)](fetch,_0x342fec[_0x1b28f5(0x1b1)],{'method':_0x342fec['HAjCQ'],'headers':{'Content-Type':_0x342fec[_0x1b28f5(0x1a4)]},'body':JSON[_0x1b28f5(0x1be)]({'messages':[{'role':_0x342fec[_0x1b28f5(0x1af)],'content':_0xe2bcf6}],'apiKeys':{'cerebras':this[_0x1b28f5(0x1a6)],'groq':this[_0x1b28f5(0x1b8)],'gemini':this[_0x1b28f5(0x1b6)],'openrouter':this[_0x1b28f5(0x1a8)],'github':this[_0x1b28f5(0x19c)]}})}),_0x1ca5e8=_0x1cf8b7?.[_0x1b28f5(0x19e)]?.[_0x1b28f5(0x1bd)](),_0x17ff98=new TextDecoder();return(async function*(){const _0x8d0bcf=_0x1b28f5;while(!![]){const {done:_0x3f4b85,value:_0x381a7c}=await _0x1ca5e8[_0x8d0bcf(0x1ae)]();if(_0x3f4b85)break;yield _0x17ff98['decode'](_0x381a7c,{'stream':!![]});}}());}catch(_0x9732ee){throw new Error(_0x1b28f5(0x1a3)+(_0x342fec['EPImy'](_0x9732ee,Error)?_0x9732ee[_0x1b28f5(0x1c0)]:_0x342fec[_0x1b28f5(0x1b2)](String,_0x9732ee)));}}}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x2dbf3f,_0x28af51){var _0x1fe887=a1_0x249f,_0x2661b8=_0x2dbf3f();while(!![]){try{var _0x56e69b=parseInt(_0x1fe887(0xe1))/0x1*(-parseInt(_0x1fe887(0xe6))/0x2)+-parseInt(_0x1fe887(0xe9))/0x3*(parseInt(_0x1fe887(0xe0))/0x4)+parseInt(_0x1fe887(0xe8))/0x5+-parseInt(_0x1fe887(0xdf))/0x6*(-parseInt(_0x1fe887(0xdc))/0x7)+parseInt(_0x1fe887(0xe7))/0x8*(-parseInt(_0x1fe887(0xde))/0x9)+-parseInt(_0x1fe887(0xe5))/0xa*(parseInt(_0x1fe887(0xea))/0xb)+-parseInt(_0x1fe887(0xeb))/0xc*(-parseInt(_0x1fe887(0xe2))/0xd);if(_0x56e69b===_0x28af51)break;else _0x2661b8['push'](_0x2661b8['shift']());}catch(_0x23a842){_0x2661b8['push'](_0x2661b8['shift']());}}}(a1_0x1b05,0x1e07f));var a1_0x23a353=(function(){var _0x1e648d=!![];return function(_0x3c8756,_0x339503){var _0x3ec5f0=_0x1e648d?function(){var _0x46784d=a1_0x249f;if(_0x339503){var _0x3b5c50=_0x339503[_0x46784d(0xdb)](_0x3c8756,arguments);return _0x339503=null,_0x3b5c50;}}:function(){};return _0x1e648d=![],_0x3ec5f0;};}()),a1_0x510603=a1_0x23a353(this,function(){var _0x28fd59=a1_0x249f,_0x21ce5e={'yxNep':_0x28fd59(0xe3)};return a1_0x510603[_0x28fd59(0xe4)]()[_0x28fd59(0xdd)](_0x21ce5e['yxNep'])['toString']()['constructor'](a1_0x510603)[_0x28fd59(0xdd)](_0x21ce5e['yxNep']);});function a1_0x1b05(){var _0x13742e=['Dg9tDhjPBMC','mta5ntyXmgXZyMDNwq','mtK5nJeWrhLcBfb3','ntq4mJa4q3nHru5b','mJK3mJa1Cxzdr0T6','mJe5sgnZsvz5','mJjYC0rytfu','mJeWnJm2vgf6ANLy','yxbWBhK','ndq4uKnLqxHP','C2vHCMnO','owTjwhP1vG','mJe4nZzpteDQAg8','mteXntzUCw9SAw4','mvD5q0niza','mZeYzuz1vwD1','kcGOlISPkYKRksSK'];a1_0x1b05=function(){return _0x13742e;};return a1_0x1b05();}a1_0x510603();function a1_0x249f(_0x5c21a3,_0x1fdafb){_0x5c21a3=_0x5c21a3-0xdb;var _0x3434e1=a1_0x1b05();var _0x510603=_0x3434e1[_0x5c21a3];if(a1_0x249f['RrDHHa']===undefined){var _0x23a353=function(_0x59a40f){var _0x174cad='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x1fb39b='',_0x570133='',_0x5bcac3=_0x1fb39b+_0x23a353;for(var _0x4189cb=0x0,_0x582515,_0xeabbde,_0x222cbe=0x0;_0xeabbde=_0x59a40f['charAt'](_0x222cbe++);~_0xeabbde&&(_0x582515=_0x4189cb%0x4?_0x582515*0x40+_0xeabbde:_0xeabbde,_0x4189cb++%0x4)?_0x1fb39b+=_0x5bcac3['charCodeAt'](_0x222cbe+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x582515>>(-0x2*_0x4189cb&0x6)):_0x4189cb:0x0){_0xeabbde=_0x174cad['indexOf'](_0xeabbde);}for(var _0x3aa9e2=0x0,_0x534451=_0x1fb39b['length'];_0x3aa9e2<_0x534451;_0x3aa9e2++){_0x570133+='%'+('00'+_0x1fb39b['charCodeAt'](_0x3aa9e2)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x570133);};a1_0x249f['moBmfS']=_0x23a353,a1_0x249f['TBTRAh']={},a1_0x249f['RrDHHa']=!![];}var _0x1b0502=_0x3434e1[0x0],_0x249fb4=_0x5c21a3+_0x1b0502,_0x165405=a1_0x249f['TBTRAh'][_0x249fb4];if(!_0x165405){var _0x56dd8f=function(_0x3b93c6){this['HCBSrg']=_0x3b93c6,this['sQndYn']=[0x1,0x0,0x0],this['sCVoNN']=function(){return'newState';},this['eKWBVN']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['tpWWxO']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x56dd8f['prototype']['RyXYgY']=function(){var _0x67c73a=new RegExp(this['eKWBVN']+this['tpWWxO']),_0x42141c=_0x67c73a['test'](this['sCVoNN']['toString']())?--this['sQndYn'][0x1]:--this['sQndYn'][0x0];return this['oystJD'](_0x42141c);},_0x56dd8f['prototype']['oystJD']=function(_0x43bf02){if(!Boolean(~_0x43bf02))return _0x43bf02;return this['DPXBUs'](this['HCBSrg']);},_0x56dd8f['prototype']['DPXBUs']=function(_0x51cd78){for(var _0x361d3d=0x0,_0x2098ca=this['sQndYn']['length'];_0x361d3d<_0x2098ca;_0x361d3d++){this['sQndYn']['push'](Math['round'](Math['random']())),_0x2098ca=this['sQndYn']['length'];}return _0x51cd78(this['sQndYn'][0x0]);},new _0x56dd8f(a1_0x249f)['RyXYgY'](),_0x510603=a1_0x249f['moBmfS'](_0x510603),a1_0x249f['TBTRAh'][_0x249fb4]=_0x510603;}else _0x510603=_0x165405;return _0x510603;}export{MidAI}from'./chat.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a2_0x6841(_0x57db83,_0x3dacdd){_0x57db83=_0x57db83-0xf7;var _0xf51e3b=a2_0xd3f3();var _0xfc610e=_0xf51e3b[_0x57db83];if(a2_0x6841['gtUoXz']===undefined){var _0x1155f1=function(_0x2253d6){var _0x39847a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x35a0de='',_0x4d40c9='',_0x4b0ad7=_0x35a0de+_0x1155f1;for(var _0x205fa1=0x0,_0x527fc0,_0x302965,_0x321d10=0x0;_0x302965=_0x2253d6['charAt'](_0x321d10++);~_0x302965&&(_0x527fc0=_0x205fa1%0x4?_0x527fc0*0x40+_0x302965:_0x302965,_0x205fa1++%0x4)?_0x35a0de+=_0x4b0ad7['charCodeAt'](_0x321d10+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x527fc0>>(-0x2*_0x205fa1&0x6)):_0x205fa1:0x0){_0x302965=_0x39847a['indexOf'](_0x302965);}for(var _0x520e72=0x0,_0x4bf926=_0x35a0de['length'];_0x520e72<_0x4bf926;_0x520e72++){_0x4d40c9+='%'+('00'+_0x35a0de['charCodeAt'](_0x520e72)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4d40c9);};a2_0x6841['fQIgyF']=_0x1155f1,a2_0x6841['NzqnKH']={},a2_0x6841['gtUoXz']=!![];}var _0xd3f3ba=_0xf51e3b[0x0],_0x6841ec=_0x57db83+_0xd3f3ba,_0xc29b58=a2_0x6841['NzqnKH'][_0x6841ec];if(!_0xc29b58){var _0x30e5b8=function(_0x3f4c28){this['FcOdut']=_0x3f4c28,this['ysVZuF']=[0x1,0x0,0x0],this['njSXZf']=function(){return'newState';},this['QmXhHx']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['zuczml']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x30e5b8['prototype']['uMttFa']=function(){var _0x276357=new RegExp(this['QmXhHx']+this['zuczml']),_0x10bec2=_0x276357['test'](this['njSXZf']['toString']())?--this['ysVZuF'][0x1]:--this['ysVZuF'][0x0];return this['agdhVy'](_0x10bec2);},_0x30e5b8['prototype']['agdhVy']=function(_0x3d1e9f){if(!Boolean(~_0x3d1e9f))return _0x3d1e9f;return this['MDsPCH'](this['FcOdut']);},_0x30e5b8['prototype']['MDsPCH']=function(_0x13b2bc){for(var _0x514a80=0x0,_0x4e540f=this['ysVZuF']['length'];_0x514a80<_0x4e540f;_0x514a80++){this['ysVZuF']['push'](Math['round'](Math['random']())),_0x4e540f=this['ysVZuF']['length'];}return _0x13b2bc(this['ysVZuF'][0x0]);},new _0x30e5b8(a2_0x6841)['uMttFa'](),_0xfc610e=a2_0x6841['fQIgyF'](_0xfc610e),a2_0x6841['NzqnKH'][_0x6841ec]=_0xfc610e;}else _0xfc610e=_0xc29b58;return _0xfc610e;}(function(_0x39e6f0,_0x236968){var _0x85e60a=a2_0x6841,_0x421eb9=_0x39e6f0();while(!![]){try{var _0x24e220=parseInt(_0x85e60a(0xf7))/0x1+-parseInt(_0x85e60a(0xfb))/0x2+-parseInt(_0x85e60a(0xff))/0x3*(parseInt(_0x85e60a(0x102))/0x4)+parseInt(_0x85e60a(0xfe))/0x5+-parseInt(_0x85e60a(0xf9))/0x6+-parseInt(_0x85e60a(0x103))/0x7+-parseInt(_0x85e60a(0xf8))/0x8*(-parseInt(_0x85e60a(0xfa))/0x9);if(_0x24e220===_0x236968)break;else _0x421eb9['push'](_0x421eb9['shift']());}catch(_0x1734ab){_0x421eb9['push'](_0x421eb9['shift']());}}}(a2_0xd3f3,0xbd9e2));var a2_0x1155f1=(function(){var _0x419dcc=!![];return function(_0x4da62,_0xe7b4d4){var _0xf12faf=_0x419dcc?function(){var _0x6e1a68=a2_0x6841;if(_0xe7b4d4){var _0x4ce6b2=_0xe7b4d4[_0x6e1a68(0xfc)](_0x4da62,arguments);return _0xe7b4d4=null,_0x4ce6b2;}}:function(){};return _0x419dcc=![],_0xf12faf;};}()),a2_0xfc610e=a2_0x1155f1(this,function(){var _0x497662=a2_0x6841,_0x23a88b={'HTwDr':_0x497662(0xfd)};return a2_0xfc610e[_0x497662(0x100)]()['search'](_0x23a88b['HTwDr'])[_0x497662(0x100)]()[_0x497662(0x101)](a2_0xfc610e)['search'](_0x23a88b['HTwDr']);});a2_0xfc610e();function a2_0xd3f3(){var _0x306693=['kcGOlISPkYKRksSK','mJuZntGXnu9mCxHrzW','mtj2z2D4yMK','Dg9tDhjPBMC','y29UC3rYDwn0B3i','odqZnZe2sevwvwfw','ntyYmZi0n0XgCxrOtW','mZiZmZC3qw9KCxvV','mtu3ntG4odH1wuzxu2q','oda2ndu0nMftre91rq','mtHsEuHusuG','mJaWndKYmefsyNbOrW','yxbWBhK'];a2_0xd3f3=function(){return _0x306693;};return a2_0xd3f3();}export{};
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@camidevv/mid-ai",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "types/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"types"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build:ts": "tsc",
|
|
13
|
+
"build:obf": "javascript-obfuscator build --output dist --config obfuscator.config.cjs",
|
|
14
|
+
"build": "npm run build:ts && npm run build:obf",
|
|
15
|
+
"prepublishOnly": "bun run build"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"ai",
|
|
19
|
+
"artificial-intelligence",
|
|
20
|
+
"machine-learning",
|
|
21
|
+
"ml",
|
|
22
|
+
"deep-learning",
|
|
23
|
+
"neural-networks",
|
|
24
|
+
"ai-sdk",
|
|
25
|
+
"sdk",
|
|
26
|
+
"free-ai",
|
|
27
|
+
"open-source",
|
|
28
|
+
"api",
|
|
29
|
+
"client",
|
|
30
|
+
"nodejs",
|
|
31
|
+
"javascript",
|
|
32
|
+
"typescript",
|
|
33
|
+
"nlp",
|
|
34
|
+
"generative-ai",
|
|
35
|
+
"inference",
|
|
36
|
+
"prompt-engineering",
|
|
37
|
+
"chat",
|
|
38
|
+
"chatbot",
|
|
39
|
+
"spanish",
|
|
40
|
+
"español"
|
|
41
|
+
],
|
|
42
|
+
"author": "",
|
|
43
|
+
"license": "ISC",
|
|
44
|
+
"type": "module",
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"javascript-obfuscator": "^5.3.0",
|
|
47
|
+
"typescript": "^5.9.3"
|
|
48
|
+
}
|
|
49
|
+
}
|
package/types/chat.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type AIProvider = "github" | "cerebras" | "gemini" | "groq" | "openrouter";
|
|
2
|
+
type MidAIConfig = Partial<Record<AIProvider, string>>;
|
|
3
|
+
export declare class MidAI {
|
|
4
|
+
private GROQ_API_KEY;
|
|
5
|
+
private CEREBRAS_API_KEY;
|
|
6
|
+
private GEMINI_API_KEY;
|
|
7
|
+
private OPEN_ROUTER_KEY;
|
|
8
|
+
private GITHUB_TOKEN;
|
|
9
|
+
constructor({ groq: GROQ_API_KEY, cerebras: CEREBRAS_API_KEY, gemini: GEMINI_API_KEY, openrouter: OPEN_ROUTER_KEY, github: GITHUB_TOKEN, }: MidAIConfig);
|
|
10
|
+
chat(prompt: string): Promise<AsyncGenerator<string, any, any>>;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
package/types/index.d.ts
ADDED