diff --git a/Apikeys.ipynb b/Apikeys.ipynb index b5d9d67..afc566b 100644 --- a/Apikeys.ipynb +++ b/Apikeys.ipynb @@ -5,15 +5,7 @@ "execution_count": 1, "id": "26aa8e2b", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "✅ Credencial: Credencial_enmanuel\n" - ] - } - ], + "outputs": [], "source": [ "from src.ApiKeys.openai_apikey import OpenAICredencial\n", "from src.ApiKeys.openai_apikey_mmr import OpenAICredencialRepo # Ajusta si está en otro módulo\n", @@ -24,14 +16,61 @@ "conexion_admin = PostgresConexion(db_credencial)\n", "\n", "# 3. Guardar la credencial en la base de datos\n", - "repo = OpenAICredencialRepo(conexion_admin)\n", - "credencial_openai = repo.get_by_id(1)\n", + "repo = OpenAICredencialRepo(conexion_admin)\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4c232ecd", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'OPAK20250510-ac2cea8af3110632314'" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# apikey_gpt = OpenAICredencial(titulo=\"Credencial_enmanuel_gpt\")\n", + "# repo.add(apikey_gpt)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "32552452", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "✅ Credencial: Credencial_enmanuel_gpt\n" + ] + } + ], + "source": [ + "credencial_openai = repo.get_by_id('OPAK20250510-ac2cea8af3110632314')\n", "print(f\"✅ Credencial: {credencial_openai.titulo}\")" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, + "id": "7464fa65", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 4, "id": "e5b665a6", "metadata": {}, "outputs": [], diff --git a/Apikeys_embedding.ipynb b/Apikeys_embedding.ipynb new file mode 100644 index 0000000..b8d265f --- /dev/null +++ b/Apikeys_embedding.ipynb @@ -0,0 +1,219 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "3c2edde7", + "metadata": {}, + "outputs": [], + "source": [ + "from src.ApiKeys.openai_apikey import OpenAICredencial\n", + "from src.ApiKeys.openai_apikey_mmr import OpenAICredencialRepo # Ajusta si está en otro módulo\n", + "from src.ConexionSql.Postgres_conexion import PostgresConexion\n", + "\n", + "# 1. Crear instancia de conexión (asegúrate de configurar bien tu conexión en Base_conexion)\n", + "from entrypoint.init_db import db_credencial\n", + "conexion_admin = PostgresConexion(db_credencial)\n", + "\n", + "# 3. Guardar la credencial en la base de datos\n", + "repo = OpenAICredencialRepo(conexion_admin)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "7a24ff10", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "✅ Credencial: Credencial_enmanuel_gpt\n" + ] + } + ], + "source": [ + "credencial_openai = repo.get_by_id('OPAK20250510-ac2cea8af3110632314')\n", + "print(f\"✅ Credencial: {credencial_openai.titulo}\")" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "5ae61fe2", + "metadata": {}, + "outputs": [], + "source": [ + "from src.Llms.Embedders.Openai_embedder import OpenAIEmbedder\n", + "\n", + "embedder = OpenAIEmbedder(credencial_openai, model=\"text-embedding-3-large\")" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "42cb5e7e", + "metadata": {}, + "outputs": [], + "source": [ + "vector1 = embedder.encoder(\"Hola, ¿cómo estás?\")" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "13d34622", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Vector 1: [-0.03075655736029148, 0.008938624523580074, -0.023003341630101204, -0.0029715318232774734, -0.011490991339087486, 0.0003988073440268636, -0.003080995287746191, -0.01183273084461689, 0.009878408163785934, 0.022020841017365456, -0.044810593128204346, -0.0023828321136534214, -0.04256792739033699, 0.035434115678071976, 0.00930172298103571, 0.024178070947527885, -0.000909080496057868, 0.0003804521984420717, -0.008180390112102032, -0.01616855151951313, 0.04137184098362923, 0.018646162003278732, 0.013520069420337677, 0.025715898722410202, -0.008025539107620716, 0.014726837165653706, 0.0030569666996598244, 0.03994080796837807, -0.009365798905491829, -0.03248661383986473, -0.013327841646969318, -0.006829450838267803, 0.037612706422805786, 0.006722657009959221, 0.006087235175073147, 0.0044452836737036705, -0.006338200066238642, 0.0021131783723831177, 0.013071537017822266, 0.009109494276344776, -9.711542952572927e-05, 0.0401330329477787, -0.01786656863987446, 0.0005092719802632928, 0.001696683350019157, -0.007507590111345053, 0.015570506453514099, 0.04391352832317352, 0.0030409477185457945, -0.0038365600630640984, 0.03865928202867508, 0.017514150589704514, 0.0633072480559349, 0.017418036237359047, 0.025715898722410202, 0.006354219280183315, 0.03733504191040993, -0.05010755732655525, 0.019447114318609238, -0.0074328347109258175, -0.009707538411021233, 0.00469357892870903, 0.003313271328806877, -0.01791996695101261, 0.021593665704131126, -0.0001777112192939967, -0.0021265274845063686, 0.011426915414631367, -0.011790013872087002, 0.04361450672149658, 0.03391764685511589, -0.008084275759756565, 0.0025270036421716213, -0.008292523212730885, -0.014096755534410477, 0.007838650606572628, 0.014705479145050049, -0.03141867741942406, 0.01934032142162323, -0.014481212012469769, 0.028962424024939537, -0.037591345608234406, -0.031098296865820885, 0.03199536353349686, 0.006348879542201757, -0.010754115879535675, -0.013808412477374077, -0.08449509739875793, -0.017813172191381454, -0.030414817854762077, 0.019276244565844536, 0.008420675061643124, -0.035562269389629364, -0.016691839322447777, 0.019543228670954704, 0.0040074298158288, 0.020856790244579315, 0.005884327460080385, 0.028770195320248604, -0.004771003965288401, 0.009210947901010513, 0.014267625287175179, 0.015677301213145256, -0.005078035872429609, 0.0041489312425255775, 0.014086076058447361, -0.026869269087910652, 0.01834714040160179, 0.0035161792766302824, -0.045536790043115616, -0.01088760793209076, -0.01145895291119814, 0.03304193913936615, -0.01248417142778635, 0.024562528356909752, 0.008543487638235092, -0.029240088537335396, 0.0637771412730217, -0.019852930679917336, -0.044383421540260315, 0.00040548195829614997, -0.029667261987924576, 0.008068256080150604, 0.008895906619727612, -0.0011300097685307264, 0.02466932125389576, 0.004573435988277197, 0.011085175909101963, -0.0014657421270385385, 0.02945367433130741, -0.017524829134345055, 0.01270843856036663, -0.025310082361102104, 0.013455993495881557, 0.025288725271821022, -0.03231574222445488, -0.004819061141461134, 0.07133812457323074, -0.018283063545823097, 0.013573466800153255, -0.045536790043115616, -0.01846461370587349, 0.02729644440114498, 0.06967214494943619, -0.026869269087910652, -0.010609944351017475, 0.011373518034815788, 0.00843135453760624, -0.023985842242836952, 0.029496392235159874, -0.03573313727974892, -0.03964178264141083, 0.013904526829719543, -0.034131232649087906, 0.012163790874183178, 0.0009571376140229404, -0.00042383710388094187, 0.023580027744174004, 0.01889178715646267, -0.01349871139973402, -0.0012461477890610695, 0.017685020342469215, -4.8682864871807396e-05, -0.01189680676907301, -0.005612003616988659, 0.012291943654417992, 0.0046828994527459145, -0.014299662783741951, -0.009275023825466633, 0.007662440650165081, -0.021251926198601723, -0.016510291025042534, 0.01586952805519104, -0.021572306752204895, -0.05429386720061302, -0.019564587622880936, 0.046989183872938156, 0.03028666414320469, 0.004229026380926371, 0.015762735158205032, -0.014983141794800758, 0.028364380821585655, 0.041948527097702026, -0.01946847327053547, 0.021273285150527954, 0.03855248913168907, -0.002445573452860117, -0.04156406968832016, -0.017962682992219925, -0.02682655304670334, 0.023580027744174004, 0.0052595846354961395, 0.029539110139012337, -0.003420064924284816, 0.020162630826234818, 0.02642073668539524, 0.01802675984799862, -0.017855890095233917, 0.0224907323718071, -0.03214487433433533, -0.024028560146689415, -0.036309823393821716, -0.016371458768844604, -0.005275603849440813, -0.036865152418613434, 0.008409995585680008, -0.003299922216683626, -0.0142142279073596, -0.02985949069261551, 0.053610388189554214, -0.027339162304997444, -0.017065616324543953, 0.0032732237596064806, -0.002481616334989667, 0.024754757061600685, -0.0031824493780732155, 0.0031263825949281454, -0.005441133864223957, 0.01119196880608797, 0.0026124385185539722, 0.03199536353349686, -0.009755595587193966, -0.006375577766448259, -0.0031877888832241297, -0.025950845330953598, 0.01989564672112465, 0.01176865492016077, 0.0019102705409750342, 0.004872458055615425, 0.011779334396123886, 0.03336232155561447, -0.02177521586418152, 0.012078355997800827, -0.00526759447529912, 0.01775977574288845, 0.049594946205616, 0.02928280457854271, -0.02164706215262413, -0.05322593078017235, 0.01963934302330017, -0.00198369100689888, 0.02729644440114498, -0.03331960365176201, -0.01646757312119007, -0.025480952113866806, -0.008212427608668804, 0.0063221813179552555, 0.03756998851895332, 0.0190306194126606, -0.016649121418595314, -0.012889987789094448, -0.002776633482426405, -0.0010325605981051922, 0.023473232984542847, -0.004015439189970493, -0.004952553194016218, 0.03838162124156952, -0.008644942194223404, 0.028834272176027298, 0.012163790874183178, 0.0019489831756800413, -0.05711321532726288, -0.019158771261572838, 0.023985842242836952, -0.008121653459966183, 0.0016072436701506376, 0.015987001359462738, 0.00952064897865057, -0.032401178032159805, -0.03374677896499634, 0.01590156741440296, -0.004544067662209272, 0.06745083630084991, 0.0349428653717041, 0.01550643052905798, -0.006578485947102308, 0.019810212776064873, -0.014342380687594414, 0.0004975914489477873, 0.020461654290556908, 0.030051719397306442, -0.025288725271821022, 0.014705479145050049, -0.010727416723966599, -0.0006474361871369183, -0.017973363399505615, -0.010545868426561356, -0.04861244559288025, 0.02411399409174919, 0.0019156101625412703, -0.03086335025727749, 0.019735457375645638, -0.018678201362490654, -0.0022666940931230783, 0.01342395506799221, 0.0010332281235605478, 0.001619257964193821, 0.005804232321679592, 0.03389628976583481, -0.05237158015370369, 0.015015180222690105, 0.005144781898707151, 0.006866828538477421, 0.022554807364940643, -0.015207408927381039, 0.04600668326020241, 0.026078997179865837, 0.03624574840068817, -0.03765542432665825, 0.037014663219451904, -0.013445314019918442, 0.008255145512521267, -0.04946679621934891, -0.06292279064655304, -0.011918165720999241, -0.029624544084072113, -0.027616824954748154, -0.0030409477185457945, -0.0328710712492466, 0.0023054068442434072, -0.009291043505072594, 0.004554747138172388, -0.006797412410378456, -0.002848719246685505, -0.0037457854487001896, -0.020984942093491554, -0.004795032553374767, -0.04158542677760124, 0.01733260042965412, 0.028065357357263565, -0.04184173420071602, -0.0002729911357164383, -0.02381497249007225, 0.03660884499549866, 0.02624986693263054, -0.02032282203435898, -0.028513891622424126, -0.024049919098615646, 0.004237036220729351, -0.027510032057762146, 0.007160510867834091, -0.01632874086499214, 0.0005529905902221799, -0.009504630230367184, -0.0019663372077047825, 0.018283063545823097, 0.013306482695043087, 0.025459595024585724, -0.04374265670776367, 0.04459700733423233, 3.331042535137385e-05, -0.014684120193123817, 0.030542969703674316, -0.01689474657177925, -0.028065357357263565, 0.012142431922256947, 0.018582087010145187, -0.05113277584314346, -0.011864769272506237, -0.025865409523248672, 0.008767754770815372, -0.03735640272498131, -0.01362686324864626, 0.0011166605399921536, 0.05010755732655525, 0.004733626265078783, 0.03885151073336601, 0.03949227184057236, 0.012377378530800343, 0.046262986958026886, -0.01570933870971203, 0.00987306796014309, -0.01312493346631527, 0.009130853228271008, -0.03603215888142586, 0.026805194094777107, -0.0022760385181754827, -0.029218729585409164, -0.02409263700246811, 0.015570506453514099, -0.026036279276013374, 0.06428974866867065, 0.007475552149116993, 0.003452103119343519, 0.004541398026049137, 0.005035318434238434, 0.01364822220057249, 0.0013936564791947603, -0.020418936386704445, -0.019692739471793175, -0.005032648332417011, -0.009210947901010513, 0.018261706456542015, 0.00681343162432313, -0.013295803219079971, -0.010903626680374146, -0.039449553936719894, -0.03663020581007004, -0.014908386394381523, 0.0014070057077333331, -0.014192868955433369, -0.015335560776293278, 0.0012247890699654818, -0.016713198274374008, 0.050278425216674805, -0.04387081041932106, 0.014673440717160702, -0.008052237331867218, 0.03590400889515877, -0.008324560709297657, 0.017289884388446808, -0.031974002718925476, 0.02669839933514595, 0.00044920056825503707, -0.029325522482395172, 0.028663402423262596, 0.027680901810526848, -0.006541107781231403, -0.0012514875270426273, 0.006509069819003344, 0.02311013452708721, -0.008992020972073078, 0.03246525302529335, 0.008228447288274765, -0.05040657892823219, 0.02556638792157173, 0.0020824752282351255, 0.021615024656057358, -0.033255528658628464, 0.014555967412889004, -0.018122874200344086, -0.009819671511650085, 0.036437977105379105, -0.01618991047143936, 0.013851129449903965, 0.01601904071867466, 0.019810212776064873, -0.02076067589223385, 0.017225807532668114, 0.005830930545926094, 0.023580027744174004, 0.0028807574417442083, 0.0031771096400916576, 0.00458144536241889, -0.0019810213707387447, -0.04009031876921654, -0.021380078047513962, 0.04472516104578972, 0.04169221967458725, 0.0295818280428648, 0.006525089032948017, 0.011426915414631367, -0.01212107390165329, -0.007731856778264046, -0.012911345809698105, -0.05813843756914139, -0.03090606816112995, 0.05754039064049721, 0.041799016296863556, 0.03799716383218765, 0.042802873998880386, 0.02351595088839531, 0.015794772654771805, -0.03936412185430527, 0.014523929916322231, -0.013466672971844673, -0.008436694741249084, -0.012857949361205101, 0.02007719688117504, 0.0030436175875365734, 0.03306329995393753, -0.00202373880892992, 0.05040657892823219, -0.01748211309313774, 0.027680901810526848, -0.04058156907558441, -0.046690162271261215, 0.005975102074444294, 0.016371458768844604, -0.01642485521733761, 0.04664744436740875, 0.010385677218437195, -0.03376813605427742, -0.03135460242629051, -0.020888827741146088, 0.0013803072506561875, 0.041927166283130646, 0.0015498420689255, 0.007037698291242123, -0.022554807364940643, 0.021316003054380417, -0.03188857063651085, -0.009969182312488556, -0.01819762960076332, -0.013883167877793312, 0.004618823062628508, -0.009584725834429264, -0.007972142659127712, -0.0011520360130816698, 0.03017987124621868, 0.00895464327186346, 0.03861656412482262, -0.0006674599717371166, 0.008853189647197723, -0.017663661390542984, 0.02047233283519745, 0.026911986991763115, -0.06104322150349617, -0.018389858305454254, 0.045963965356349945, 0.03526324778795242, -0.0053770579397678375, 0.02667704038321972, -0.031375959515571594, 0.016072437167167664, 0.012868628837168217, -0.006450333632528782, -0.027168292552232742, 0.04472516104578972, 0.0026578258257359266, -0.020814072340726852, 0.0049552228301763535, 0.030713839456439018, -0.005029978696256876, 0.028898347169160843, 0.015976322814822197, 0.008463392965495586, -0.015634583309292793, 0.015420995652675629, -0.013381238095462322, 0.022981982678174973, -0.015687979757785797, 0.018389858305454254, 0.06258104741573334, -0.0081590311601758, -0.028193511068820953, 0.0031610906589776278, 0.010690039023756981, 0.012099714949727058, 0.004202328156679869, -0.035305965691804886, 0.0395563505589962, -0.01877431571483612, -0.007277983706444502, -0.005777533631771803, 0.01573069766163826, 0.01406471710652113, -0.057369522750377655, -0.021753856912255287, 0.003388026962056756, 0.007411475758999586, -0.0058149113319814205, 0.01145895291119814, -0.015762735158205032, 0.001051249448210001, 0.0047176070511341095, -0.02036553993821144, 0.01242009550333023, 0.0060979146510362625, 0.006962942890822887, 0.0029394938610494137, 0.009477932006120682, -0.016414176672697067, 0.008634262718260288, -0.0453232042491436, 0.013434634543955326, -0.014887027442455292, -0.010220147669315338, -0.01118129026144743, 0.002329435432329774, 0.011597785167396069, -0.010524509474635124, 0.025908127427101135, -0.0037698140367865562, -0.01233466062694788, 0.03223031014204025, -0.0046695503406226635, -0.01762094348669052, -0.0189131461083889, 0.0031904587522149086, -0.011886127293109894, 0.011693899519741535, -0.016051078215241432, 0.0015618563629686832, -0.01790928654372692, -0.0022066228557378054, -0.013947243802249432, -0.03308465704321861, 0.006856149062514305, 0.05322593078017235, 0.0164355356246233, 0.016125833615660667, 0.04801440238952637, 0.04214075580239296, -0.00772117730230093, -0.007197888568043709, -0.011159931309521198, -0.02006651647388935, 0.0035161792766302824, -0.009702198207378387, 0.015335560776293278, 0.017514150589704514, -0.005361038725823164, -0.002492295578122139, -0.017984041944146156, -0.017524829134345055, -0.008185729384422302, -0.010300242342054844, -0.01126672513782978, -0.004568096250295639, -0.045963965356349945, -0.04041069746017456, -0.01456664688885212, 0.018133552744984627, 0.024733398109674454, 0.024220788851380348, 0.023046059533953667, 0.0002729911357164383, -0.039876729249954224, -0.039449553936719894, -0.02945367433130741, -0.003003570018336177, 0.0018315102206543088, -0.0024495781399309635, 8.676979632582515e-05, 0.01787724904716015, 0.018283063545823097, -8.351592987310141e-05, -0.015143332071602345, 0.018582087010145187, -0.0407097190618515, 0.00010053616279037669, -0.0019503181101754308, 0.021604346111416817, 0.01247349288314581, 0.010091994889080524, 0.011149251833558083, 0.02321692928671837, -0.003150411183014512, -0.021294644102454185, -0.014342380687594414, -0.02885563112795353, -0.006824111100286245, -0.02036553993821144, -0.003988740965723991, -0.0012074351543560624, -0.005080705508589745, 0.01860344596207142, 0.026869269087910652, -0.007635742425918579, -0.019425755366683006, -0.03176041692495346, 0.021316003054380417, 0.0401330329477787, -0.0017620944418013096, -0.006215387489646673, -0.011854089796543121, 0.00019423085905145854, -0.023750897496938705, -0.035156454890966415, -0.00881047174334526, -0.0037270965985953808, 0.030393458902835846, -0.02740323729813099, -0.01362686324864626, 0.013658901676535606, 0.007881367579102516, -0.02729644440114498, -0.006156650837510824, 0.024626603350043297, 0.006845469586551189, -0.028385737910866737, -0.03088470920920372, -0.011576426215469837, -0.01145895291119814, -0.005374387837946415, -0.01600836031138897, -0.01154438778758049, 0.0282575860619545, 0.013445314019918442, -0.005985781084746122, -0.031824491918087006, 0.036865152418613434, -0.020888827741146088, 0.004455963149666786, -0.0060178195126354694, -0.033276885747909546, -0.00418363930657506, 0.0018915816908702254, -0.025288725271821022, 0.00616733031347394, -0.04536592215299606, 0.024178070947527885, 0.01646757312119007, 0.011063816957175732, 0.01763162389397621, 0.012932704761624336, 0.0022893878631293774, 0.014961783774197102, -0.012398736551404, -0.010700718499720097, -0.04686103016138077, -0.03015851229429245, -0.011597785167396069, 0.028492532670497894, 0.018817031756043434, 0.005278273485600948, -0.018859749659895897, -0.022981982678174973, 0.016958823427557945, 0.03737775981426239, -0.011715257540345192, 0.0037190872244536877, 0.0424397774040699, -0.02006651647388935, -0.002915465272963047, 0.04066700115799904, 0.02034418098628521, 0.0008316551684401929, 0.016499610617756844, 0.035562269389629364, 0.0015738706570118666, -0.0282575860619545, 0.005096724722534418, 0.0026297923177480698, -0.019094696268439293, 0.020258745178580284, 0.03131188452243805, -0.0025016400031745434, 0.00012598307512234896, -0.001508459565229714, -0.04015439376235008, 0.00028467169613577425, -0.021401436999440193, 0.001195420860312879, -0.02409263700246811, -0.022597525268793106, -0.0010746106272563338, 0.022747036069631577, -0.02268296107649803, 0.014246266335248947, -0.030478892847895622, 0.004439943935722113, 0.002154560759663582, -0.0591636560857296, 0.033383678644895554, -0.0015017850091680884, 0.02135871909558773, 0.03214487433433533, 0.011469632387161255, 0.009221627376973629, 0.025908127427101135, -0.01962866447865963, -0.020835431292653084, 0.008773094043135643, 0.01371229812502861, 0.0192014891654253, 0.00010020242916652933, -0.03639525920152664, 0.01456664688885212, -0.022576166316866875, 0.02193540520966053, 0.011608464643359184, -0.00858086533844471, -0.018720917403697968, -0.005857628770172596, -0.008126992732286453, -0.00018305089906789362, -0.014513250440359116, 0.011886127293109894, -0.0030089097563177347, 0.027873128652572632, -0.02019467018544674, 0.005347689613699913, -0.061683982610702515, -0.02238393761217594, 0.007133812643587589, -0.02469068020582199, -0.009168230928480625, -0.013594824820756912, 0.006060536950826645, -0.026356659829616547, 0.02857796661555767, -0.04852701351046562, 0.005027308594435453, -0.053311366587877274, 0.01877431571483612, -0.004843089729547501, 0.015324881300330162, -0.010706058703362942, 0.005110073834657669, 0.010172090493142605, 0.021871328353881836, -0.0027552747633308172, 0.029197370633482933, -0.022704320028424263, -0.003561566583812237, 0.006978961639106274, -0.0035535569768399, 0.040752436965703964, 0.005078035872429609, -0.01016675028949976, 0.0021105085033923388, 0.023729538545012474, -0.010577905923128128, 0.01277251448482275, -0.0008143011946231127, -0.016350099816918373, -0.012398736551404, -0.013477352447807789, -0.023580027744174004, 0.024156711995601654, -0.017727738246321678, 0.0019663372077047825, 0.019991761073470116, -0.01730056293308735, 0.021422795951366425, 0.00901337992399931, 0.040346622467041016, -0.026335300877690315, 0.008383297361433506, -0.0019156101625412703, 0.0415213517844677, -0.018656842410564423, 0.001892916508950293, 9.102485637413338e-05, 0.0003617633192334324, -0.00909881480038166, -0.007240606006234884, 0.003323950804769993, 0.0007769234362058342, -0.025480952113866806, -0.017001541331410408, 0.02740323729813099, -0.008265824988484383, 0.021689780056476593, -0.05595984682440758, -0.004052816890180111, 0.02379361353814602, 0.021380078047513962, -0.009259005077183247, -0.003388026962056756, 0.0020931544713675976, 0.002923474879935384, -0.030201230198144913, 0.006834790576249361, 0.00858086533844471, -0.00014842642121948302, 0.011202648282051086, -0.030927427113056183, 0.022255785763263702, -0.026207149028778076, -0.00627946387976408, 0.03692922741174698, -0.015186049975454807, -0.0008450043387711048, -0.02943231537938118, -0.04117961227893829, 0.023281004279851913, 0.013135612942278385, 0.001939638750627637, 0.0028914366848766804, -0.035305965691804886, 0.009093474596738815, -0.012099714949727058, -0.038338903337717056, 0.011053137481212616, -0.008612903766334057, 0.004463972523808479, 0.017834531143307686, 0.0147909140214324, -0.009905106388032436, 0.004891146905720234, 0.010364319197833538, 0.03735640272498131, -0.014972462318837643, 0.02236258052289486, -0.009403176605701447, -0.04775809869170189, -0.003919325303286314, -0.018080156296491623, 0.010188109241425991, -0.020952904596924782, 0.0011673875851556659, 0.017973363399505615, -0.014897706918418407, 0.012323981150984764, 0.02107037790119648, -0.0060979146510362625, -0.01732192188501358, -0.0005312981666065753, 0.03577585518360138, -0.008068256080150604, -0.04023982957005501, 0.02667704038321972, 0.014929745346307755, 0.006044517736881971, 0.015100615099072456, -0.014011320658028126, 0.04485331103205681, 0.027061497792601585, -0.007288663182407618, 0.004853769205510616, 0.018240347504615784, -0.003089004894718528, 0.03985537216067314, -0.006231406703591347, 0.037292324006557465, -0.00865562167018652, 0.014246266335248947, 0.0061833495274186134, -0.00011021432874258608, 0.004204997792840004, -0.006599844433367252, -0.010118693113327026, -0.0025523670483380556, -0.005216867197304964, 0.03101286105811596, 0.040175750851631165, -0.016553007066249847, -0.006076555699110031, -0.019682060927152634, 0.004915175493806601, -0.03492150828242302, 0.009141531772911549, 0.0026685050688683987, -0.006450333632528782, 0.006962942890822887, 0.009008039720356464, -0.024327581748366356, -0.00975025538355112, 0.011448273435235023, -0.015538468956947327, 0.01788792759180069, 0.022042198106646538, -0.02064320258796215, 0.025779975578188896, 0.027659542858600616, -0.0009204273228533566, -0.042931027710437775, -0.0026845240499824286, 0.00909881480038166, 0.008815811946988106, -0.045963965356349945, -0.006060536950826645, -0.04051749035716057, 0.010086655616760254, -0.018112193793058395, -0.01247349288314581, 0.00646101264283061, -0.019137412309646606, -0.003857918782159686, 0.031696341931819916, 0.01687338948249817, 0.013925885781645775, 0.002864738227799535, 0.027894487604498863, 0.048697881400585175, 0.032550688832998276, 0.004976581782102585, -0.012996780686080456, -0.010876928456127644, -0.0010178765514865518, -0.0025029750540852547, 0.03893694654107094, 0.005003280006349087, 0.010236166417598724, -0.0004361851024441421, 0.037292324006557465, -0.021721817553043365, 0.01270843856036663, -0.002660495461896062, -0.004560086876153946, -0.002161235548555851, 0.03511373698711395, 0.020707279443740845, -0.027937205508351326, -0.004544067662209272, -0.008335240185260773, -0.041072819381952286, 0.04750179499387741, -0.0009591400157660246, 0.008212427608668804, 0.044383421540260315, 0.015271484851837158, -0.03319144994020462, 0.00552122900262475, 0.04340091720223427, -0.006850809324532747, -0.02076067589223385, -0.0392146110534668, 0.007027018815279007, -0.019436435773968697, -0.029111934825778008, -0.0021572306286543608, -0.012067676521837711, -0.01875295676290989, 0.0007595694623887539, -0.04169221967458725, -0.004237036220729351, 0.0226616021245718, -0.02915465272963047, -0.025630464777350426, -0.008863869123160839, 0.009461913257837296, -0.003390696831047535, -0.005438464228063822, 0.0031717699021101, -0.025053778663277626, -0.001854203874245286, 0.023750897496938705, -0.015848170965909958, -0.015687979757785797, -0.0003227169218007475, 0.020888827741146088, 0.02988084964454174, -0.01731124334037304, 0.00458144536241889, 0.008260484784841537, 0.059804417192935944, 0.011651181615889072, -0.016926785930991173, -0.01218514982610941, -0.03163226321339607, 0.010209468193352222, -0.017823852598667145, -0.0010625963332131505, 0.020717957988381386, 0.0018849070183932781, -0.03566906228661537, 0.009205608628690243, 0.007876028306782246, -0.0032785634975880384, -0.013477352447807789, -0.02582269161939621, -0.006546447519212961, 0.005745495669543743, -0.05382397398352623, -0.0015017850091680884, -0.016553007066249847, 0.01068469975143671, 0.005927044898271561, 0.019970403984189034, -0.00599112082272768, 0.004688239190727472, -0.01890246756374836, -0.005916365422308445, -0.011523029766976833, 0.004290432669222355, 0.008244466036558151, 0.008676979690790176, -0.013103574514389038, 0.024028560146689415, 0.028834272176027298, -0.03464384377002716, -0.0075983647257089615, 0.01659572497010231, 0.016691839322447777, 0.02887699007987976, -0.026014920324087143, 0.0012521549360826612, 0.004722946789115667, -0.010989061556756496, 0.006188689265400171, -0.011779334396123886, -0.00425572507083416, 0.0217965729534626, -0.005798892583698034, 0.0027045479509979486, -0.01515401154756546, -0.008709018118679523, -0.02424214780330658, 0.016125833615660667, 0.007587685249745846, 0.01168322004377842, -0.008890567347407341, -0.026292584836483, -0.012548248283565044, -0.04169221967458725, 0.002700543263927102, 0.005454482976347208, -0.005387736950069666, -0.007416815496981144, 0.016937464475631714, -0.0017233816906809807, -0.0009077456197701395, 0.01220650877803564, -0.0029715318232774734, 0.0036149632651358843, 0.021764535456895828, -0.023046059533953667, 0.013520069420337677, -0.009339100681245327, 0.006306162104010582, -0.030500251799821854, 0.0027873129583895206, 0.014630722813308239, -0.023879049345850945, 0.01364822220057249, -0.011822051368653774, -0.013370558619499207, 0.002194608561694622, -0.014641402289271355, -0.016414176672697067, -0.015410316176712513, 0.0006537770968861878, 0.0019116054754704237, -0.004311791621148586, -0.002647146349772811, 0.027659542858600616, 0.004773674067109823, 0.031845852732658386, 0.000847006740514189, 0.011448273435235023, 0.010417715646326542, -0.014224907383322716, -0.006866828538477421, 0.010807512328028679, -0.018443254753947258, 0.023195570334792137, -0.003334630047902465, -0.010508489795029163, -0.0015298182843253016, 0.00548919104039669, -0.022747036069631577, -0.038595207035541534, -0.007224586792290211, -0.01734328083693981, 0.010401696898043156, -0.01888110861182213, -0.02597220428287983, -0.011405556462705135, 0.005756175145506859, 0.012697759084403515, -0.01456664688885212, 0.01500450074672699, 0.0075396280735731125, -0.04109417647123337, -0.018560728058218956, -0.04342227801680565, -0.0021986132487654686, -0.016563687473535538, 0.000534635444637388, -0.0009691519080661237, -0.013797733001410961, -0.023772254586219788, -0.025929486379027367, 0.0126870796084404, -0.0030089097563177347, 0.011555067263543606, -0.007657100912183523, -0.011864769272506237, 0.009024059399962425, 0.011320121586322784, 0.013787053525447845, 0.015218088403344154, -0.02093154564499855, -0.02985949069261551, -0.03581857308745384, -0.011661861091852188, -0.02614307403564453, 0.02827894501388073, 0.01876363530755043, 0.014406456612050533, 0.033405039459466934, -0.036010801792144775, -0.009568706154823303, 0.011971562169492245, 0.009269684553146362, -0.03278563544154167, -0.017418036237359047, -0.028513891622424126, -0.029005141928792, 0.012089035473763943, 0.018005400896072388, -0.024434376507997513, 0.023430515080690384, 0.00254569249227643, 0.02844981476664543, 0.003385357093065977, 0.015954963862895966, -0.016531649976968765, 0.025715898722410202, 0.007390117272734642, -0.01745007373392582, -0.0038819473702460527, -0.005401086527854204, 0.00800952035933733, 0.004616153426468372, -0.02394312433898449, 0.004824400879442692, -0.0062047080136835575, -0.04570766165852547, -0.00792942475527525, 0.021326681599020958, 0.020386898890137672, -0.0017313911812379956, -0.004274413920938969, -0.005889667198061943, 0.003385357093065977, -0.016072437167167664, 0.008842510171234608, 0.026911986991763115, -0.023622743785381317, 0.034729279577732086, 0.007288663182407618, 0.017834531143307686, 0.006631882395595312, -0.03966314345598221, -0.004546737298369408, 0.009867728687822819, -0.02872747741639614, -0.0019583276007324457, -0.026228507980704308, 0.02725372649729252, 0.011159931309521198, 0.00901337992399931, -0.04344363510608673, -0.007171190343797207, -0.0015244786627590656, -0.01342395506799221, 0.006946923676878214, -0.007496910635381937, -0.001973011763766408, 0.00023794948356226087, -0.020888827741146088, -0.018539369106292725, 0.0009324416168965399, -0.0110424580052495, 0.0049418737180531025, -0.0055105495266616344, -0.023302363231778145, -0.0032091476023197174, 0.03970586135983467, -0.001360950991511345, -0.0019663372077047825, 0.0033506492618471384, -0.021743176504969597, 0.022426655516028404, -0.011939524672925472, 0.005067356396466494, -0.0006097247241996229, -0.01934032142162323, -0.009141531772911549, -0.009205608628690243, 0.002846049377694726, 0.01306085754185915, 0.022170351818203926, 0.009846369735896587, 0.0012401406420394778, 0.005927044898271561, 0.013947243802249432, -0.008730377070605755, 0.005211527459323406, 0.028492532670497894, -0.01907333731651306, -0.011256045661866665, -0.00026614966918714345, 0.01168322004377842, 0.02236258052289486, -0.026207149028778076, -0.025224648416042328, 0.017695698887109756, 0.007261964958161116, 0.03951363265514374, 0.00487512769177556, 0.01934032142162323, -0.010738096199929714, 0.001242143101990223, -0.0010659336112439632, 0.008463392965495586, 0.0002754941233433783, -0.020119914785027504, -0.015666620805859566, 0.02840709686279297, 0.003636321984231472, -0.025032419711351395, -0.010647322051227093, 0.013178329914808273, 0.0007168520241975784, -0.010818191803991795, -0.0072085680440068245, 0.004931194242089987, -0.013872488401830196, 0.003620303003117442, -0.02364410273730755, -0.0032732237596064806, -0.0025136542972177267, -0.012388058006763458, -0.0017140372656285763, -0.004754985217005014, 0.03090606816112995, 0.023409157991409302, 0.004576105624437332, 0.01989564672112465, 0.03101286105811596, 0.010967702604830265, 0.003454772988334298, -0.015025859698653221, 0.0016125834081321955, 0.025651821866631508, -0.017289884388446808, 0.016990860924124718, 0.049851253628730774, -0.0068775080144405365, -0.01889178715646267, 0.01921216771006584, -0.004317131359130144, 0.0031183732207864523, -0.01198224164545536, 0.010807512328028679, -0.001211439841426909, 0.004167620092630386, -0.010652661323547363, -0.0037404459435492754, -0.00915755145251751, 0.0249683428555727, 0.007662440650165081, 0.006861488800495863, 0.0002721568162087351, -0.00440523587167263, -0.001206100219860673, 0.010374998673796654, 0.016093796119093895, -0.002197278430685401, -0.0232382882386446, -0.003930004313588142, 0.037591345608234406, 0.005574625916779041, -0.03776221722364426, -0.00396738201379776, -0.01349871139973402, -0.00857552606612444, 0.016253985464572906, 0.03357590734958649, -0.010930324904620647, -0.016649121418595314, -0.0077852532267570496, 0.019436435773968697, -0.014470532536506653, 0.011886127293109894, 0.010374998673796654, -6.144803774077445e-05, -0.0005753505392931402, 0.004522709175944328, -0.021102415397763252, -0.004036798141896725, -0.02193540520966053, -0.009253665804862976, 0.014737516641616821, 0.018539369106292725, -0.0016419516177847981, 0.029944924637675285, 0.009846369735896587, -0.042055319994688034, -0.011138572357594967, -0.011704578995704651, 0.002752605127170682, 0.011779334396123886, 0.02221306785941124, 0.008046898059546947, -0.005315651651471853, 0.01003859844058752, -0.026313943788409233, 0.004584115464240313, 0.006007140036672354, 0.009771614335477352, -0.0024549178779125214, -0.0010178765514865518, 0.007016339339315891, 0.0014190200017765164, -0.020109234377741814, -0.019094696268439293, 0.01480159256607294, -0.00952064897865057, 0.00019172788597643375, 0.010529848746955395, 0.010220147669315338, 0.0002122522855643183, -0.010364319197833538, 0.002273368649184704, -0.021540269255638123, 0.03212351351976395, 0.020141273736953735, 0.0029528429731726646, 0.007390117272734642, -0.009835690259933472, -0.0019690070766955614, 0.025950845330953598, 0.046690162271261215, 0.02264024317264557, -0.010989061556756496, 0.012452133931219578, -0.04109417647123337, 0.020258745178580284, -0.013488031923770905, -0.004391886759549379, 0.027061497792601585, 0.020707279443740845, 0.008004180155694485, 0.027616824954748154, -0.0025577067863196135, 0.011576426215469837, 0.013701618649065495, 0.004485331010073423, 0.007710497826337814, -0.003930004313588142, -0.015164691023528576, -0.018571406602859497, 0.005414435639977455, 0.01889178715646267, 0.006407616194337606, -0.024754757061600685, 7.704991003265604e-05, 0.023430515080690384, -0.013594824820756912, 0.0017447404097765684, 0.0038979663513600826, -0.018710238859057426, -0.017781134694814682, 0.027638183906674385, 0.0038338901940733194, 0.01074877567589283, -0.00020758005848620087, -0.016488932073116302, -0.007229926530271769, -0.00397539185360074, -0.014748196117579937, 0.0033773474860936403, 0.0036630204413086176, 0.0164355356246233, 0.004338489845395088, 0.01465208176523447, -0.008607564494013786, 0.007811951916664839, 0.007667780388146639, 0.004309121519327164, -0.0001952320453710854, -0.008757075294852257, -0.012633683159947395, 0.03942819684743881, 0.0001937302586156875, 0.03797580301761627, -0.008191068656742573, 0.02729644440114498, 0.012398736551404, 0.010407036170363426, 0.030393458902835846, -0.0060178195126354694, -0.02351595088839531, -0.023131493479013443, 0.0003287240397185087, -0.009146871976554394, 0.005369048099964857, 0.02985949069261551, 0.02714693360030651, 0.020600484684109688, 0.0057935528457164764, 0.004904496017843485, -0.005884327460080385, 0.026228507980704308, -0.008634262718260288, -0.023750897496938705, -0.00895464327186346, -0.01848597265779972, 0.027317803353071213, -0.017567547038197517, 0.0011607129126787186, -0.025011060759425163, -0.0003984736104030162, 0.027659542858600616, -0.005032648332417011, 0.02669839933514595, -0.001611248473636806, 0.010214807465672493, 0.02669839933514595, 0.008794452995061874, -0.021860649809241295, -0.016051078215241432, -0.007966802455484867, -0.018005400896072388, -0.0007248615729622543, 0.02164706215262413, 0.006946923676878214, 0.013637542724609375, 0.006738676223903894, -0.004180969204753637, 0.00836727861315012, 0.022981982678174973, -0.03248661383986473, 0.018229667097330093, 0.02094222418963909, -0.017054937779903412, -0.0019409736851230264, -0.025587746873497963, 0.013840450905263424, 0.04160678759217262, 0.007801272440701723, -0.0032919126097112894, -0.00261377333663404, 0.0027846430893987417, -0.0029635224491357803, 0.02898378297686577, -0.018806353211402893, -0.015207408927381039, -0.022725677117705345, -0.031141012907028198, 0.03603215888142586, 0.0010919645428657532, 0.0196073055267334, 0.009686179459095001, 0.01590156741440296, 0.02149755135178566, 0.022106274962425232, -0.029389599338173866, -0.013327841646969318, -0.014427815563976765, -0.007849329151213169, -0.005644041579216719, -0.007956122979521751, -0.0035802554339170456, 0.014267625287175179, -0.009467252530157566, 0.017556868493556976, -0.013840450905263424, -0.02597220428287983, 0.021305322647094727, -0.025929486379027367, 0.029218729585409164, 0.0161471925675869, 0.01124536618590355, 0.009077455848455429, 0.01088760793209076, -0.01758890599012375, -0.0039353440515697, -0.005654721055179834, -0.02195676416158676, -0.002625787630677223, -0.010065296664834023, 0.009846369735896587, -0.0010565891861915588, 0.006081895437091589, -0.006226066965609789, -0.0014830961590632796, 0.01060460414737463, -0.0028060018084943295, -0.002061116509139538, -0.0027058827690780163, -0.03017987124621868, 0.0021759194787591696, 0.008639601990580559, 0.014609364792704582, -0.004560086876153946, 0.002987551037222147, -0.01400064118206501, -0.020739316940307617, -0.017054937779903412, -0.0035749156959354877, -0.03244389593601227, -0.0023588035255670547, 0.018656842410564423, 0.005943063646554947, 0.002862068358808756, -0.006642561871558428, 0.0004428597167134285, -0.017663661390542984, 0.01018276996910572, 0.015121974050998688, -0.01321036834269762, -0.007496910635381937, -0.0001922284864122048, 0.004485331010073423, -0.004106213804334402, -0.01748211309313774, 0.0024175401777029037, -0.0047896928153932095, 0.006701298523694277, 0.002514989348128438, -0.0010132042225450277, -0.013947243802249432, -0.02166842110455036, 0.002846049377694726, -0.0008763749501667917, 0.010631303302943707, 0.03393900766968727, 0.01934032142162323, -0.0027712939772754908, 0.00250964961014688, -0.004773674067109823, -0.0016512960428372025, 0.011224007233977318, -0.029987642541527748, 0.015164691023528576, -0.017813172191381454, -0.0062047080136835575, -0.004466642159968615, 0.01126672513782978, -0.015826812013983727, -0.01283659040927887, 0.02524600736796856, 0.009931804612278938, 0.0025270036421716213, 0.008986681699752808, 0.016403496265411377, -0.01689474657177925, 0.0047176070511341095, -0.009120173752307892, 0.03118373081088066, -0.011992921121418476, 0.010011900216341019, -0.017813172191381454, 0.0017006880370900035, 0.043657224625349045, 0.0011460288660600781, -0.005174149759113789, -0.010172090493142605, -0.014769555069506168, 0.0032812333665788174, 0.010759455151855946, 0.0006387592293322086, -0.008100294508039951, 0.0026458115316927433, 0.018080156296491623, -0.000751559971831739, 0.006076555699110031, -0.004845759365707636, -0.022084916010499, 0.015837490558624268, 0.008345919661223888, -0.001975681632757187, -0.01819762960076332, 0.016553007066249847, -0.00939249712973833, 0.011960883624851704, -0.009574046358466148, 0.015036539174616337, -0.009093474596738815, 0.011875448748469353, -0.010588585399091244, 0.004423924721777439, -0.0002840042288880795, 0.005136772058904171, -0.009787633083760738, 0.019511191174387932, 0.0005232886178418994, 0.01932964101433754, -0.001616588095203042, -0.0003036943089682609, -0.006631882395595312, -0.028471173718571663, -0.0160297192633152, 0.0186248030513525, 0.013765694573521614, 0.014780234545469284, -0.014096755534410477, -0.0001897254987852648, 0.01791996695101261, 0.006882847286760807, -0.001136016915552318, 0.009707538411021233, 0.026292584836483, 0.0014737517340108752, -0.016990860924124718, -0.002078470541164279, 0.00042984425090253353, -0.017973363399505615, -0.01515401154756546, 0.018218988552689552, 0.008874548599123955, -0.013018139638006687, 0.01016675028949976, -0.014502570964396, 0.0025496971793472767, 0.008639601990580559, 0.007747875526547432, 0.008538148365914822, 0.00836727861315012, 0.008329900912940502, 0.0014377088518813252, 0.010652661323547363, -0.0014243596233427525, 0.008292523212730885, 0.01427830383181572, -0.005686759017407894, -0.00364166172221303, 0.00515546090900898, 0.001931629260070622, 0.006065876688808203, -0.00156986596994102, 0.007715837564319372, -0.02032282203435898, 0.001423024688847363, -0.013018139638006687, -0.009739575907588005, -0.005606663879007101, -0.019116055220365524, 0.01658504642546177, 0.013819091953337193, -0.0357544980943203, -0.017129693180322647, -0.00461348332464695, 0.01060460414737463, 0.009542007930576801, -0.002781973220407963, -0.0027058827690780163, 0.001954322913661599, 0.018400536850094795, -0.003452103119343519, 0.009066776372492313, -0.004853769205510616, 0.0023561338894069195, -0.0005920370458625257, 0.016798634082078934, 0.004383877385407686, 0.01889178715646267, 0.0010659336112439632, 0.015207408927381039, -0.006861488800495863, -0.010134712792932987, 0.019233526661992073, 0.019169451668858528, 0.010844890028238297, -0.004773674067109823, 0.03302058205008507, -0.007966802455484867, -0.01016675028949976, -0.0037511251866817474, 0.030094437301158905, -0.016553007066249847, -0.01586952805519104, -0.023259645327925682, 0.001702022971585393, 0.00425572507083416, 0.0055425879545509815, 0.02699742279946804, -0.005964422598481178, 0.0077371965162456036, 0.0018995911814272404, 0.01362686324864626, 0.002329435432329774, -0.007731856778264046, -0.0001825503131840378, -0.0038499091751873493, -0.04412711411714554, 0.015367599204182625, -0.0019169450970366597, -0.00880513247102499, -5.093554136692546e-05, 0.02206355705857277, 0.012046318501234055, 0.021316003054380417, -0.002528338460251689, 0.013573466800153255, 0.02136939950287342, -0.027809053659439087, -0.01629670336842537, -0.013573466800153255, 0.005750835407525301, -0.010374998673796654, -0.00024829510948620737, 0.006236746441572905, 0.002851389115676284, 0.01024150662124157, -0.002899446291849017, 0.005240895785391331, -0.005676080007106066, 0.02913329377770424, -0.005953743122518063, 0.011854089796543121, -0.022448014467954636, -0.011950204148888588, 0.011234686709940434, -0.017225807532668114, 0.017108334228396416, -0.008399317041039467, 0.010337620042264462, 0.005638701841235161, -0.02136939950287342, 0.0045974645763635635, 0.008639601990580559, -0.00461348332464695, 0.0058736479841172695, 0.008965322747826576, 0.019703419879078865, 0.010412376374006271, -0.02281111292541027, -0.010989061556756496, -0.009488611482083797, -0.0048350803554058075, -0.01118129026144743, 0.0011687224032357335, -0.013231727294623852, 0.022170351818203926, 0.02684791013598442, -0.018838390707969666, 0.008682319894433022, 0.00544380396604538, -0.0004972576862201095, -0.008233786560595036, -0.025224648416042328, -0.005208857823163271, 0.012249225750565529, 0.009825010783970356, 0.0028967764228582382, 0.01148031186312437, 0.005638701841235161, -0.01189680676907301, 0.04015439376235008, 0.02437029965221882, -0.00822310708463192, -0.02584405057132244, 0.013968602754175663, 0.011608464643359184, 0.017279203981161118, -0.018710238859057426, -0.0008243130869232118, 0.009734236635267735, 0.001425694557838142, -0.007534288335591555, -0.0008576861000619829, -0.012516209855675697, -0.0032118174713104963, 0.027616824954748154, -0.010882267728447914, -0.009130853228271008, 0.018421895802021027, 0.0009291043388657272, -0.001009866944514215, -0.00945657305419445, -0.00021742509852629155, 0.011576426215469837, -3.374844527570531e-05, -0.019415076822042465, 0.0006517746951431036, -0.008324560709297657, -0.007892047055065632, 0.004963232669979334, 0.022341221570968628, -0.00555326696485281, 0.01588020846247673, 0.0142142279073596, -0.0012154446449130774, 0.00184886425267905, 0.01875295676290989, 0.021572306752204895, -0.00974491611123085, -0.028343021869659424, -0.00040014227852225304, 0.01168322004377842, 0.004824400879442692, -0.011704578995704651, 0.010059957392513752, -0.017225807532668114, -0.012078355997800827, 0.04801440238952637, 0.014427815563976765, 0.0029261447489261627, 0.010070636868476868, -4.985091800335795e-05, -0.007261964958161116, 0.0072085680440068245, 0.004242375958710909, 0.03272156044840813, 0.009611424058675766, -0.009040078148245811, 0.0005106069147586823, -0.015549148432910442, 0.013285123743116856, -0.006412955466657877, 0.0049285246059298515, -0.01054052822291851, -0.014919065870344639, -0.015079256147146225, -0.003689718898385763, 0.008602224290370941, 0.0010799502488225698, 0.0002641472965478897, 0.0081590311601758, -0.008281843736767769, 0.00013941570068709552, 0.03274291753768921, -0.014726837165653706, 0.03912917524576187, 0.0007302012527361512, -0.003225166816264391, -0.004736296366900206, 0.021038338541984558, -0.012580285780131817, 0.015944285318255424, -0.02281111292541027, -0.01989564672112465, 0.01789860799908638, -0.0022920577321201563, -0.016777275130152702, 0.0034414236433804035, -0.005280943587422371, 0.014598685316741467, -0.009056096896529198, -0.0029475034680217505, -0.017791813239455223, -0.015186049975454807, 0.01189680676907301, -0.018432576209306717, 0.005064686294645071, -0.011512350291013718, 0.015944285318255424, -0.0006557794404216111, -0.0075983647257089615, 0.01500450074672699, 0.0035054998006671667, -0.005905685946345329, 0.03150411322712898, 0.020130593329668045, 0.016542328521609306, -0.01233466062694788, 0.02855660766363144, 0.016980182379484177, 0.02253345027565956, -0.022191710770130157, -0.02870612032711506, -0.012526889331638813, -0.01356278732419014, -0.005644041579216719, 0.008927945047616959, 0.00548919104039669, -0.0184539332985878, 0.007908065803349018, -0.0005446473369374871, -0.013744336552917957, 0.001247482723556459, 0.005131432320922613, 0.012046318501234055, 0.017396677285432816, 0.015549148432910442, 0.0019022610504180193, -0.0014136802637949586, -0.004026118665933609, 0.011416235938668251, 0.022191710770130157, -0.004199658520519733, -0.004250385332852602, 0.010545868426561356, -0.0019182800315320492, 0.025630464777350426, -0.018859749659895897, -0.019660701975226402, -0.007710497826337814, 0.021433476358652115, -0.0068187713623046875, -0.004832410253584385, 0.007010999601334333, 0.010871588252484798, -0.004309121519327164, 0.011875448748469353, -0.0024696020409464836, 0.015976322814822197, 0.005070026032626629, -0.023580027744174004, 0.018240347504615784, 0.013605504296720028, -0.005612003616988659, -0.012067676521837711, 0.022042198106646538, -0.002456252695992589, 0.010043937712907791, -0.013509389944374561, 0.012163790874183178, 0.005681419279426336, 0.012323981150984764, 0.007390117272734642, -0.004172959830611944, -0.024904267862439156, -0.005214197561144829, 0.0110424580052495, -0.00821776781231165, 0.003956703003495932, -0.0322943851351738, 0.011224007233977318, -0.009878408163785934, 0.001224121660925448, 0.02772361785173416, -0.006770714186131954, 0.010188109241425991, 0.004608144052326679, -0.00816437043249607, -0.014908386394381523, 0.018710238859057426, 0.017834531143307686, 0.005382397212088108, -0.0019770164508372545, -0.002683189231902361, -0.0027339160442352295, 0.00865562167018652, -0.021134452894330025, -0.02195676416158676, 0.01833646185696125, 0.016819991171360016, 0.009776953607797623, 0.0013749676290899515, 0.01233466062694788, 0.004661540500819683, -0.005937724374234676, -0.0024802812840789557, 0.012388058006763458, 0.007294002920389175, -0.02078203484416008, 0.0005513219512067735, -0.03821074962615967, -0.005846949759870768, 0.011854089796543121, 0.013819091953337193, -0.03814667463302612, -0.014983141794800758, -0.001420354819856584, 0.004779013805091381, 0.0023174211382865906, 0.01054052822291851, 0.01506857667118311, -0.01074877567589283, -0.021422795951366425, 0.009878408163785934, 0.0026404717937111855, -0.01001723948866129, -0.014993821270763874, 0.022298503667116165, 0.009819671511650085, 0.007363418582826853, -0.0021265274845063686, 0.01391520630568266, 0.014470532536506653, 0.0033479793928563595, 0.008602224290370941, -0.004514699336141348, 0.006824111100286245, -0.0011006415588781238, 0.010214807465672493, -0.011512350291013718, 0.024797473102808, 0.03592536598443985, -0.030478892847895622, -0.0044452836737036705, -0.014406456612050533, 0.012356019578874111, -4.985091800335795e-05, -0.01262300368398428, 0.016627764329314232, -0.002556371735408902, -0.015517110005021095, -0.013477352447807789, -0.009002700448036194, 0.007956122979521751, -0.03186720982193947, -0.01270843856036663, 0.04143591597676277, -0.005777533631771803, -0.016350099816918373, -0.022554807364940643, -0.003003570018336177, 0.010567226447165012, -0.013327841646969318, 0.006727996747940779, 0.019447114318609238, -0.006402276456356049, -0.011992921121418476, 0.01081285160034895, -0.0034280745312571526, -0.004277083557099104, -0.0002639804151840508, 0.009381817653775215, 0.0113308010622859, -0.016563687473535538, 0.010086655616760254, 0.011053137481212616, -0.016713198274374008, -0.0017607595073059201, 0.020440295338630676, -0.003628312610089779, -0.01688406802713871, -0.015784094110131264, -0.01349871139973402, -0.010268204845488071, 0.010844890028238297, -0.02321692928671837, -0.004229026380926371, -0.0009030733490362763, 0.004119562916457653, 0.004429264459758997, -0.004720277152955532, -0.0029715318232774734, -0.013178329914808273, -0.0374845527112484, -0.005307641811668873, 0.013637542724609375, 0.011715257540345192, -0.002781973220407963, 0.0022706990130245686, -0.010786153376102448, 0.022020841017365456, -0.011127892881631851, 0.014192868955433369, 0.0068775080144405365, 0.015175370499491692, 0.00822310708463192, 0.002569721080362797, -0.019009260460734367, 0.0003083665214944631, 0.002205287804827094, 0.0035001602955162525, 0.014577326364815235, 0.014983141794800758, -0.014171510934829712, 0.0005399751244112849, -0.03299922123551369, 0.018571406602859497, 0.005005950108170509, 0.005494530778378248, 0.015762735158205032, 0.009232306852936745, 0.007507590111345053, 0.004389217123389244, -0.0113308010622859, 0.004845759365707636, -0.028364380821585655, -0.013883167877793312, 0.0158588495105505, 0.0095153097063303, 0.00047322912723757327, -0.012804552912712097, -0.022875189781188965, -0.01255892775952816, 0.02441301755607128, -0.003163760295137763, -0.013733657076954842, 0.019415076822042465, 0.012035639025270939, -0.007358078844845295, 0.011095855385065079, 0.01860344596207142, -0.006007140036672354, 0.003169100033119321, -0.00045921248965896666, 0.014684120193123817, 0.0337894931435585, -0.013541428372263908, 0.001838184893131256, 0.009024059399962425, 0.00454940740019083, 0.007886707782745361, 0.030799273401498795, 0.023729538545012474, -0.00807893555611372, -0.020749997347593307, -0.028193511068820953, 0.0007495575700886548, 0.001117995474487543, 0.019991761073470116, -0.0062047080136835575, 0.005256914999336004, -0.008757075294852257, -0.012014280073344707, -0.026655683293938637, -0.006706638261675835, -0.008420675061643124, -0.0035161792766302824, -0.00974491611123085, 0.003147741314023733, 0.009093474596738815, 0.011843410320580006, -0.005820251069962978, -0.00042383710388094187, 0.009584725834429264, -0.016403496265411377, 0.009237646125257015, -0.008361938409507275, 0.010027918964624405, 0.02697606384754181, 0.006081895437091589, -0.0005403088871389627, 0.005136772058904171, -0.00657314620912075, 0.008479411713778973, 0.007379437796771526, -0.012366699054837227, -0.018656842410564423, 0.018966542556881905, 0.015271484851837158, 0.002514989348128438, -0.032251667231321335, -0.007438174448907375, -0.015282164327800274, -0.015111294575035572, -0.03769814223051071, 0.017054937779903412, -0.006140632089227438, 0.007998840883374214, 0.004218347370624542, -0.007155171129852533, 0.0039353440515697, -0.006706638261675835, 0.009045418351888657, 0.01702290028333664, 0.026612965390086174, -0.03502830117940903, -0.023622743785381317, 0.011352160014212132, -0.006407616194337606, 0.003844569670036435, -0.013968602754175663, 0.015677301213145256, 0.011704578995704651, 0.0012568271486088634, -0.016563687473535538, 0.03438754007220268, 0.01675591617822647, 0.0054838513024151325, 0.01456664688885212, 0.014577326364815235, -0.011555067263543606, -0.0058149113319814205, 0.013530748896300793, 0.016553007066249847, 0.004223686642944813, 0.005820251069962978, 0.00713915191590786, -0.0056280228309333324, 0.01905197836458683, -0.004437274299561977, 0.002990220906212926, 0.008474072441458702, 0.004156941082328558, 0.009440554305911064, -0.013925885781645775, 0.019650021567940712, -0.014459853060543537, -0.007924085482954979, -0.01544235460460186, 0.002781973220407963, 0.0009331090841442347, 0.016403496265411377, 0.011971562169492245, -0.023750897496938705, 0.015250125899910927, -0.007064396515488625, 0.005606663879007101, -0.008297862485051155, -0.006546447519212961, -0.00025680524413473904, -0.014342380687594414, -0.001389651675708592, 0.010407036170363426, -0.005526568740606308, -0.020002441480755806, 0.0028834270779043436, -0.003692388767376542, 0.005889667198061943, 0.015538468956947327, 0.003251865040510893, 0.0002032415650319308, 0.004781683441251516, -0.005134102422744036, 0.005878987722098827, -0.004140921868383884, -0.005825590807944536, -0.0005069358740001917, 0.0008817146299406886, -0.016264665871858597, -1.1419823522373918e-06, 0.026506170630455017, -0.005740155931562185, -0.00959540531039238, 0.014491891488432884, 0.01599768176674843, 0.01704425923526287, -0.004514699336141348, 0.01777045428752899, 0.027168292552232742, 0.014887027442455292, -0.001577875460498035, 0.015538468956947327, 0.010412376374006271, 0.00017086975276470184, -0.014758875593543053, -0.01537827868014574, 0.022768395021557808, -0.00010854568245122209, 0.011640502139925957, 0.019543228670954704, 0.010652661323547363, -0.014598685316741467, -0.005868308246135712, -0.0005967092583887279, -0.023601384833455086, -0.014491891488432884, -0.006824111100286245, -0.016937464475631714, 0.0016806642524898052, 0.011352160014212132, 0.004891146905720234, 0.00893328431993723, 0.0038205410819500685, 0.022554807364940643, 0.005505210254341364, -0.00627946387976408, -0.010129372589290142, 0.034280747175216675, -0.0012014280073344707, 0.016499610617756844, 0.012740476056933403, -0.0035936045460402966, 0.017407355830073357, 0.011202648282051086, -0.0044586327858269215, -0.005222206935286522, -0.021999482065439224, -0.0010739431018009782, 0.004058156628161669, -0.009253665804862976, -0.02236258052289486, 0.03259340673685074, 0.015260805375874043, 0.015613224357366562, -0.0010258860420435667, 0.008911926299333572, -0.018218988552689552, 0.005921705160290003, 0.017396677285432816, 0.013445314019918442, 0.01847529225051403, -0.0009297718061134219, -0.022148992866277695, 0.0014030009042471647, -0.014769555069506168, 0.01480159256607294, -0.009205608628690243, 0.018560728058218956, -0.008821151219308376, 0.0024696020409464836, -0.007699818350374699, -0.006455672904849052, 0.0058736479841172695, -0.026890628039836884, 0.006028498522937298, 0.007160510867834091, -0.01991700567305088, 0.007475552149116993, -0.017524829134345055, -0.013744336552917957, 0.016969503834843636, 0.013167650438845158, 0.0013435969594866037, 0.00014892700710333884, 0.016243306919932365, -0.000309868308249861, 0.010706058703362942, 0.007112453691661358, 0.019425755366683006, 0.009782293811440468, 0.012569606304168701, -0.014630722813308239, -0.003169100033119321, 0.002484286203980446, 0.013616183772683144, 0.00512342294678092, -0.015794772654771805, 0.002827360527589917, -0.0066532413475215435, -0.0038952964823693037, -0.009109494276344776, -0.021401436999440193, 0.004656200762838125, -0.006423634942620993, 0.014118113555014133, -0.018849071115255356, 0.025310082361102104, -0.006882847286760807, -0.012751155532896519, -0.007854669354856014, 0.0036790394224226475, 0.0020183990709483624, -0.016275344416499138, 0.02366546168923378, 0.003954032901674509, -0.008415335789322853, -0.007571666035801172, 0.00821776781231165, 0.0030623064376413822, 0.0095153097063303, 0.004170290194451809, -0.007945443503558636, -0.002070460934191942, 0.00893328431993723, -0.008607564494013786, -0.003150411183014512, 0.01406471710652113, -0.013904526829719543, -0.011170610785484314, 0.007480891887098551, -0.022469373419880867, -0.006792073138058186, 0.0007008329848758876, -0.010615283623337746, 0.017129693180322647, 0.009056096896529198, -0.01412879303097725, -0.010460433550179005, 0.0007602369296364486, -0.007662440650165081, 0.01119196880608797, -0.014694799669086933, -0.0042210170067846775, 0.019383037462830544, 0.009040078148245811, 0.012217188253998756, 0.0011987581383436918, -0.005150121171027422, -0.006589164957404137, 0.007240606006234884, -0.01082887127995491, -0.008917265571653843, -0.0011213327525183558, 0.0007035028538666666, 0.0008229781524278224, -0.022768395021557808, -0.0033266206737607718, -0.0013242405839264393, 0.03216623142361641, -0.017140373587608337, -0.014993821270763874, -0.002982211299240589, -0.004325140733271837, -0.02454116940498352, -0.0013335851253941655, -0.006647901609539986, 0.0032598746474832296, -0.008052237331867218, 0.014780234545469284, -0.02293926477432251, -0.007683799602091312, 0.008436694741249084, -0.011875448748469353, 0.011918165720999241, -0.01974613592028618, -0.026655683293938637, -0.003078325418755412, 0.016787953674793243, 0.014246266335248947, 0.008895906619727612, -0.00411155354231596, 0.014107434079051018, 0.011298762634396553, -0.009712877683341503, 0.0027419256512075663, -0.014321021735668182, -0.020173311233520508, -0.0226616021245718, 0.027381878346204758, 0.014342380687594414, -0.01732192188501358, -0.00901337992399931, -0.010225486941635609, -0.007779913954436779, -0.001694013481028378, -0.014983141794800758, 0.026612965390086174, 6.0227835092518944e-06, -0.012879308313131332, 0.020536409690976143, -0.03799716383218765, -0.001936968881636858, -0.007064396515488625, -0.019415076822042465, 0.001120665343478322, -0.006402276456356049, 0.029240088537335396, -0.011555067263543606, -0.012548248283565044, 0.005465162452310324, 0.006439654156565666, -0.019415076822042465, 0.021251926198601723, -0.0005536580574698746, -0.004648191388696432, -0.007961463183164597, -0.018987901508808136, -0.002362808445468545, -0.013787053525447845, -0.0026818541809916496, -0.01081285160034895, -0.016852030530571938, 0.011416235938668251, 0.014331701211631298, 0.020023800432682037, -0.019553907215595245, 0.03030802309513092, 0.02970997989177704, 0.004015439189970493, 0.0028246906585991383, -0.01730056293308735, 0.015987001359462738, -0.002260019537061453, 0.008570186793804169, -0.007486231159418821, -0.01227058470249176, -0.01032694149762392, 0.012238546274602413, -0.01074877567589283, 0.000939783698413521, 0.016531649976968765, 0.013797733001410961, 0.009173570200800896, 0.012505530379712582, -0.004250385332852602, 0.029389599338173866, 0.005804232321679592, -0.002727241488173604, -0.02064320258796215, -0.027381878346204758, -0.004819061141461134, 0.0007922750082798302, -0.009638122282922268, -0.006001800298690796, -0.0002713224967010319, -0.00939249712973833, -0.004650861490517855, -0.002484286203980446, 0.0017834531608968973, 0.004544067662209272, -0.010070636868476868, -0.01487634889781475, 0.013007460162043571, -0.003233176190406084, -0.020258745178580284, 0.01745007373392582, 0.019682060927152634, -0.027339162304997444, 0.014299662783741951, -0.022554807364940643, 0.00909881480038166, 0.00016945140669122338, -0.0020998292602598667, 0.0060178195126354694, -0.00916289072483778, 0.007416815496981144, 0.004066166467964649, 0.009995880536735058, 0.0047176070511341095, 0.005433124490082264, -0.012131753377616405, 0.019553907215595245, 0.006557126995176077, -0.019991761073470116, 0.00931240152567625, -0.008244466036558151, 0.006327520590275526, -0.008500770665705204, 0.016830671578645706, 0.003783163381740451, -0.0027712939772754908, -0.0028246906585991383, 0.014043358154594898, -0.010364319197833538, 0.012783193960785866, -0.004645521752536297, 0.013114253990352154, -0.0019690070766955614, 0.00305162719450891, -0.011256045661866665, 0.010641981847584248, -0.008292523212730885, 0.015538468956947327, -0.034430257976055145, 0.016083115711808205, 0.0009164225775748491, 0.012900667265057564, -0.01745007373392582, 0.004754985217005014, -0.0014577326364815235, -0.0009951828978955746, -0.0013589485315605998, 0.00952064897865057, -0.019820891320705414, -0.008735716342926025, -0.007123133167624474, -0.0018688880372792482, -0.004357178695499897, 0.013883167877793312, 0.001851534005254507, 0.005740155931562185, -0.0064289746806025505, -0.02441301755607128, 0.0011640501907095313, -0.0031023540068417788, -0.0058736479841172695, 0.0395563505589962, 0.008143012411892414, -0.003927334677428007, -0.0012588296085596085, 0.022042198106646538, 0.019714098423719406, -0.010220147669315338, -0.0051074037328362465, -0.006247425451874733, 0.0197781752794981, -0.0001536826603114605, -0.03504965826869011, 0.0025056449230760336, 0.013445314019918442, 0.02844981476664543, -0.01386180892586708, -0.014726837165653706, 0.024007201194763184, -0.023750897496938705, 0.016542328521609306, -0.02379361353814602, 0.0017460753442719579, 0.017204448580741882, -0.0025016400031745434, -0.0009905106853693724, 0.031076937913894653, 0.013306482695043087, -0.01861412450671196, 0.011875448748469353, -0.007710497826337814, -0.0034414236433804035, 0.016232626512646675, 0.01976749487221241, 0.017428714781999588, 0.0002913462813012302, 0.004714937414973974, -0.01168322004377842, 0.008847849443554878, -0.009504630230367184, -0.025160571560263634, 0.015367599204182625, 0.01859276555478573, -0.005187499336898327, 0.008554167114198208, 0.02064320258796215, 0.0017394007882103324, 0.001903595868498087, 0.010300242342054844, -0.013925885781645775, 0.016275344416499138, -0.005054007284343243, 0.0016512960428372025, -0.017727738246321678, -0.013167650438845158, 0.010796832852065563, 0.0033426396548748016, -0.002476276597008109, -0.007438174448907375, -0.027040138840675354, 0.0034254046622663736, -0.022319862619042397, -0.013135612942278385, -0.026014920324087143, 0.004389217123389244, 0.01861412450671196, 0.005110073834657669, -0.0003527525987010449, -0.02624986693263054, 0.013722977600991726, 0.008532808162271976, 0.006733336485922337, -0.0192014891654253, -0.01124536618590355, 0.012954063713550568, -0.01427830383181572, 0.0037377760745584965, 0.005235556047409773, 0.003692388767376542, 0.028086716309189796, -0.00421567726880312, -0.011448273435235023, -0.009024059399962425, -0.011992921121418476, -0.012131753377616405, 0.026292584836483, -0.0059323846362531185, 0.002053106902167201, 0.00411155354231596, 0.015762735158205032, 0.020696599036455154, -0.004322471097111702, -0.0030436175875365734, 0.015196729451417923, 0.009120173752307892, -0.019233526661992073, -0.024882908910512924, 0.008169710636138916, -0.0024909607600420713, -0.004087524954229593, -0.001694013481028378, 0.010145392268896103, 0.02221306785941124, 0.011448273435235023, 0.010930324904620647, 0.013285123743116856, 0.024007201194763184, -0.014705479145050049, -0.002285382943227887, 0.0019249545875936747, 0.01803743839263916, -0.015164691023528576, -0.019084015861153603, -0.013488031923770905, -0.01081285160034895, 0.00021642389765474945, 0.014011320658028126, 0.018507331609725952, 0.020536409690976143, -0.010700718499720097, -0.0008363273809663951, 0.013957923278212547, -0.017108334228396416, -0.012302623130381107, -0.006439654156565666, -0.010268204845488071, -0.009632783010601997, 0.019521869719028473, 0.008393976837396622, -0.018859749659895897, 0.014726837165653706, 0.028471173718571663, -0.016371458768844604, -0.0025270036421716213, 0.010674020275473595, 0.003785833017900586, 0.0022813782561570406, 0.00025029751122929156, -0.02624986693263054, -0.01471615768969059, 0.009590065106749535, 0.008388637565076351, 0.009008039720356464, -0.011928845196962357, 0.0036656903102993965, -0.014812272042036057, -0.017791813239455223, 0.03103422001004219, -0.013381238095462322, -0.008778434246778488, 0.009285703301429749, 0.018518010154366493, -0.00960074458271265, -0.007822630926966667, 0.009728897362947464, -0.004493340849876404, 0.018806353211402893, -0.015687979757785797, -0.013755016028881073, -0.015453034080564976, 0.008303202688694, -0.015976322814822197, -0.020557768642902374, 0.0192014891654253, -0.004578775726258755, -0.011127892881631851, 0.009611424058675766, -0.01053518895059824, -0.002190603641793132, 0.006685279309749603, -0.03705737739801407, -0.010401696898043156, -0.003788502886891365, 0.019959723576903343, -0.01386180892586708, -0.01364822220057249, 0.0037457854487001896, -0.013904526829719543, 0.003978061489760876, 0.009584725834429264, 0.008890567347407341, 0.02238393761217594, 0.012580285780131817, -0.007571666035801172, 0.011234686709940434, -0.0038685982581228018, 0.004808381665498018, -0.007235266268253326, 0.004666880238801241, -0.013381238095462322, 0.004690908826887608, -0.009194929152727127, 0.003911315463483334, -0.002133202040567994, -0.001084622461348772, 0.003313271328806877, 0.02740323729813099, 0.0069843013770878315, 0.0026324621867388487, -0.02582269161939621, 0.007123133167624474, -0.01848597265779972, -0.009670160710811615, 5.9070211136713624e-05, 0.027189649641513824, 0.01590156741440296, 0.013039498589932919, 0.007016339339315891, 0.023879049345850945, -0.002628457499668002, -0.011341480538249016, 0.0011693899286910892, -0.0021625703666359186, -0.00995316356420517, 0.001920949900522828, -0.009114833548665047, -0.003572245826944709, -0.006840129848569632, 0.0013576135970652103, -0.002425549551844597, -0.011469632387161255, -0.0022840481251478195, -0.0012221192009747028, -0.00548919104039669, -0.012569606304168701, -0.018379177898168564, -0.005008619744330645, 7.164765975176124e-06, -0.010497811250388622, 0.01974613592028618, -0.017674339935183525, 0.015463713556528091, 0.01919081062078476, -0.0017487452132627368, -0.01154438778758049, -0.005505210254341364, 0.022448014467954636, 0.029923567548394203, 0.012313301675021648, -0.009563366882503033, -0.014662761241197586, -0.02338779903948307, -0.0013856469886377454, -0.0012067676289007068, -0.018849071115255356, -0.0002593082026578486, -0.007165850605815649, -0.014769555069506168, -0.011213327758014202, -0.01089294720441103, -0.0052248770371079445, -0.011362838558852673, 0.01515401154756546, -0.006188689265400171, -0.02107037790119648, 0.01465208176523447, -0.016286024823784828, 0.02872747741639614, -0.003460112726315856, 0.01932964101433754, -0.00021792568441014737, -0.0034173952881246805, 0.015698658302426338, 0.005419775377959013, -0.015954963862895966, -0.024220788851380348, 0.01443849503993988, 0.01819762960076332, -0.021316003054380417, -0.007080415729433298, 0.019810212776064873, 0.0037377760745584965, -0.02439165860414505, -0.008036218583583832, 0.012131753377616405, -0.014523929916322231, 0.010577905923128128, -0.0010132042225450277, 0.012526889331638813, 0.006108594126999378, 0.0013275779783725739, -0.010802173055708408, -0.007037698291242123, -0.01480159256607294, -0.018368499353528023, 0.013445314019918442, -0.025331441313028336, 0.002984881168231368, 0.007940104231238365, -0.03235846012830734, 0.01126672513782978, 0.00472561689093709, -0.0059590828604996204, -0.006845469586551189, -0.006359559018164873, -0.001702022971585393, -0.011202648282051086, 0.026591606438159943, -0.0035001602955162525, 0.0007896051974967122, -0.007096434477716684, -0.00046321723493747413, -0.014160831458866596, -0.008084275759756565, 0.010924985632300377, 0.05929180607199669, -0.007384777534753084, 0.019831571727991104, -0.019842250272631645, 0.006626542657613754, 0.019874289631843567, 0.03203808143734932, 0.004415915347635746, -0.007059056777507067, 0.02092086710035801, 0.0017207118216902018, -0.0057348161935806274, 0.026805194094777107, 0.019874289631843567, 0.012024959549307823, 0.021401436999440193, 0.0010465772356837988, 0.013477352447807789, -0.0039353440515697, -0.004442613571882248, -0.006888187024742365, -0.012889987789094448, -0.012291943654417992, -0.006151311565190554, -0.018122874200344086, 0.011021099053323269, 0.034579768776893616, -0.0010906296083703637, -0.009509970434010029, -0.009841030463576317, -0.009584725834429264, -0.012580285780131817, 0.004116893280297518, 0.01657436601817608, 0.01062062382698059, -0.004722946789115667, 0.01391520630568266, -0.006060536950826645, 0.032806992530822754, -0.023024700582027435, 0.006450333632528782, -0.03214487433433533, -0.0022453353740274906, 0.02469068020582199, 0.010935664176940918, -0.00674935569986701, -0.010198788717389107, 0.025288725271821022, -0.006615863647311926, 0.005043327808380127, 0.010428395122289658, 0.01529284380376339, 0.005515889264643192, -0.0020330832339823246, -0.018379177898168564, -0.012516209855675697, 0.01349871139973402, 0.04051749035716057, -0.004015439189970493, 0.014224907383322716, -0.009509970434010029, -0.008356599137187004, -0.007614383473992348, 0.04026118665933609, -0.0028246906585991383, -0.002332105301320553, -0.007913406006991863, 0.011918165720999241, 0.005724136717617512, -0.009419195353984833, -0.0008643607143312693, -0.02036553993821144, 0.009317741729319096, -0.006172670051455498, -0.006946923676878214, -0.0224907323718071, 0.015239446423947811, -0.009947823360562325, -0.021123774349689484, -0.011907486245036125, 0.005467832088470459, -0.006525089032948017, -0.006386257242411375, 0.02511785551905632, 0.009189588949084282, -0.0019262895220890641, -0.01573069766163826, 0.030094437301158905, 0.0012661715736612678, -0.016766594722867012, 0.004026118665933609, -0.040325261652469635, 0.002843379508703947, -0.012804552912712097, -0.018357818946242332, 0.003628312610089779, -0.0016152531607076526, 0.024434376507997513, 0.0031744397711008787, -0.010641981847584248, 0.01932964101433754, -0.004666880238801241, 0.030073078349232674, -0.002393511589616537, -0.006610523909330368, 0.019553907215595245, -0.0057935528457164764, 0.001903595868498087, -0.0011066487058997154, -0.014160831458866596, 0.005574625916779041, 0.013957923278212547, -0.06488779187202454, -0.001459067570976913, -0.02306741662323475, 0.00010495808237465099, -0.024455733597278595, 0.014694799669086933, -0.011341480538249016, -0.017845209687948227, -0.004872458055615425, 0.006530428770929575, -0.0027072178199887276, 0.017268525436520576, 0.009061437100172043, -0.0039353440515697, 0.01572001725435257, 0.001340259681455791, 0.019383037462830544, -0.022298503667116165, -0.001456397701986134, -0.01947915181517601, -0.03003036044538021, -0.009760934859514236, 0.011159931309521198, 0.01878499425947666, -0.003404045943170786, 0.017717057839035988, 0.004466642159968615, 0.018432576209306717, 0.004952553194016218, -0.013509389944374561, -0.006914885714650154, 0.012142431922256947, -0.009216288104653358, 0.013445314019918442, -0.015784094110131264, -0.017001541331410408, -0.019116055220365524, 0.022725677117705345, -0.01053518895059824, 0.005230216775089502, -0.007229926530271769, -0.008110973984003067, -0.04404168203473091, 0.03242253512144089, 0.011533708311617374, -0.011053137481212616, 0.0014830961590632796, 0.007010999601334333, -0.002102498896420002, -0.0014871008461341262, 0.007518269587308168, -0.008522129617631435, -0.007662440650165081, -0.008602224290370941, 0.011587105691432953, 0.0023334401194006205, -0.008143012411892414, -0.002288052812218666, 0.012857949361205101, -0.004544067662209272, -0.003153081052005291, -0.02291790582239628, -0.00569743849337101]\n" + ] + } + ], + "source": [ + "print(f\"Vector 1: {vector1}\")" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "9d3b1fa6", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3072\n" + ] + } + ], + "source": [ + "print(embedder.dimension_number())" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "008ca87d", + "metadata": {}, + "outputs": [], + "source": [ + "from src.TextManager.biblioteca import Biblioteca\n", + "from src.TextManager.biblioteca_mmr import BibliotecaRepo\n", + "\n", + "\n", + "\n", + "biblioteca = Biblioteca(nombre=\"biblioteca_de_prueba\",\n", + " embedder=embedder,\n", + " )\n", + "\n", + "\n", + "# rerobiblio = BibliotecaRepo(conexion_admin)\n", + "# rerobiblio.add(biblioteca)\n", + "\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "943d0deb", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "E:\\Fitz_Studio\\src\\TextManager\\notas_biblioteca_mmr.py:51: SAWarning: This declarative base already contains a class with the same class name and module name as src.TextManager.notas_biblioteca_mmr.NotaModel, and will be replaced in the string-lookup table.\n", + " mapper_registry.map_imperatively(NotaModel, tabla)\n" + ] + }, + { + "data": { + "text/plain": [ + "'NOTA20250510-ec1a2f971d867643070'" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from src.base import Base\n", + "from src.TextManager.nota import Nota\n", + "from src.Llms.Embedders.Openai_embedder import OpenAIEmbedder\n", + "from src.ApiKeys.openai_apikey import OpenAICredencial\n", + "from src.TextManager.biblioteca import Biblioteca\n", + "from src.TextManager.notas_biblioteca_mmr import NotaRepo\n", + "\n", + "conexion = conexion_admin\n", + "embedder = OpenAIEmbedder(credencial_openai, model=\"text-embedding-3-large\")\n", + "biblioteca = Biblioteca(nombre=\"Física Cuántica\", embedder=embedder)\n", + "\n", + "# Crear tabla si no existe\n", + "NotaModel = biblioteca.generar_modelo_notas(conexion)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "f1726302", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'NOTA20250510-a1f15163f2041347124'" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "texto = \"Este es un texto de prueba\"\n", + "\n", + "\n", + "# Guardar una nota\n", + "nota = Nota(\n", + " titulo=\"Entrelazamiento cuántico\",\n", + " tags=[\"cuántica\", \"teoría\"],\n", + " conexiones=[],\n", + " texto=texto,\n", + " vector=embedder.encoder(texto)\n", + ")\n", + "\n", + "repo = NotaRepo(conexion.get_session(), NotaModel)\n", + "repo.add(nota)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": ".venv", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.11" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Credenciales.ipynb b/Credenciales.ipynb index aa4db09..e96fe23 100644 --- a/Credenciales.ipynb +++ b/Credenciales.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "5206b9c6", "metadata": {}, "outputs": [], @@ -14,7 +14,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 2, "id": "63a0b954", "metadata": {}, "outputs": [], @@ -25,7 +25,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "id": "0575f424", "metadata": {}, "outputs": [], @@ -38,17 +38,17 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "id": "a5266309", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "1" + "'PGCR20250510-02f3cf9610127084237'" ] }, - "execution_count": 3, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -72,7 +72,7 @@ } ], "source": [ - "modelo_cred = repo_cred.get_by_id(1)\n", + "modelo_cred = repo_cred.get_by_id(\"PGCR20250510-02f3cf9610127084237\")\n", "\n", "print(modelo_cred.titulo)" ] diff --git a/backend/api/v1/endpoints/text_manager.py b/backend/api/v1/endpoints/text_manager.py new file mode 100644 index 0000000..a71ea68 --- /dev/null +++ b/backend/api/v1/endpoints/text_manager.py @@ -0,0 +1,26 @@ +from fastapi import APIRouter, HTTPException +from pydantic import BaseModel +from typing import Optional +from backend.db.conexion import get_conexion +from src.TextManager.biblioteca import Biblioteca + +router = APIRouter() + +class BibliotecaIn(BaseModel): + nombre: str + descripcion: Optional[str] = "" + vector_dim: Optional[int] = None + +@router.post("/") +def crear_biblioteca(biblio: BibliotecaIn): + try: + biblioteca = Biblioteca( + nombre=biblio.nombre, + descripcion=biblio.descripcion, + vector_dim=biblio.vector_dim + ) + conexion = get_conexion() + modelo = biblioteca.generar_modelo_notas(conexion) + return {"id": biblioteca.id, "modelo": str(modelo.__name__)} + except Exception as e: + raise HTTPException(status_code=400, detail=str(e)) diff --git a/backend/api/v1/router.py b/backend/api/v1/router.py index ce65d24..52140eb 100644 --- a/backend/api/v1/router.py +++ b/backend/api/v1/router.py @@ -1,7 +1,8 @@ # backend/api/router.py from fastapi import APIRouter -from backend.api.v1.endpoints import ping +from backend.api.v1.endpoints import ping, nota, text_manager router = APIRouter() -router.include_router(ping.router, prefix="/api/v1") \ No newline at end of file +router.include_router(ping.router, prefix="/api/v1/ping") +router.include_router(text_manager.router, prefix="/api/v1/bibliotecas") \ No newline at end of file diff --git a/backend/db/__init__.py b/backend/db/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/db/conexion.py b/backend/db/conexion.py new file mode 100644 index 0000000..514653f --- /dev/null +++ b/backend/db/conexion.py @@ -0,0 +1,19 @@ +from src.ConexionSql.Postgres_conexion import PostgresConexion +from src.Credenciales.postgres_credencial import PostgresCredencial +from dotenv import load_dotenv +import os +from entrypoint import ENV_PATH + +# Cargar .env +load_dotenv(ENV_PATH) + +def get_conexion(): + db_credencial = PostgresCredencial( + titulo=os.getenv("DB_TITLE"), + user=os.getenv("DB_USER"), + password=os.getenv("DB_PASSWORD"), + host=os.getenv("DB_HOST"), + port=os.getenv("DB_PORT"), + dbname=os.getenv("DB_NAME") + ) + return PostgresConexion(db_credencial) \ No newline at end of file diff --git a/backend/main.py b/backend/main.py index f2ac31b..0482751 100644 --- a/backend/main.py +++ b/backend/main.py @@ -13,7 +13,7 @@ app = FastAPI( # Configuración de CORS app.add_middleware( CORSMiddleware, - allow_origins=["http://localhost:5173"], # Solo permite tu frontend local + allow_origins=["http://localhost:5173", "http://0.0.0.0:5173"], # Solo permite tu frontend local allow_credentials=True, allow_methods=["*"], allow_headers=["*"], diff --git a/data/files/txt/tree.txt b/data/files/txt/tree.txt index 117d44a..14726f1 100644 --- a/data/files/txt/tree.txt +++ b/data/files/txt/tree.txt @@ -41,6 +41,7 @@ E:\Fitz_Studio │ │ ├── 0e │ │ ├── 10 │ │ ├── 11 +│ │ ├── 13 │ │ ├── 15 │ │ ├── 17 │ │ ├── 18 @@ -55,9 +56,11 @@ E:\Fitz_Studio │ │ ├── 22 │ │ ├── 23 │ │ ├── 24 +│ │ ├── 25 │ │ ├── 26 │ │ ├── 27 │ │ ├── 28 +│ │ ├── 2b │ │ ├── 2c │ │ ├── 2d │ │ ├── 2f @@ -65,11 +68,14 @@ E:\Fitz_Studio │ │ ├── 32 │ │ ├── 33 │ │ ├── 34 +│ │ ├── 36 │ │ ├── 39 +│ │ ├── 3a │ │ ├── 3c │ │ ├── 3d │ │ ├── 3e │ │ ├── 3f +│ │ ├── 40 │ │ ├── 41 │ │ ├── 42 │ │ ├── 43 @@ -83,10 +89,14 @@ E:\Fitz_Studio │ │ ├── 4d │ │ ├── 4e │ │ ├── 4f +│ │ ├── 50 │ │ ├── 51 │ │ ├── 52 │ │ ├── 55 +│ │ ├── 56 │ │ ├── 57 +│ │ ├── 58 +│ │ ├── 59 │ │ ├── 5a │ │ ├── 5b │ │ ├── 5c @@ -100,6 +110,7 @@ E:\Fitz_Studio │ │ ├── 65 │ │ ├── 67 │ │ ├── 69 +│ │ ├── 6b │ │ ├── 6c │ │ ├── 6d │ │ ├── 6e @@ -109,27 +120,33 @@ E:\Fitz_Studio │ │ ├── 75 │ │ ├── 76 │ │ ├── 77 +│ │ ├── 79 │ │ ├── 7b │ │ ├── 7c │ │ ├── 7d │ │ ├── 7f │ │ ├── 80 │ │ ├── 81 +│ │ ├── 82 │ │ ├── 83 │ │ ├── 84 │ │ ├── 85 +│ │ ├── 86 │ │ ├── 87 │ │ ├── 89 │ │ ├── 8a │ │ ├── 8b │ │ ├── 8c +│ │ ├── 8d │ │ ├── 90 +│ │ ├── 92 │ │ ├── 94 │ │ ├── 95 │ │ ├── 97 │ │ ├── 98 │ │ ├── 99 │ │ ├── 9a +│ │ ├── 9b │ │ ├── 9c │ │ ├── 9d │ │ ├── a0 @@ -148,7 +165,9 @@ E:\Fitz_Studio │ │ ├── ad │ │ ├── ae │ │ ├── af +│ │ ├── b0 │ │ ├── b1 +│ │ ├── b2 │ │ ├── b3 │ │ ├── b4 │ │ ├── b5 @@ -158,6 +177,7 @@ E:\Fitz_Studio │ │ ├── ba │ │ ├── bb │ │ ├── bc +│ │ ├── bd │ │ ├── bf │ │ ├── c0 │ │ ├── c3 @@ -171,6 +191,7 @@ E:\Fitz_Studio │ │ ├── ce │ │ ├── cf │ │ ├── d1 +│ │ ├── d3 │ │ ├── d4 │ │ ├── d5 │ │ ├── d6 @@ -184,6 +205,8 @@ E:\Fitz_Studio │ │ ├── de │ │ ├── df │ │ ├── e0 +│ │ ├── e1 +│ │ ├── e2 │ │ ├── e3 │ │ ├── e4 │ │ ├── e5 @@ -202,6 +225,7 @@ E:\Fitz_Studio │ │ ├── f6 │ │ ├── f7 │ │ ├── f9 +│ │ ├── fa │ │ ├── fb │ │ ├── fc │ │ ├── fd @@ -298,6 +322,7 @@ E:\Fitz_Studio │ ├── jupyter │ └── man ├── Apikeys.ipynb +├── Apikeys_embedding.ipynb ├── Credenciales.ipynb ├── Encriptacion.ipynb ├── README.md @@ -310,6 +335,9 @@ E:\Fitz_Studio │ │ ├── __init__.py │ │ ├── __pycache__ │ │ └── v1 +│ ├── db +│ │ ├── __init__.py +│ │ └── conexion.py │ ├── deps │ │ ├── __init__.py │ │ └── auth.py @@ -721,16 +749,19 @@ E:\Fitz_Studio │ │ ├── queue-microtask │ │ ├── range-parser │ │ ├── raw-body +│ │ ├── re-resizable │ │ ├── react │ │ ├── react-docgen │ │ ├── react-docgen-typescript │ │ ├── react-dom +│ │ ├── react-draggable │ │ ├── react-is │ │ ├── react-number-format │ │ ├── react-reconciler │ │ ├── react-refresh │ │ ├── react-remove-scroll │ │ ├── react-remove-scroll-bar +│ │ ├── react-rnd │ │ ├── react-router │ │ ├── react-router-dom │ │ ├── react-style-singleton @@ -892,9 +923,9 @@ E:\Fitz_Studio │ │ ├── Router.tsx │ │ ├── assets │ │ ├── components +│ │ ├── data │ │ ├── main.tsx │ │ ├── pages -│ │ ├── public │ │ ├── theme.ts │ │ ├── types │ │ └── vite-env.d.ts @@ -905,6 +936,7 @@ E:\Fitz_Studio │ ├── vite.config.js │ ├── vitest.setup.mjs │ └── yarn.lock +├── github_tutorial.ipynb ├── main.py ├── notebooks │ └── hacer_script_nombres.ipynb @@ -958,6 +990,7 @@ E:\Fitz_Studio │ │ └── postgres_credencial_mmr.py │ ├── Llms │ │ ├── Agente.py +│ │ ├── Embedders │ │ ├── MCPs │ │ ├── Memory │ │ ├── Modelos @@ -965,8 +998,16 @@ E:\Fitz_Studio │ │ └── __pycache__ │ ├── Security │ │ ├── Encriptar.py +│ │ ├── GenerarIDs.py │ │ ├── __init__.py │ │ └── __pycache__ +│ ├── TextManager +│ │ ├── __init__.py +│ │ ├── __pycache__ +│ │ ├── biblioteca.py +│ │ ├── biblioteca_mmr.py +│ │ ├── nota.py +│ │ └── notas_biblioteca_mmr.py │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-311.pyc diff --git a/entrypoint/init_db.py b/entrypoint/init_db.py index cea04b7..e7672e3 100644 --- a/entrypoint/init_db.py +++ b/entrypoint/init_db.py @@ -7,6 +7,8 @@ from src.Credenciales.postgres_credencial import PostgresCredencial # Asegúrat from src.Credenciales.postgres_credencial_mmr import PostgresCredencialModel from src.ApiKeys.openai_apikey_mmr import OpenAICredencialModel from src.Llms.Modelos.Openai_model_mmr import ModeloOpenAIConfigModel +from src.TextManager.biblioteca_mmr import BibliotecaModel +from src.Llms.Embedders.Openai_embedder_mmr import OpenAIEmbedderModel from dotenv import load_dotenv import os diff --git a/scripts/datos_para_llms/generar_tree.py b/scripts/datos_para_llms/generar_tree.py index de46e51..811233d 100644 --- a/scripts/datos_para_llms/generar_tree.py +++ b/scripts/datos_para_llms/generar_tree.py @@ -28,3 +28,4 @@ def save_tree_to_file(start_path='.', max_depth=2, output_file='tree.txt'): # Ejemplo de uso: # Puedes cambiar estos valores según lo necesites save_tree_to_file(start_path=r'E:\Fitz_Studio', max_depth=3, output_file=r'E:\Fitz_Studio\data\files\txt\tree.txt') + diff --git a/src/ApiKeys/openai_apikey.py b/src/ApiKeys/openai_apikey.py index 4238c3d..32bdaef 100644 --- a/src/ApiKeys/openai_apikey.py +++ b/src/ApiKeys/openai_apikey.py @@ -1,11 +1,14 @@ +from src.Security.GenerarIDs import GeneradorIDUnico + class OpenAICredencial: - def __init__(self, titulo: str, api_key: str, organizacion: str = None): + def __init__(self, titulo: str, api_key: str, organizacion: str = None, id: str = None): """ :param titulo: Nombre descriptivo para esta credencial. :param api_key: Clave secreta de la API de OpenAI. :param organizacion: (Opcional) ID de la organización asociada a la cuenta de OpenAI. """ - self.titulo = titulo + self.id = id if id is not None else GeneradorIDUnico("OPAK").generar() + self.titulo = titulo self.api_key = api_key self.organizacion = organizacion diff --git a/src/ApiKeys/openai_apikey_mmr.py b/src/ApiKeys/openai_apikey_mmr.py index 21b4abe..03fb497 100644 --- a/src/ApiKeys/openai_apikey_mmr.py +++ b/src/ApiKeys/openai_apikey_mmr.py @@ -24,7 +24,7 @@ if pssword is None: class OpenAICredencialModel(Base): __tablename__ = 'openai_credenciales' - id = Column(Integer, primary_key=True) + id = Column(String, primary_key=True) titulo = Column(String, nullable=False) api_key = Column(String, nullable=False) # Encriptada como base64 string organizacion = Column(String, nullable=True) @@ -37,6 +37,7 @@ class OpenAICredencialMapper: @staticmethod def to_dict(obj: OpenAICredencial) -> dict: return { + "id": obj.id, "titulo": obj.titulo, "api_key": base64.b64encode( Encriptar_fernet.encriptar(obj.api_key, pssword) @@ -47,6 +48,7 @@ class OpenAICredencialMapper: @staticmethod def from_dict(data: dict) -> OpenAICredencial: return OpenAICredencial( + id=data["id"], titulo=data["titulo"], api_key=Encriptar_fernet.desencriptar( base64.b64decode(data["api_key"]), pssword @@ -57,6 +59,7 @@ class OpenAICredencialMapper: @staticmethod def from_model(model: OpenAICredencialModel) -> OpenAICredencial: return OpenAICredencial( + id=model.id, titulo=model.titulo, api_key=Encriptar_fernet.desencriptar( base64.b64decode(model.api_key), pssword @@ -72,7 +75,7 @@ class OpenAICredencialRepo: def __init__(self, conexion: ConexionBase): self.session = conexion.get_session() - def add(self, credencial: OpenAICredencial) -> int: + def add(self, credencial: OpenAICredencial) -> str: data = OpenAICredencialMapper.to_dict(credencial) model = OpenAICredencialModel(**data) self.session.add(model) @@ -87,6 +90,6 @@ class OpenAICredencialRepo: model = self.session.query(OpenAICredencialModel).filter_by(titulo=titulo).first() return OpenAICredencialMapper.from_model(model) if model else None - def get_by_id(self, id_: int) -> OpenAICredencial | None: + def get_by_id(self, id_: str) -> OpenAICredencial | None: model = self.session.get(OpenAICredencialModel, id_) return OpenAICredencialMapper.from_model(model) if model else None diff --git a/src/ConexionSql/Base_conexion.py b/src/ConexionSql/Base_conexion.py index 3456c51..36a153f 100644 --- a/src/ConexionSql/Base_conexion.py +++ b/src/ConexionSql/Base_conexion.py @@ -1,7 +1,12 @@ from abc import ABC, abstractmethod from sqlalchemy.orm import Session +from sqlalchemy.engine import Engine class ConexionBase(ABC): @abstractmethod def get_session(self) -> Session: + pass + + @abstractmethod + def get_engine(self) -> Engine: pass \ No newline at end of file diff --git a/src/ConexionSql/Postgres_conexion.py b/src/ConexionSql/Postgres_conexion.py index 7b059cc..e8fe04c 100644 --- a/src/ConexionSql/Postgres_conexion.py +++ b/src/ConexionSql/Postgres_conexion.py @@ -1,12 +1,13 @@ from datetime import datetime, timezone from sqlalchemy import create_engine, text from sqlalchemy.exc import SQLAlchemyError -from sqlalchemy.orm import sessionmaker +from sqlalchemy.orm import sessionmaker, Session +from sqlalchemy.engine import Engine + from src.ConexionSql.Base_conexion import ConexionBase from src.Credenciales.postgres_credencial import PostgresCredencial - class PostgresConexion(ConexionBase): def __init__(self, *args, **kwargs): self.estado = "pendiente" @@ -18,25 +19,29 @@ class PostgresConexion(ConexionBase): self.port = credencial.port self.dbname = credencial.dbname self.user = credencial.user - self.password = credencial.password # se guarda la contraseña + self.password = credencial.password uri = credencial.get_uri() else: self.user = kwargs.get("user") - self.password = kwargs.get("password") # se guarda la contraseña + self.password = kwargs.get("password") self.host = kwargs.get("host") self.port = kwargs.get("port", 5432) self.dbname = kwargs.get("db") or kwargs.get("dbname") uri = f"postgresql://{self.user}:{self.password}@{self.host}:{self.port}/{self.dbname}" - self.engine = create_engine(uri) - self.SessionLocal = sessionmaker(bind=self.engine) + self._engine: Engine = create_engine(uri) + self._Session = sessionmaker(bind=self._engine) - def get_session(self): - return self.SessionLocal() + + def get_session(self) -> Session: + return self._Session() + + def get_engine(self) -> Engine: + return self._engine def probar_conexion(self) -> bool: try: - with self.engine.connect() as connection: + with self._engine.connect() as connection: connection.execute(text("SELECT 1")) self.estado = "exito" return True diff --git a/src/Credenciales/postgres_credencial.py b/src/Credenciales/postgres_credencial.py index 5b6a843..b47fb01 100644 --- a/src/Credenciales/postgres_credencial.py +++ b/src/Credenciales/postgres_credencial.py @@ -1,5 +1,8 @@ +from src.Security.GenerarIDs import GeneradorIDUnico + class PostgresCredencial: - def __init__(self, titulo: str, host: str, port: int, dbname: str, user: str, password: str): + def __init__(self, titulo: str, host: str, port: int, dbname: str, user: str, password: str, id: str = None): + self.id = id if id is not None else GeneradorIDUnico("PGCR").generar() self.titulo = titulo self.host = host self.port = port @@ -7,6 +10,7 @@ class PostgresCredencial: self.user = user self.password = password + def get_uri(self) -> str: """ Retorna una URI de conexión para PostgreSQL. diff --git a/src/Credenciales/postgres_credencial_mmr.py b/src/Credenciales/postgres_credencial_mmr.py index 3e76879..38f8918 100644 --- a/src/Credenciales/postgres_credencial_mmr.py +++ b/src/Credenciales/postgres_credencial_mmr.py @@ -24,7 +24,7 @@ if pssword is None: class PostgresCredencialModel(Base): __tablename__ = 'postgres_credenciales' - id = Column(Integer, primary_key=True) + id = Column(String, primary_key=True) titulo = Column(String, nullable=False) host = Column(String, nullable=False) port = Column(Integer, nullable=False) @@ -42,6 +42,7 @@ class PostgresCredencialMapper: @staticmethod def to_dict(obj: PostgresCredencial) -> dict: return { + "id": obj.id, "titulo": obj.titulo, "host": obj.host, "port": obj.port, @@ -55,6 +56,7 @@ class PostgresCredencialMapper: @staticmethod def from_dict(data: dict) -> PostgresCredencial: return PostgresCredencial( + id=data["id"], titulo=data["titulo"], host=data["host"], port=data["port"], @@ -68,6 +70,7 @@ class PostgresCredencialMapper: @staticmethod def from_model(model: PostgresCredencialModel) -> PostgresCredencial: return PostgresCredencial( + id=model.id, titulo=model.titulo, host=model.host, port=model.port, @@ -86,7 +89,7 @@ class PostgresCredencialRepo: def __init__(self, conexion: ConexionBase): self.session = conexion.get_session() - def add(self, credencial: PostgresCredencial) -> int: + def add(self, credencial: PostgresCredencial) -> str: data = PostgresCredencialMapper.to_dict(credencial) model = PostgresCredencialModel(**data) self.session.add(model) @@ -101,6 +104,6 @@ class PostgresCredencialRepo: model = self.session.query(PostgresCredencialModel).filter_by(titulo=titulo).first() return PostgresCredencialMapper.from_model(model) if model else None - def get_by_id(self, id_: int) -> PostgresCredencial | None: + def get_by_id(self, id_: str) -> PostgresCredencial | None: model = self.session.get(PostgresCredencialModel, id_) return PostgresCredencialMapper.from_model(model) if model else None \ No newline at end of file diff --git a/src/Llms/Embedders/Base_Embedder.py b/src/Llms/Embedders/Base_Embedder.py new file mode 100644 index 0000000..4a02a1a --- /dev/null +++ b/src/Llms/Embedders/Base_Embedder.py @@ -0,0 +1,13 @@ +from abc import ABC, abstractmethod +from typing import List + +class EmbedderABC(ABC): + @abstractmethod + def encoder(self, text: str) -> List[float]: + """Genera los embeddings para un texto dado.""" + pass + + @abstractmethod + def dimension_number(self) -> int: + """Devuelve la dimensión del modelo de embedding.""" + pass \ No newline at end of file diff --git a/src/Llms/Embedders/Openai_embedder.py b/src/Llms/Embedders/Openai_embedder.py new file mode 100644 index 0000000..a928dee --- /dev/null +++ b/src/Llms/Embedders/Openai_embedder.py @@ -0,0 +1,32 @@ +from typing import List +from src.Llms.Embedders.Base_Embedder import EmbedderABC # Asegúrate de que EmbedderABC esté en este módulo +from src.ApiKeys.openai_apikey import OpenAICredencial +from src.ConexionApis.OpenAi_conexion import OpenAICliente +from src.Security.GenerarIDs import GeneradorIDUnico + +class OpenAIEmbedder(EmbedderABC): + def __init__(self, credencial: OpenAICredencial, + model: str, + id: str = None): + self.model = model + self.client = OpenAICliente(credencial) + self._dimension = None # Lazy loading + self.id = id if id is not None else GeneradorIDUnico("OAMB").generar() + + def encoder(self, text: str) -> List[float]: + """ + Genera los embeddings para un texto dado utilizando el modelo de OpenAI. + """ + response = self.client.embedding(model=self.model, input=text) + embedding = response.data[0].embedding + if self._dimension is None: + self._dimension = len(embedding) + return embedding + + def dimension_number(self) -> int: + """ + Devuelve la dimensión del modelo de embedding, generando un embedding si no se ha calculado aún. + """ + if self._dimension is None: + _ = self.encoder("dimension_check") + return self._dimension \ No newline at end of file diff --git a/src/Llms/Embedders/Openai_embedder_mmr.py b/src/Llms/Embedders/Openai_embedder_mmr.py new file mode 100644 index 0000000..07b0868 --- /dev/null +++ b/src/Llms/Embedders/Openai_embedder_mmr.py @@ -0,0 +1,83 @@ +import os +from dotenv import load_dotenv +from sqlalchemy import Column, String +from src.ConexionSql.Base_conexion import ConexionBase +from src.base import Base +from src.Security.GenerarIDs import GeneradorIDUnico +from src.Llms.Embedders.Openai_embedder import OpenAIEmbedder +from src.ApiKeys.openai_apikey import OpenAICredencial + +# ---------------------- +# Cargar configuración desde .env si se requiere +# ---------------------- +from entrypoint import ENV_PATH +load_dotenv(ENV_PATH) + +# ---------------------- +# MODELO (SQLAlchemy) +# ---------------------- + +class OpenAIEmbedderModel(Base): + __tablename__ = "openai_embedders" + + id = Column(String, primary_key=True) + api_key_id = Column(String, nullable=False) # ID de la credencial asociada (clave foránea lógica) + model = Column(String, nullable=False) + +# ---------------------- +# MAPPER +# ---------------------- + +class OpenAIEmbedderMapper: + @staticmethod + def to_dict(obj: OpenAIEmbedder) -> dict: + return { + "id": obj.id, + "api_key_id": obj.client.credencial.id, + "model": obj.model + } + + @staticmethod + def from_dict(data: dict, credencial: OpenAICredencial) -> OpenAIEmbedder: + return OpenAIEmbedder( + id=data["id"], + credencial=credencial, + model=data["model"] + ) + + @staticmethod + def from_model(model: OpenAIEmbedderModel, credencial: OpenAICredencial) -> OpenAIEmbedder: + return OpenAIEmbedder( + id=model.id, + credencial=credencial, + model=model.model + ) + +# ---------------------- +# REPO +# ---------------------- + +class OpenAIEmbedderRepo: + def __init__(self, conexion: ConexionBase): + self.session = conexion.get_session() + + def add(self, embedder: OpenAIEmbedder) -> str: + data = OpenAIEmbedderMapper.to_dict(embedder) + model = OpenAIEmbedderModel(**data) + self.session.add(model) + self.session.commit() + return model.id + + def get_by_id(self, id_: str, credencial: OpenAICredencial) -> OpenAIEmbedder | None: + model = self.session.get(OpenAIEmbedderModel, id_) + return OpenAIEmbedderMapper.from_model(model, credencial) if model else None + + def get_all(self, credencial_loader: callable) -> list[OpenAIEmbedder]: + """ + :param credencial_loader: función que recibe un api_key_id y devuelve una instancia de OpenAICredencial + """ + models = self.session.query(OpenAIEmbedderModel).all() + return [ + OpenAIEmbedderMapper.from_model(m, credencial_loader(m.api_key_id)) + for m in models + ] diff --git a/src/Llms/Modelos/Openai_model.py b/src/Llms/Modelos/Openai_model.py index 9835936..5f16f7f 100644 --- a/src/Llms/Modelos/Openai_model.py +++ b/src/Llms/Modelos/Openai_model.py @@ -1,5 +1,6 @@ from src.Llms.Modelos.Base_model import ModeloABC from src.ConexionApis.OpenAi_conexion import OpenAICliente +from src.Security.GenerarIDs import GeneradorIDUnico import asyncio from typing import AsyncGenerator, Union @@ -8,6 +9,7 @@ class ModeloOpenAI(ModeloABC): self, cliente: OpenAICliente, model: str = "gpt-4o", + id: str = None, temperature: float = 0.7, top_p: float = 1.0, top_k: int = None, @@ -15,7 +17,9 @@ class ModeloOpenAI(ModeloABC): num_tokens_maximos: int = 512, use_legacy: bool = False ): + id = id if id is not None else GeneradorIDUnico("MOPA").generar() super().__init__( + id=id, model=model, temperature=temperature, top_p=top_p, diff --git a/src/Llms/Modelos/Openai_model_mmr.py b/src/Llms/Modelos/Openai_model_mmr.py index 51b9943..f3e6c52 100644 --- a/src/Llms/Modelos/Openai_model_mmr.py +++ b/src/Llms/Modelos/Openai_model_mmr.py @@ -22,7 +22,7 @@ if pssword is None: class ModeloOpenAIConfigModel(Base): __tablename__ = 'modelo_openai_configs' - id = Column(Integer, primary_key=True) + id = Column(String, primary_key=True) model = Column(String, nullable=False) temperature = Column(Float, default=0.7) top_p = Column(Float, default=1.0) @@ -39,6 +39,7 @@ class ModeloOpenAIConfigMapper: @staticmethod def to_dict(obj: ModeloOpenAI) -> dict: return { + "id": obj.id, "model": obj.model, "temperature": obj.temperature, "top_p": obj.top_p, @@ -51,6 +52,7 @@ class ModeloOpenAIConfigMapper: @staticmethod def from_model(model: ModeloOpenAIConfigModel, cliente: object) -> ModeloOpenAI: return ModeloOpenAI( + id=model.id, cliente=cliente, model=model.model, temperature=model.temperature, @@ -70,14 +72,14 @@ class ModeloOpenAIConfigRepo: self.session = conexion.get_session() self.cliente = cliente # Necesario para crear ModeloOpenAI - def add(self, config: ModeloOpenAI) -> int: + def add(self, config: ModeloOpenAI) -> str: data = ModeloOpenAIConfigMapper.to_dict(config) model = ModeloOpenAIConfigModel(**data) self.session.add(model) self.session.commit() return model.id - def get_by_id(self, id_: int) -> ModeloOpenAI | None: + def get_by_id(self, id_: str) -> ModeloOpenAI | None: model = self.session.get(ModeloOpenAIConfigModel, id_) return ModeloOpenAIConfigMapper.from_model(model, self.cliente) if model else None diff --git a/src/TextManager/__init__.py b/src/TextManager/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/TextManager/biblioteca.py b/src/TextManager/biblioteca.py new file mode 100644 index 0000000..29112d0 --- /dev/null +++ b/src/TextManager/biblioteca.py @@ -0,0 +1,51 @@ +from src.Security.GenerarIDs import GeneradorIDUnico +from src.Llms.Embedders.Base_Embedder import EmbedderABC # Asegúrate de que esta ruta sea correcta +from typing import List, Optional +from src.ConexionSql.Base_conexion import ConexionBase +from sqlalchemy import MetaData # Asegúrate de importar esto +from src.TextManager.notas_biblioteca_mmr import generar_tabla_nota_para_biblioteca # Ajusta si es necesario + +class Biblioteca: + def __init__( + self, + nombre: str, + descripcion: str = "", + id: Optional[str] = None, + embedder: Optional[EmbedderABC] = None, + vector_dim: Optional[int] = None + ): + """ + Clase que representa una biblioteca de notas de texto. + + :param nombre: Nombre de la biblioteca. + :param descripcion: Breve descripción de la biblioteca. + :param id: ID único opcional. Si no se proporciona, se genera automáticamente. + :param embedder: Objeto que implementa EmbedderABC para generar el vector del nombre. + :param vector_dim: Dimensión del vector si no se proporciona un embedder. + """ + self.id = id if id is not None else GeneradorIDUnico("BBLI").generar() + self.nombre = nombre + self.descripcion = descripcion + self.embedder = embedder + + if self.embedder is not None: + self.vector_dim = self.embedder.dimension_number() + elif vector_dim is not None: + self.vector_dim = vector_dim + else: + raise ValueError("Debes proporcionar un 'embedder' o un 'vector_dim' explícito.") + + def generar_modelo_notas(self, conexion: ConexionBase): + """ + Genera dinámicamente un modelo de notas asociado a esta biblioteca y lo crea en la base de datos. + + :param conexion: Objeto de conexión a la base de datos. + :return: Clase del modelo SQLAlchemy correspondiente a las notas. + """ + nombre_tabla = f"biblio_{self.nombre}" + + metadata = MetaData() + engine = conexion.get_engine() + tabla, NotaModel = generar_tabla_nota_para_biblioteca(nombre_tabla, self.vector_dim, metadata) + metadata.create_all(engine) + return NotaModel diff --git a/src/TextManager/biblioteca_mmr.py b/src/TextManager/biblioteca_mmr.py new file mode 100644 index 0000000..814b256 --- /dev/null +++ b/src/TextManager/biblioteca_mmr.py @@ -0,0 +1,96 @@ +import os +import base64 +from dotenv import load_dotenv +from sqlalchemy import Column, String, Integer + +from src.ConexionSql.Base_conexion import ConexionBase +from src.base import Base +from src.Security.Encriptar import Encriptar_fernet +from src.Security.GenerarIDs import GeneradorIDUnico +from src.Llms.Embedders.Base_Embedder import EmbedderABC +from src.TextManager.biblioteca import Biblioteca # Suponiendo que defines la clase lógica Biblioteca aquí + +# ---------------------- +# Cargar clave maestra +# ---------------------- +from entrypoint import ENV_PATH +load_dotenv(ENV_PATH) +pssword = os.getenv('MASTER_PASSWORD') +if pssword is None: + raise ValueError("MASTER_PASSWORD no está definida en el archivo .env") + +# ---------------------- +# MODELO (SQLAlchemy) +# ---------------------- + +class BibliotecaModel(Base): + __tablename__ = "bibliotecas" + + id = Column(String, primary_key=True) + nombre = Column(String, nullable=False) + descripcion = Column(String, default="") + vector_dim = Column(Integer, nullable=False) + embedder_info = Column(String, nullable=True) # Se puede guardar nombre de clase o config encriptada + +# ---------------------- +# MAPPER +# ---------------------- + +class BibliotecaMapper: + @staticmethod + def to_dict(obj: Biblioteca) -> dict: + embedder_info = type(obj.embedder).__name__ if obj.embedder else None + return { + "id": obj.id, + "nombre": obj.nombre, + "descripcion": obj.descripcion, + "vector_dim": obj.vector_dim, + "embedder_info": embedder_info # sin codificar ni encriptar + } + + @staticmethod + def from_dict(data: dict) -> Biblioteca: + return Biblioteca( + id=data["id"], + nombre=data["nombre"], + descripcion=data["descripcion"], + vector_dim=data["vector_dim"], + embedder=None # Mantienes la lógica actual de no restaurarlo automáticamente + ) + + @staticmethod + def from_model(model: BibliotecaModel) -> Biblioteca: + return Biblioteca( + id=model.id, + nombre=model.nombre, + descripcion=model.descripcion, + vector_dim=model.vector_dim, + embedder=None # Se puede cargar manualmente si es necesario + ) + +# ---------------------- +# REPO +# ---------------------- + +class BibliotecaRepo: + def __init__(self, conexion: ConexionBase): + self.session = conexion.get_session() + + def add(self, biblioteca: Biblioteca) -> str: + data = BibliotecaMapper.to_dict(biblioteca) + model = BibliotecaModel(**data) + self.session.add(model) + self.session.commit() + return model.id + + def get_all(self) -> list[Biblioteca]: + models = self.session.query(BibliotecaModel).all() + return [BibliotecaMapper.from_model(m) for m in models] + + def get_by_nombre(self, nombre: str) -> Biblioteca | None: + model = self.session.query(BibliotecaModel).filter_by(nombre=nombre).first() + return BibliotecaMapper.from_model(model) if model else None + + def get_by_id(self, id_: str) -> Biblioteca | None: + model = self.session.get(BibliotecaModel, id_) + return BibliotecaMapper.from_model(model) if model else None \ No newline at end of file diff --git a/src/TextManager/nota.py b/src/TextManager/nota.py new file mode 100644 index 0000000..21aa35c --- /dev/null +++ b/src/TextManager/nota.py @@ -0,0 +1,41 @@ +from src.Security.GenerarIDs import GeneradorIDUnico +from typing import List + +class Nota: + def __init__( + self, + titulo: str, + tags: List[str] = None, + conexiones: List[str] = None, + texto: str = "", + vector: List[float] = None, + resumen: str = "", + vector_resumen: List[float] = None, + id: str = None + ): + """ + Clase que representa una nota de texto con estructura semántica. + + :param titulo: Título de la nota. + :param tags: Lista de etiquetas asociadas. + :param conexiones: Lista de identificadores relacionados. + :param vector: Embedding vectorial de la nota. + :param resumen: Texto resumen de la nota. + :param vector_resumen: Embedding del resumen. + :param id: Identificador único (si no se proporciona, se genera automáticamente). + """ + self.id = id if id is not None else GeneradorIDUnico("NOTA").generar() + self.titulo = titulo + self.tags = tags if tags is not None else [] + self.conexiones = conexiones if conexiones is not None else [] + self.texto = texto + self.vector = vector + self.resumen = resumen + self.vector_resumen = vector_resumen + + def __repr__(self): + return ( + f"" + ) \ No newline at end of file diff --git a/src/TextManager/notas_biblioteca_mmr.py b/src/TextManager/notas_biblioteca_mmr.py new file mode 100644 index 0000000..2d13ca5 --- /dev/null +++ b/src/TextManager/notas_biblioteca_mmr.py @@ -0,0 +1,107 @@ +import os +from dotenv import load_dotenv +from sqlalchemy import Column, String, Table, MetaData +from pgvector.sqlalchemy import Vector +from sqlalchemy.orm import registry, Session +from src.TextManager.nota import Nota +from src.ConexionSql.Base_conexion import ConexionBase + +# ---------------------- +# Cargar .env +# ---------------------- +from entrypoint import ENV_PATH +load_dotenv(ENV_PATH) + +# ---------------------- +# REGISTRO DINÁMICO PARA TABLAS +# ---------------------- +mapper_registry = registry() + +# ---------------------- +# FUNCIONES AUXILIARES +# ---------------------- + +def generar_tabla_nota_para_biblioteca(biblioteca_nombre: str, vector_dim: int, metadata: MetaData): + nombre_tabla = biblioteca_nombre.lower().replace(" ", "_") + + tabla = Table( + nombre_tabla, + metadata, + Column("id", String, primary_key=True), + Column("titulo", String, nullable=False), + Column("tags", String), + Column("conexiones", String), + Column("texto", String), + Column("resumen", String), + Column("vector", Vector(vector_dim), nullable=False), + Column("vector_resumen", Vector(vector_dim), nullable=True), # AHORA ES OPCIONAL + ) + + class NotaModel: + def __init__(self, nota: Nota): + self.id = nota.id + self.titulo = nota.titulo + self.tags = ",".join(nota.tags) + self.conexiones = ",".join(nota.conexiones) + self.texto = nota.texto + self.resumen = nota.resumen + self.vector = nota.vector + self.vector_resumen = getattr(nota, "vector_resumen", None) # AHORA ES OPCIONAL + + mapper_registry.map_imperatively(NotaModel, tabla) + return tabla, NotaModel + + +# ---------------------- +# MAPPER +# ---------------------- + +class NotaMapper: + @staticmethod + def to_dict(nota: Nota) -> dict: + return { + "id": nota.id, + "titulo": nota.titulo, + "tags": ",".join(nota.tags), + "conexiones": ",".join(nota.conexiones), + "texto": nota.texto, + "resumen": nota.resumen, + "vector": nota.vector, + "vector_resumen": nota.vector_resumen + } + + @staticmethod + def from_model(model) -> Nota: + return Nota( + id=model.id, + titulo=model.titulo, + tags=model.tags.split(",") if model.tags else [], + conexiones=model.conexiones.split(",") if model.conexiones else [], + texto=model.texto, + resumen=model.resumen, + vector=list(model.vector), + vector_resumen=list(model.vector_resumen) if model.vector_resumen is not None else None + ) + +# ---------------------- +# REPO +# ---------------------- + +class NotaRepo: + def __init__(self, session: Session, modelo_nota): + self.session = session + self.ModeloNota = modelo_nota + + def add(self, nota: Nota) -> str: + model = self.ModeloNota(nota) + self.session.add(model) + self.session.commit() + return model.id + + def get_by_id(self, id_: str) -> Nota | None: + model = self.session.get(self.ModeloNota, id_) + return NotaMapper.from_model(model) if model else None + + def get_all(self) -> list[Nota]: + models = self.session.query(self.ModeloNota).all() + return [NotaMapper.from_model(m) for m in models]