From cee53da87f838bc37d1bacd534f9832fa9bfb540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=94=AF=20A06?= Date: Mon, 25 May 2026 15:43:31 +0800 Subject: [PATCH] =?UTF-8?q?feat(D2):=20=E4=BA=8B=E4=BB=B6=E4=BC=A0?= =?UTF-8?q?=E6=92=AD=E5=B1=82=20-=20EventConsumer=20=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E7=BA=BF=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 storage/event_consumer.py: 消费 Redis Streams 事件 - 集成到 server.py: startup 事件启动消费者 - 服务注册: 启动时注册实例,心跳续约 - 跨实例事件消费 + CRDT merge 到本地 embedder --- data/sbert_docs.jsonl | 2 + data/sbert_meta.json | 2 +- data/sbert_vectors.jsonl | 2 + src/api/server.py | 28 +++++- src/storage/event_consumer.py | 171 ++++++++++++++++++++++++++++++++++ 5 files changed, 203 insertions(+), 2 deletions(-) create mode 100644 src/storage/event_consumer.py diff --git a/data/sbert_docs.jsonl b/data/sbert_docs.jsonl index 4cb0cbb..d237b2b 100644 --- a/data/sbert_docs.jsonl +++ b/data/sbert_docs.jsonl @@ -26,3 +26,5 @@ {"id": "a4c63346-bb98-4237-960d-cf321fa2fb6d", "text": "测试增量索引是否正常工作,commit 后立即搜索 增量索引测试", "facts": ["增量索引测试"], "category": "episodes", "timestamp": "2026-05-25T12:59:43.726479"} {"id": "a055f73f-21fb-41e4-a8b0-1d534a4e4a0b", "text": "Redis集成测试,多实例同步验证 Redis集成测试,多实例同步验证", "facts": ["Redis集成测试,多实例同步验证"], "category": "distilled", "timestamp": "2026-05-25T15:27:29.604812"} {"id": "462fc577-5a6f-4feb-838b-965d24612eea", "text": "Redis集成测试,多实例同步验证 Redis集成 多实例同步", "facts": ["Redis集成", "多实例同步"], "category": "episodes", "timestamp": "2026-05-25T15:27:29.602233"} +{"id": "a055f73f-21fb-41e4-a8b0-1d534a4e4a0b", "text": "Redis集成测试,多实例同步验证 Redis集成测试,多实例同步验证", "facts": ["Redis集成测试,多实例同步验证"], "category": "fact", "timestamp": "2026-05-25T15:27:29.604812"} +{"id": "462fc577-5a6f-4feb-838b-965d24612eea", "text": "Redis集成测试,多实例同步验证 Redis集成 多实例同步", "facts": ["Redis集成", "多实例同步"], "category": "episode", "timestamp": "2026-05-25T15:27:29.602233"} diff --git a/data/sbert_meta.json b/data/sbert_meta.json index a7c618f..4da4dfc 100644 --- a/data/sbert_meta.json +++ b/data/sbert_meta.json @@ -1 +1 @@ -{"model_name": "moka-ai/m3e-base", "doc_count": 28, "updated_at": "2026-05-25T15:27:29.650315"} \ No newline at end of file +{"model_name": "moka-ai/m3e-base", "doc_count": 30, "updated_at": "2026-05-25T15:40:12.362234"} \ No newline at end of file diff --git a/data/sbert_vectors.jsonl b/data/sbert_vectors.jsonl index 622c749..35ebf71 100644 --- a/data/sbert_vectors.jsonl +++ b/data/sbert_vectors.jsonl @@ -26,3 +26,5 @@ [0.4710114598274231, 0.5985025763511658, 0.2185707837343216, -0.39202579855918884, 0.1771441549062729, -0.9471457600593567, -0.4122987389564514, -1.2343531847000122, -0.008812276646494865, 0.420366495847702, 0.24046897888183594, 0.353505939245224, 1.1807981729507446, -0.8694602251052856, -1.2084996700286865, 0.3222159743309021, 0.24284803867340088, 0.7401923537254333, -0.0036886674351990223, -0.1420782506465912, 0.8435384035110474, -0.27710095047950745, -0.8608649373054504, 0.9076369404792786, 0.12144359201192856, -0.06106873229146004, -0.3222805857658386, -0.05794769525527954, 0.47759005427360535, -0.6243749260902405, 1.2276108264923096, -0.34490707516670227, 0.1499670445919037, -0.15315596759319305, 0.6397686004638672, 0.1764201819896698, 0.36843377351760864, 0.2682205140590668, 0.4983571171760559, 1.1308443546295166, 0.21173007786273956, -0.14721988141536713, 0.12688829004764557, -0.131935253739357, 0.46230167150497437, 0.41460439562797546, -0.33618804812431335, 0.35532549023628235, -0.4999234974384308, 0.772119402885437, -0.009554288350045681, 7.20878267288208, -0.2772859036922455, 0.6049420237541199, -0.5696688294410706, 1.4323049783706665, -0.07693827152252197, -0.1117175817489624, -0.5225477814674377, -0.2311192899942398, 0.4812109172344208, 0.0338289700448513, 0.4757051467895508, -0.9540428519248962, -0.009272356517612934, -0.3403414189815521, -0.7546928524971008, -0.8644633889198303, 0.5114030241966248, -0.9177609086036682, 0.08080215007066727, -0.5039347410202026, -0.7231537103652954, -0.9486483335494995, 0.7212868928909302, -0.418345183134079, 0.08468585461378098, 0.39334648847579956, 0.6800938844680786, -0.7115514874458313, 0.5585566163063049, -0.16990086436271667, 0.06292761862277985, -0.847518265247345, -0.8545452952384949, 0.5834255814552307, 0.06076904758810997, -0.3029443323612213, 0.2767936587333679, 0.40029507875442505, -0.8928597569465637, -0.09729782491922379, -0.4316900670528412, -0.5735778212547302, -0.06831157952547073, -0.04670286923646927, 0.6630259156227112, -1.1094597578048706, -0.228265181183815, 1.1862322092056274, 0.015616157092154026, 0.3774663507938385, -0.5624236464500427, -0.4470007121562958, 0.07831773906946182, 1.1966569423675537, -1.1662378311157227, 0.23286986351013184, 0.9205317497253418, -0.11155731230974197, -0.1378220170736313, -0.7664864659309387, -0.6551221013069153, -0.04654943197965622, -0.5186998248100281, 0.428104966878891, -0.7754523158073425, 0.3728831112384796, 0.9348353743553162, 0.02900904417037964, 0.17295797169208527, 0.26015713810920715, -0.7931351661682129, -0.5175222754478455, 0.26753944158554077, 0.19935856759548187, -0.3439517915248871, 0.2323702573776245, -0.7293699979782104, 1.545116662979126, -1.0365955829620361, 0.20631742477416992, -0.9170012474060059, -0.1533658504486084, 0.05544344335794449, 0.8583552241325378, -0.03542763739824295, -0.8152652382850647, -1.006554365158081, -0.08649100363254547, 1.230722427368164, 0.12263212352991104, -0.4155312180519104, -0.0743909403681755, -0.9091367721557617, -0.1090330109000206, 0.3007764220237732, 0.6275020241737366, 0.4440922737121582, -0.6513360738754272, 0.5358254313468933, 0.032440684735774994, -0.5873788595199585, -0.008113357238471508, 0.6793410181999207, 0.3106405436992645, -0.24450959265232086, -0.07641726732254028, -0.774501621723175, -0.5884131193161011, -0.022421598434448242, -0.3251335918903351, 0.1538114845752716, -0.5148115158081055, -0.29157379269599915, 0.12368541210889816, 0.6009083986282349, -0.5324832797050476, 0.38783344626426697, -0.31035634875297546, -0.7365240454673767, -0.7214692234992981, -0.0750383511185646, -0.4777337610721588, 0.39662832021713257, 0.01651529036462307, -0.5964254140853882, 0.07414716482162476, -1.0252745151519775, 0.27026456594467163, -1.891356348991394, -0.46378231048583984, 0.14575660228729248, 0.21594826877117157, -0.7083225250244141, 0.41734227538108826, -1.1358435153961182, 1.2997227907180786, 0.8136814832687378, 0.20599356293678284, -0.997797429561615, -0.6549908518791199, 0.3221464157104492, -0.5050391554832458, 0.6677693128585815, 0.7951536774635315, -0.407181978225708, -0.6994004249572754, -0.5686703324317932, -0.48883676528930664, 0.5356157422065735, -0.7213741540908813, 0.5123060345649719, 0.4500136375427246, 0.6197952032089233, 1.086224913597107, 0.1487567126750946, -0.03634514659643173, 0.535247266292572, 0.47446972131729126, -1.4579479694366455, -0.5557106733322144, -0.5402280688285828, 0.5442406535148621, 0.306497186422348, 0.7196254730224609, -1.4704633951187134, 0.5191367864608765, -0.13850362598896027, 0.300381600856781, -0.3553093373775482, -0.4844523072242737, -0.3718206584453583, -0.5276671051979065, -0.6114636659622192, -1.099608302116394, -0.7949323654174805, -0.09890840947628021, 0.8285735249519348, 0.23336315155029297, -0.15100829303264618, -0.7519956827163696, -0.34722137451171875, 0.11608033627271652, 0.7197108864784241, 0.5138149857521057, 0.07347490638494492, 0.22174575924873352, -0.487384170293808, 0.6276484131813049, -0.2663118541240692, 0.9234226942062378, 0.5693804025650024, -0.08516689389944077, -0.6031598448753357, -0.18875059485435486, 0.6862877607345581, -1.0897066593170166, -0.9160752296447754, -0.14346423745155334, -0.6892908811569214, 0.5401644706726074, 1.0521650314331055, -0.6304211616516113, -0.371576726436615, 0.5807830691337585, 0.16892418265342712, -0.3618770241737366, 0.4319041073322296, -0.2810952365398407, 0.208741694688797, 0.20062986016273499, 1.1026610136032104, 0.6698002815246582, -1.0393970012664795, -0.23059169948101044, -0.14941465854644775, -1.189651608467102, -1.4019296169281006, -0.2958524823188782, 0.014599310234189034, 0.22282497584819794, 0.2606325149536133, -1.1800810098648071, 0.8217302560806274, -0.870123028755188, 0.6510024666786194, -0.11659515649080276, -0.25269871950149536, -1.2939965724945068, 0.42316505312919617, 0.42922183871269226, 0.39089179039001465, 0.011898942291736603, -0.06104680150747299, -0.663619875907898, -0.15642844140529633, 0.38365501165390015, -0.5410940051078796, -0.20397253334522247, 0.02808227948844433, -0.2844242453575134, 0.540329098701477, 0.55829918384552, 1.9041211605072021, -1.034619927406311, -0.13053293526172638, 0.7570897936820984, -0.5189250707626343, -0.36745399236679077, -0.5183213353157043, -0.46363338828086853, -1.3963584899902344, 1.2781394720077515, -0.35550275444984436, 1.56019127368927, 0.4616086483001709, 0.5481285452842712, -0.789821207523346, -0.4210211932659149, -0.16935883462429047, -0.7523192167282104, 0.4144572615623474, 0.012088791467249393, -0.6110876798629761, 0.22274267673492432, 0.02490362897515297, -0.08632014691829681, -0.2589375972747803, -0.5279827117919922, 0.7131983637809753, 0.04182633012533188, 0.1651068925857544, 0.6768328547477722, 0.43306657671928406, 0.22205416858196259, 0.5676296949386597, 0.6010703444480896, -0.9103363752365112, 0.4707544147968292, 0.9501324892044067, -0.7432144284248352, -0.5573159456253052, 0.09487356245517731, 0.8732844591140747, 0.6075040102005005, -0.2090594470500946, -0.057624462991952896, 0.512876570224762, -0.16318368911743164, 0.012151181697845459, -0.17217907309532166, 0.6907833814620972, -1.1624289751052856, 0.18479160964488983, -1.1339073181152344, -0.523297905921936, -0.31595778465270996, -0.849628746509552, -1.1291699409484863, -0.23637866973876953, 0.8573545813560486, -0.7042055130004883, -1.0780608654022217, 0.32195529341697693, 0.812343180179596, 0.9450874924659729, 0.156510591506958, 0.635686993598938, 0.7506890296936035, -0.07906018197536469, -0.12030676752328873, -1.4989449977874756, 0.6727727651596069, -0.08762939274311066, -1.3536022901535034, 0.5768958330154419, 0.056549787521362305, -0.20385219156742096, -0.9696063995361328, 0.6785780787467957, -0.02375067211687565, 0.4239959716796875, -0.30630001425743103, 0.650054395198822, 0.38428863883018494, -0.1570674031972885, 0.3672342300415039, 0.5668008923530579, -0.3997901380062103, 0.4149644374847412, -0.7628266215324402, 0.7261766791343689, 0.8694850206375122, -0.6053658723831177, -0.16978788375854492, -0.21801945567131042, -1.274993896484375, -0.34404072165489197, -0.7124043107032776, -0.7776481509208679, -0.31990718841552734, 0.5451409220695496, 0.11087039858102798, 0.5019611120223999, -0.10810261219739914, 0.36566099524497986, -0.08047275990247726, 0.4496331214904785, 0.5691553950309753, 0.39617103338241577, -1.097165822982788, -0.07776039093732834, -0.12972889840602875, 1.1449682712554932, -0.7029910087585449, 0.07671118527650833, -0.04988224431872368, 0.4110164940357208, -0.6884101033210754, -1.4361196756362915, -0.06746456027030945, -0.8789160847663879, -0.7854220271110535, 0.6938499808311462, 0.5101798176765442, 0.41813966631889343, 0.6937221884727478, 1.1117361783981323, -0.5212007164955139, -0.22964270412921906, 0.7273451089859009, 0.15206722915172577, 0.1677447259426117, 1.244775652885437, 0.6377502083778381, -0.12348814308643341, -0.5295094847679138, 0.46467432379722595, -0.5796073079109192, 0.052519116550683975, -0.060482531785964966, 0.7443909049034119, -0.5153403878211975, -0.519815981388092, 0.6437044143676758, -0.7239853143692017, 0.2080654352903366, -0.6852098107337952, 0.0911889523267746, -0.3401569426059723, -0.09643162786960602, 0.17293378710746765, 0.16482052206993103, -0.38316255807876587, 0.32840824127197266, 1.2174135446548462, -1.4674946069717407, 0.3108103573322296, 0.9945529103279114, -0.3269636929035187, -0.17496849596500397, -0.8540827631950378, -0.628311276435852, 0.987010657787323, -0.3841332495212555, 0.7724106907844543, -0.544705331325531, 0.8830748796463013, -0.44812870025634766, -0.6018827557563782, 0.6166313886642456, -0.11827467381954193, 0.184186190366745, 1.00938880443573, 0.005783562082797289, 0.4804704785346985, -0.03516169637441635, 1.2314836978912354, 0.23734305799007416, 0.2794109284877777, 1.268147587776184, 0.15627625584602356, 0.046866945922374725, -0.1299465149641037, 0.021674703806638718, 0.49040719866752625, -0.48641809821128845, -0.6375678181648254, -1.0666292905807495, 0.6952447295188904, -0.36115342378616333, -0.7180398106575012, -0.7481469511985779, -0.6614807844161987, -0.24122659862041473, -0.03481451794505119, -0.461212158203125, -0.09242497384548187, -0.41354769468307495, 0.04043502360582352, -0.642979621887207, 1.2704662084579468, -0.5560857653617859, 0.1021055057644844, -0.8146130442619324, -0.3308738172054291, 0.7414786219596863, -0.9521210789680481, 0.2764868140220642, 0.18277814984321594, -0.5251181721687317, -0.334811270236969, -0.3081490993499756, 0.38520118594169617, -0.7410954833030701, -0.21499381959438324, -0.1561906784772873, -0.11313416808843613, 0.34357771277427673, 0.3399040997028351, -0.18506388366222382, 0.12382491677999496, 1.2156994342803955, -0.1396951973438263, -0.3212921917438507, -0.27334827184677124, -0.930084764957428, 0.475454181432724, 0.7842856645584106, 1.2950489521026611, -0.5964053273200989, 0.4627447724342346, 1.3290414810180664, -0.0572047233581543, -0.09246160089969635, -0.6627869009971619, -0.7566107511520386, -0.06078701466321945, 0.848246157169342, -0.5863990187644958, -0.5329974889755249, 0.09658370167016983, 0.027975669130682945, 0.6177185773849487, -0.04655110090970993, -0.030966976657509804, 0.013726498000323772, -0.22921589016914368, -0.7669017910957336, 0.07703749090433121, 0.29825231432914734, 0.9899856448173523, -1.0944150686264038, -0.2984326183795929, -1.128414511680603, 0.04052069038152695, -0.058677565306425095, 0.41800764203071594, 0.16374734044075012, -0.90087890625, 0.2801326811313629, 0.09316585958003998, 0.29608434438705444, 0.5044528245925903, -0.7611808180809021, -1.2887448072433472, 0.08514372259378433, 1.0253826379776, -0.17309318482875824, -0.3475188910961151, -0.6366944313049316, -0.6443862318992615, -0.5002285242080688, -0.7117020487785339, 0.06198521703481674, -0.1600748598575592, 0.015866978093981743, -0.5818868279457092, -0.647022545337677, -0.41770777106285095, 0.48500046133995056, 0.765404999256134, 0.46633195877075195, -0.12099336087703705, -0.4238016605377197, 0.31663092970848083, -0.5596405267715454, -0.6255822777748108, 0.5042165517807007, 0.30700555443763733, 1.0557116270065308, -0.1764436513185501, -0.8665717244148254, 0.10529574006795883, -0.24644719064235687, 0.5005451440811157, -1.3175855875015259, 1.3235517740249634, -0.4678262174129486, 0.29670482873916626, 0.4287731349468231, -0.18272879719734192, 1.136323094367981, -0.060519006103277206, 0.3662991225719452, -0.05149295553565025, -0.06448233872652054, 0.09062666445970535, 0.8382924795150757, 0.22716869413852692, 0.3326169550418854, 0.23850713670253754, 0.3391837477684021, 0.2032596319913864, -0.8348771929740906, 1.100507378578186, -0.23973676562309265, -0.5524320006370544, -0.4914652407169342, -0.42390093207359314, 0.791691780090332, 0.6047901511192322, 0.1280403584241867, 0.6563240885734558, -0.39996808767318726, -0.396649569272995, 0.1846039742231369, -0.1466812789440155, -0.12750343978405, 0.09195061773061752, -0.19103752076625824, -0.38256481289863586, -0.2412632256746292, -0.5799372792243958, -0.5381296277046204, 2.4672303199768066, 0.5755876898765564, 0.3520300090312958, 0.03696245700120926, 0.10375070571899414, 0.6747127175331116, 0.8284744620323181, 0.3731665015220642, 0.08635182678699493, 1.1028707027435303, -0.19607506692409515, -0.20909397304058075, -0.6986364722251892, 1.13044011592865, 1.379359483718872, -1.2267109155654907, -0.5646047592163086, -0.056162621825933456, 0.5919327139854431, 0.014918968081474304, 0.7786927819252014, 0.8922175168991089, 0.5310847163200378, -0.6639813184738159, 0.8958407640457153, 0.16278518736362457, 0.3675796091556549, -0.544901430606842, 0.7877127528190613, 0.34200188517570496, 1.1667535305023193, 0.24313676357269287, -0.8482715487480164, 0.24395053088665009, 0.3277050852775574, -0.30899301171302795, 1.8663437366485596, -1.5529788732528687, 0.4967755675315857, -1.628327488899231, 0.713384211063385, -0.5392777323722839, 0.7127722501754761, 1.2514997720718384, 0.21510981023311615, 0.7542470693588257, 0.5985560417175293, -0.6559357047080994, 0.20439299941062927, 0.33192285895347595, 0.9744948148727417, 0.7750658392906189, 0.6497452855110168, -0.5081442594528198, -0.7836322784423828, -0.2958725392818451, 1.0529996156692505, -1.1980235576629639, -0.1826217621564865, -0.4727773368358612, -0.9213812947273254, -0.29622402787208557, -0.2694981098175049, 0.3644333779811859, 1.0778552293777466, 1.7374933958053589, -0.7023530602455139, 0.3536979854106903, -0.6419097185134888, 2.0303003787994385, -1.1257400512695312, 0.5060145854949951, -0.7585269808769226, 0.32832401990890503, 0.24309995770454407, 0.5384352803230286, -0.2331986427307129, -0.38570693135261536, -0.7087887525558472, 0.34297415614128113, -0.995233416557312, -0.13062383234500885, -0.06722025573253632, -1.6153814792633057, -0.12021982669830322, -0.5574144124984741, 0.5285707116127014, -0.90850430727005, 0.6456660628318787, -0.40536579489707947, -0.3616882860660553, 0.08311755210161209, 0.7874150276184082, 0.2547783851623535, 1.6669806241989136, 0.18103191256523132, 0.10704071074724197, -0.05369008332490921, 0.12932467460632324, 1.2410509586334229, 0.5079287886619568, 0.8141198754310608, 0.4599481225013733, 0.38302281498908997, -0.06545599550008774, -0.2322307974100113, -0.5022605061531067, -0.36497852206230164, -0.43102291226387024, 0.654565155506134, 0.12346255034208298, -0.050378769636154175, 0.30684730410575867, 0.9945319294929504, -1.045045256614685, -0.5686671137809753, 0.7603797912597656, -0.4782803952693939, -0.5842070579528809, -0.9430942535400391, 0.01927129738032818, -0.8310476541519165, -0.007236797362565994, 0.7941333055496216, -0.4434758722782135, -0.03617757558822632, 0.15639768540859222, 0.19681403040885925, 0.586264431476593, -0.9079431891441345, -0.2374633103609085, -1.0875294208526611, 0.7091854810714722, 0.7250879406929016, -0.19237469136714935, 0.1601739227771759, -0.217831090092659, -1.3801144361495972, -0.24761919677257538, -0.4730326235294342, -1.328752875328064, -0.2804594039916992] [0.41489696502685547, 0.18002641201019287, 0.561460554599762, -0.713772714138031, -0.07309852540493011, -1.1265439987182617, 0.20890603959560394, -0.3969886004924774, -0.7927326560020447, 0.4229166805744171, 0.5442555546760559, 0.21927449107170105, 0.6342783570289612, -0.2930449843406677, -0.5615965723991394, -0.014046917669475079, 1.0306090116500854, 0.23072512447834015, -0.1802285760641098, 0.740361213684082, -1.006202220916748, -0.5434468984603882, -0.7793133854866028, 0.4542013704776764, 0.7093661427497864, 0.2401447296142578, -0.7151932120323181, 0.029987050220370293, 0.9905703663825989, -0.5492140054702759, 0.7379021644592285, -0.16019490361213684, 0.09952100366353989, 0.22987930476665497, -0.08831606060266495, 0.38246139883995056, -0.40711942315101624, -0.30223748087882996, 0.8098399043083191, 0.77791827917099, -0.08636807650327682, 0.09846866130828857, -0.07165542989969254, -1.0506260395050049, 0.03086610697209835, 1.153760313987732, 0.34767594933509827, 0.06777606159448624, -0.9915438890457153, -0.11591936647891998, 0.4019276797771454, 6.8166046142578125, -0.7142663598060608, 0.5788649320602417, -0.21976980566978455, 1.6937469244003296, -0.6276425123214722, 0.0929224044084549, -0.34892621636390686, 0.257980614900589, 0.5500449538230896, -0.1231696680188179, -0.03384112939238548, -1.127967119216919, -0.060262493789196014, 0.028637632727622986, -0.47082453966140747, -0.5042051672935486, 1.4145902395248413, -1.293608546257019, -0.45750874280929565, -0.5364384651184082, -0.7269548177719116, 0.40877899527549744, 0.5220680832862854, 0.22253935039043427, 0.3341693878173828, 0.4579738676548004, 0.0024494763929396868, -0.7579873204231262, 0.7979139685630798, 0.007188692688941956, 0.6384243369102478, -0.7807246446609497, -0.2572494447231293, 0.43886980414390564, -0.38295242190361023, -0.11085496842861176, -0.3974635601043701, 0.04320823401212692, -0.8544299006462097, -0.152839794754982, -0.5147754549980164, -0.8496742248535156, -0.5240560173988342, 0.1129542738199234, 0.7663412094116211, 0.3181166350841522, -0.005823610816150904, 0.41654035449028015, 0.47667402029037476, -0.36631152033805847, -0.5527653098106384, -0.2773721218109131, 0.4723026752471924, 0.9344674348831177, -0.517783522605896, -0.9812882542610168, 0.6368355751037598, 0.23092560470104218, 0.11338550597429276, -0.18377621471881866, -0.45571041107177734, 0.49450069665908813, -0.614622175693512, -0.3892597258090973, -0.25843337178230286, -0.10395170748233795, 0.6270020604133606, -0.006832135375589132, 0.32202622294425964, -0.11719196289777756, -0.7887734174728394, -1.0492357015609741, 0.18433260917663574, -0.36697039008140564, 0.4181269109249115, 0.20344331860542297, 0.14691583812236786, 0.4187142550945282, -0.743256688117981, -0.19617392122745514, -0.6614394783973694, 0.05510752648115158, -0.17933416366577148, 0.41299089789390564, -0.27939847111701965, -1.0500783920288086, -1.214188575744629, 0.06328599900007248, 1.1770492792129517, 0.4944774806499481, 0.05039961263537407, -1.3062838315963745, -0.6730743646621704, -0.4485754370689392, 0.6543116569519043, 0.5538710355758667, 0.3313755691051483, -0.6852557063102722, 0.5944937467575073, 0.04546498879790306, 0.05270532891154289, 0.40245479345321655, 1.002812147140503, 0.08459307253360748, -0.5674684643745422, -0.06360945850610733, -0.7458858489990234, -0.7773066163063049, -0.37788987159729004, -0.5237630009651184, 0.23424871265888214, -0.41277259588241577, -0.08492272347211838, 0.5637866854667664, 0.06895969808101654, -0.8829466104507446, 0.5596416592597961, 0.1844397634267807, -0.1515999138355255, -0.25735196471214294, -0.7636865377426147, 0.2701745927333832, 0.5343819260597229, -0.15167692303657532, -0.17862817645072937, -0.026159757748246193, -1.290148377418518, 0.9481772780418396, -1.2689645290374756, 0.5989041924476624, 0.025032099336385727, -0.2453363686800003, -1.1416598558425903, -0.45058050751686096, -1.0790046453475952, 0.710077166557312, 0.418355256319046, -0.1667463779449463, -1.259493112564087, -1.3130468130111694, -0.6224498748779297, -0.2735031247138977, 0.4221976697444916, 1.065887689590454, -0.09739595651626587, -0.2756505608558655, -1.20378577709198, -0.21846549212932587, 0.5217752456665039, -0.5991029739379883, 0.004917327780276537, 0.6632588505744934, 0.5113404989242554, 0.5118624567985535, -0.08311142027378082, 0.2946402132511139, -0.42651858925819397, 0.28469544649124146, -1.3631603717803955, 0.06742022186517715, 0.7540102005004883, -0.850586473941803, 1.0223673582077026, -0.021624276414513588, -0.7806182503700256, 0.2796742022037506, -0.45584672689437866, -0.2959609925746918, 0.8150516748428345, -0.9451377987861633, -0.0019305909518152475, -0.45860522985458374, -1.139892816543579, -0.4995937943458557, -0.3039773106575012, 0.4720744490623474, 0.7143376469612122, -0.3116994798183441, 0.2628323435783386, -0.5481320023536682, -0.07789741456508636, -0.0565154068171978, 0.3773666024208069, 0.13579177856445312, -0.07674349844455719, 0.32884058356285095, -0.23524679243564606, 1.0552741289138794, -0.8928597569465637, 0.647858202457428, 0.4961360991001129, -0.32557034492492676, -0.5607933402061462, 0.3765297532081604, -0.3781016767024994, -1.273052453994751, -0.483956903219223, -0.6884268522262573, 0.03507574275135994, 0.33494946360588074, 0.589935302734375, -1.1322966814041138, 0.28506800532341003, -0.1504676192998886, 0.544804036617279, -0.48457589745521545, 0.946903645992279, -0.1040443629026413, 0.5274859666824341, 0.0161899384111166, 0.33835265040397644, -0.3791966438293457, -0.5960889458656311, -0.0719633474946022, 0.12016402930021286, -0.5230668187141418, -1.3283578157424927, -0.13496333360671997, -0.8513014912605286, 0.5400775671005249, -0.34770408272743225, -0.44533535838127136, 0.9882565140724182, -0.13792140781879425, 0.31111377477645874, -0.4985087215900421, -1.4423425197601318, -1.2591078281402588, -0.5890870690345764, 0.06626687198877335, 0.9693787693977356, 0.042641531676054, -0.518607497215271, -1.0431371927261353, -0.1935112178325653, 0.5081914067268372, -0.36752232909202576, -0.9058815836906433, -0.05688253417611122, 0.3604726493358612, 0.9649266004562378, 0.3637036681175232, 1.8936489820480347, -0.4933052361011505, 0.4767565429210663, 0.29292091727256775, -0.21942880749702454, -0.8247604966163635, -0.15233661234378815, -0.3363973796367645, -1.0418879985809326, 1.3412529230117798, -0.2611697316169739, 1.1505215167999268, 0.8415245413780212, 0.09075582027435303, -0.07369053363800049, 0.34144654870033264, 0.2466055452823639, 0.19890938699245453, 0.4674381613731384, 0.44403669238090515, -0.16418889164924622, -0.044367413967847824, 0.0848860889673233, -0.12216402590274811, 0.5234588980674744, -0.49518656730651855, 0.687107503414154, 0.08314637094736099, 0.2709135115146637, 0.5276418328285217, 0.33556511998176575, 0.6668796539306641, 0.599198043346405, 0.462322860956192, -0.31013399362564087, 1.1821662187576294, 0.6107273697853088, -0.7744988203048706, 0.45531532168388367, 0.37497183680534363, 0.5089811086654663, 1.1222643852233887, 0.3619610369205475, -0.3210321068763733, 0.0489053800702095, 0.027097228914499283, 0.46970149874687195, 0.019650882109999657, 0.5110194087028503, -1.2780526876449585, -0.33422714471817017, -0.008815762586891651, -0.31310003995895386, -1.333836555480957, -0.6688758134841919, -1.0299427509307861, -0.8237630128860474, 0.971903920173645, -0.8390913009643555, -0.7669461369514465, 0.42453432083129883, 0.36390241980552673, 1.1778573989868164, -0.4684995114803314, 0.210410013794899, 0.22335204482078552, 0.41366904973983765, 0.03556377440690994, -1.2555733919143677, 0.47800594568252563, -0.0914643257856369, -0.953837513923645, 1.0881595611572266, 0.7999917268753052, -0.25703558325767517, -0.5364018082618713, 1.07231605052948, -0.5731338858604431, 0.9637861251831055, -0.23160915076732635, -0.08170121163129807, 1.0511478185653687, -0.16382309794425964, -0.020108504220843315, 0.18154023587703705, -0.49983304738998413, 0.28992658853530884, -1.109437346458435, 0.467001736164093, 0.49530839920043945, -0.04226542264223099, -0.045648541301488876, 0.03818820044398308, -0.6033397316932678, -0.39582666754722595, -1.5049718618392944, -0.589576780796051, 0.06872391700744629, 1.043256163597107, 0.6970863342285156, 0.7028191685676575, -0.3780542016029358, 0.38150861859321594, -0.1790696680545807, 0.45752546191215515, 0.2951186001300812, 0.8329779505729675, -0.7458158731460571, -0.6089974641799927, 0.29394373297691345, 1.1143293380737305, -0.7228506803512573, 0.2119901329278946, -0.03686250001192093, 0.5622328519821167, -1.2694120407104492, -1.2862690687179565, 0.20426902174949646, -0.23095977306365967, -0.985540509223938, 1.40882408618927, 0.05481738597154617, -0.7725485563278198, 0.912451446056366, 0.9513072371482849, -1.6304607391357422, -0.2651917636394501, 1.3636319637298584, 0.9084669947624207, 0.48278096318244934, 0.2858031690120697, -0.48541703820228577, 0.19089536368846893, -0.16276292502880096, 0.618647575378418, -0.3150933086872101, -0.2570691704750061, 0.4068209230899811, 0.36377033591270447, -0.20864231884479523, -0.6517857313156128, -0.2810741066932678, -0.7485602498054504, 0.511651873588562, -0.045429520308971405, -0.13048768043518066, -0.5543938279151917, 0.25403741002082825, 0.3738241493701935, 0.31392988562583923, -0.5375092625617981, 0.3512679934501648, 0.983526349067688, -0.7378290891647339, 0.08495096117258072, 0.5141001343727112, -0.33415982127189636, 0.003666890552267432, -0.74089515209198, -0.5137088894844055, 1.2008111476898193, 0.2913973331451416, 0.2356109619140625, -0.374891996383667, 0.1308322250843048, -0.3207496106624603, 0.16697357594966888, -0.04032260924577713, 0.6326966881752014, 0.8855616450309753, 0.7824673056602478, 0.25811976194381714, 0.3850763738155365, -0.785941481590271, 1.5574308633804321, 0.06206521764397621, 0.2819133400917053, 1.1316373348236084, 0.39941638708114624, -0.30124297738075256, -0.9352133870124817, -0.516106903553009, 0.525023877620697, -0.3521271347999573, -1.5384856462478638, 0.011084230616688728, 1.0560556650161743, -0.3306128978729248, -0.17003631591796875, -0.9304596781730652, -0.22883984446525574, 0.4457363188266754, -0.2991601824760437, -0.10149872303009033, -0.162405863404274, -0.535854160785675, -0.6379427909851074, -0.3417190611362457, 0.5128260254859924, -0.40927988290786743, 0.1503661572933197, -0.44181278347969055, -0.494019091129303, 0.8243141770362854, -1.3137563467025757, 0.7403963804244995, 0.14349548518657684, -0.1009145975112915, -0.5087650418281555, -0.3688948154449463, 0.7094640731811523, -0.8127416968345642, -0.45292821526527405, 0.3924679160118103, -0.2823103070259094, 0.264538437128067, 0.7275561094284058, -0.5878637433052063, 0.20731671154499054, 1.0552395582199097, 0.169746533036232, -0.05283965915441513, -0.0673459842801094, -0.2665306031703949, -0.007745814975351095, 0.5111510157585144, 1.3251066207885742, -0.22384533286094666, -0.011066828854382038, 1.1494786739349365, -0.2440960705280304, 0.42581695318222046, -0.2626330554485321, -0.0741608515381813, 0.25561171770095825, 1.2040947675704956, -0.7080033421516418, -0.17008467018604279, 0.3879179358482361, -1.1145952939987183, 0.4029673635959625, 0.6401030421257019, 0.11682738363742828, 0.22853530943393707, -0.2842472493648529, -0.550287663936615, -0.11656884104013443, 0.3252657353878021, 0.3492045998573303, -0.6774864196777344, -0.19930227100849152, -1.079275369644165, -0.410704642534256, 0.1433437615633011, 0.10199572145938873, 0.7392443418502808, -0.9589189887046814, -0.11077690124511719, -0.3277633786201477, 1.3606294393539429, 0.3681701123714447, -1.5858020782470703, -1.6833293437957764, -0.19371488690376282, 1.1753634214401245, -0.38664963841438293, -0.05535077303647995, -0.14773130416870117, -1.214984655380249, -1.102107286453247, -0.8640909790992737, 0.12214784324169159, -0.46462467312812805, 0.27130046486854553, -0.727108359336853, 0.0034304927103221416, -0.0706263929605484, 0.14421261847019196, 0.5580758452415466, 0.6829376816749573, 0.070562943816185, 0.6693280935287476, 0.8190826177597046, -0.507415235042572, -0.018130268901586533, 0.3064761161804199, 0.17978478968143463, 1.1454379558563232, -0.310070663690567, -0.015288298018276691, -0.6705570816993713, -0.6802343130111694, 0.8009089231491089, -0.8601105809211731, 0.7256359457969666, -0.14849567413330078, 0.44545358419418335, 0.2789051830768585, -0.7910069823265076, 0.6146180033683777, 0.589844286441803, 0.08196008205413818, -0.02042974904179573, 0.8271803855895996, -0.1796117126941681, 0.8538872599601746, 0.37113118171691895, -0.14405234158039093, 0.848212718963623, 0.6218629479408264, -0.3892332911491394, -1.1145650148391724, 1.7460392713546753, -0.34239426255226135, -0.22511045634746552, -1.2837255001068115, -0.8734902143478394, 1.5402328968048096, 0.5981138944625854, 0.26523706316947937, 0.42352986335754395, -0.15274330973625183, -0.8479700088500977, 0.1663457453250885, -1.2514631748199463, -0.348184734582901, 0.17357604205608368, -0.28094592690467834, 0.7669747471809387, 0.3626784682273865, -0.6174952387809753, 0.6507523655891418, 2.320756196975708, 0.1719214767217636, 0.5024076104164124, 0.08224620670080185, -0.16726864874362946, -0.7558921575546265, 0.6991190910339355, -0.2307605743408203, 0.14962828159332275, 0.831000030040741, -0.5352258086204529, -0.7110792994499207, -0.20689690113067627, 0.8518713116645813, 1.2452000379562378, -0.6127898097038269, -0.840806782245636, 0.015019642189145088, 0.9831858277320862, 0.4216620922088623, 0.34534963965415955, 0.49341586232185364, -0.3096385896205902, 0.3454594910144806, 1.1474897861480713, -0.3702288269996643, 0.5736805200576782, -0.529059112071991, 0.2684384286403656, -0.565274178981781, 1.5739392042160034, 0.3678106367588043, -1.1600068807601929, 0.18976642191410065, -0.15612633526325226, -0.2328411042690277, 1.3208587169647217, -1.0418058633804321, -0.21566569805145264, -1.2317478656768799, 0.8842988610267639, 0.4452511966228485, 0.7638844847679138, 1.381919264793396, 0.5047497153282166, 0.5279115438461304, 0.008420669473707676, -0.40525880455970764, 0.6778031587600708, 0.2365281879901886, 0.8279597163200378, -0.2571316659450531, 0.13338637351989746, -0.980087399482727, -0.8114913105964661, 0.11777476221323013, 0.08072476089000702, -1.3490712642669678, 0.2666512727737427, -0.7261788249015808, -0.9886770248413086, -0.9911016821861267, 0.37455204129219055, 0.11867319047451019, 0.49124860763549805, 1.3961111307144165, -0.6709793210029602, 0.4587255120277405, -0.9463617205619812, 1.7625516653060913, -0.9426255822181702, 0.28480321168899536, -0.09367938339710236, -0.7351504564285278, 0.7064381241798401, 0.029818011447787285, 0.01765119470655918, -0.19622504711151123, -0.8554552793502808, 1.193114161491394, -1.4232760667800903, 0.36091509461402893, -0.25053295493125916, -0.6231593489646912, 0.12150875478982925, -0.8401833176612854, 0.5820302963256836, -1.3182824850082397, 0.6754477620124817, 0.07458074390888214, -0.15698251128196716, 0.6149181723594666, 0.05498393252491951, 1.2878520488739014, 1.1312137842178345, 0.6659514307975769, -0.410190612077713, -0.12032634764909744, 0.7545129060745239, 0.8842192888259888, 0.16177071630954742, 0.8057838082313538, -0.06899452209472656, 0.5601221323013306, -0.7878770232200623, -0.9139524102210999, -0.9517109990119934, -1.2109438180923462, -0.2928047180175781, 0.15414118766784668, 0.7641659379005432, 0.25945940613746643, 0.48417097330093384, 0.8565254211425781, -1.1209555864334106, -0.905066967010498, 0.8768170475959778, -0.8439682722091675, -0.34720560908317566, -1.254891276359558, -0.0403154082596302, -0.6506708860397339, 0.08829600363969803, 0.6325612664222717, -0.5611671805381775, 0.6844742894172668, 0.1881566196680069, -0.34477224946022034, 0.5640733242034912, -1.162740707397461, 0.03258917108178139, -0.17497269809246063, 0.5673249363899231, 0.12084273248910904, 0.13355965912342072, 0.332979291677475, -0.03616919741034508, -0.4313094913959503, -0.6343693733215332, -0.8951416015625, -1.1531368494033813, -0.4523777663707733] [0.4920336604118347, 0.10908447951078415, 0.6220282912254333, -0.8172762393951416, -0.0172878447920084, -1.082179307937622, 0.08358962088823318, -0.43109652400016785, -0.6857222318649292, 0.482044517993927, 0.574638307094574, 0.23651844263076782, 0.6656460762023926, -0.3624168038368225, -0.6229116916656494, -0.04634393751621246, 0.9467546939849854, 0.31256917119026184, -0.26216524839401245, 0.8070294857025146, -1.053890347480774, -0.5277813673019409, -0.6911299824714661, 0.5467128753662109, 0.7301730513572693, 0.25805240869522095, -0.7111438512802124, 0.113237164914608, 0.8930057287216187, -0.5718024969100952, 0.6508647799491882, -0.09699757397174835, 0.10565908998250961, 0.12605233490467072, -0.15494464337825775, 0.26100000739097595, -0.3432985246181488, -0.396549254655838, 0.7586594223976135, 0.7824206352233887, -0.09715943038463593, 0.018737468868494034, -0.13504374027252197, -1.0563503503799438, 0.023445824161171913, 1.2112932205200195, 0.3816203773021698, -0.007280820049345493, -0.9029284119606018, -0.21816867589950562, 0.48887431621551514, 6.674034595489502, -0.7094519138336182, 0.5629515051841736, -0.1283189207315445, 1.6925941705703735, -0.6943728923797607, 0.14076462388038635, -0.324573278427124, 0.1854572296142578, 0.4622342586517334, -0.03962334245443344, -0.02855786122381687, -1.2092689275741577, -0.13577260076999664, 0.05619719251990318, -0.4515755772590637, -0.5282979011535645, 1.3394416570663452, -1.3122180700302124, -0.3638785779476166, -0.5524658560752869, -0.8665051460266113, 0.4188306927680969, 0.35245823860168457, 0.18959225714206696, 0.3422941267490387, 0.48402994871139526, -0.11255009472370148, -0.8726423382759094, 0.7677830457687378, -0.18959961831569672, 0.6283653974533081, -0.8090923428535461, -0.2189481109380722, 0.5197792649269104, -0.47023072838783264, -0.23056279122829437, -0.29831963777542114, 0.0698205977678299, -0.777651846408844, -0.1707899123430252, -0.4841335117816925, -0.8770488500595093, -0.5996758937835693, 0.10644242912530899, 0.7668167352676392, 0.5369940996170044, 0.08956141769886017, 0.46660399436950684, 0.5913860201835632, -0.4091580808162689, -0.6571468114852905, -0.20629428327083588, 0.4907554090023041, 0.9566454887390137, -0.4630260765552521, -1.0321314334869385, 0.6455925703048706, 0.29897087812423706, 0.09682691842317581, -0.2832922637462616, -0.4748339056968689, 0.4444367289543152, -0.5935534834861755, -0.46210870146751404, -0.17551198601722717, -0.1486099660396576, 0.6104698181152344, -0.08406971395015717, 0.27185019850730896, -0.04857826232910156, -0.7292516231536865, -1.1152054071426392, 0.06995436549186707, -0.48349177837371826, 0.5438783168792725, 0.10241805762052536, 0.25061455368995667, 0.4124375581741333, -0.7958027124404907, -0.09205793589353561, -0.6556338667869568, 0.038283880800008774, -0.13238945603370667, 0.49543488025665283, -0.3759034276008606, -1.0424665212631226, -1.1409229040145874, -0.04487154632806778, 1.1975750923156738, 0.5370091199874878, 0.10628437250852585, -1.2367820739746094, -0.5505634546279907, -0.47297072410583496, 0.7646276354789734, 0.6122051477432251, 0.31502312421798706, -0.7928292751312256, 0.5658049583435059, 0.12381043285131454, 0.0544818639755249, 0.34938663244247437, 1.024865746498108, 0.07034488022327423, -0.7987285256385803, -0.08529385179281235, -0.732083261013031, -0.7464345097541809, -0.2965873181819916, -0.5903446674346924, 0.31121835112571716, -0.49035149812698364, -0.1161579042673111, 0.6199470162391663, 0.02598324976861477, -0.9596051573753357, 0.67239910364151, 0.17341694235801697, -0.011908798478543758, -0.2514725923538208, -0.6672439575195312, 0.2682822346687317, 0.44056224822998047, -0.16246603429317474, -0.21381701529026031, -0.03889461234211922, -1.2547725439071655, 0.8832399249076843, -1.3109149932861328, 0.513184666633606, -0.024973154067993164, -0.2751806378364563, -1.2513153553009033, -0.36366549134254456, -1.1608620882034302, 0.7135887145996094, 0.4349428117275238, -0.05623399838805199, -1.0940048694610596, -1.4164471626281738, -0.5401841998100281, -0.14013978838920593, 0.43710315227508545, 0.9835366606712341, -0.045076530426740646, -0.22733141481876373, -1.212554931640625, -0.2311214804649353, 0.5540556907653809, -0.467276394367218, -0.042967986315488815, 0.7316970825195312, 0.4713551104068756, 0.5539708137512207, -0.19205771386623383, 0.3992154598236084, -0.4731062054634094, 0.328643798828125, -1.3466838598251343, 0.12016326189041138, 0.6908984780311584, -0.9389122724533081, 0.929217517375946, -0.09657981991767883, -0.7246034741401672, 0.3259926438331604, -0.38236841559410095, -0.19337618350982666, 0.9003579616546631, -0.8676863312721252, 0.02491917833685875, -0.44798213243484497, -1.0312516689300537, -0.3747483193874359, -0.2827095687389374, 0.39302024245262146, 0.7769198417663574, -0.1577269583940506, 0.3127179741859436, -0.5897473692893982, -0.027262575924396515, -0.04718969762325287, 0.4032242000102997, 0.10172925144433975, -0.19151008129119873, 0.25982531905174255, -0.386705607175827, 1.0409934520721436, -0.8055135607719421, 0.6805919408798218, 0.5046014189720154, -0.3699510097503662, -0.6516329646110535, 0.3443463146686554, -0.39972612261772156, -1.2775356769561768, -0.5017715096473694, -0.6229661703109741, -0.030185595154762268, 0.1970410794019699, 0.6446097493171692, -1.1042557954788208, 0.1773117482662201, -0.15625618398189545, 0.43976154923439026, -0.6175628900527954, 0.9377044439315796, -0.04408580809831619, 0.7155253291130066, 0.12891264259815216, 0.29426583647727966, -0.34475114941596985, -0.5334733724594116, -0.11781279742717743, 0.1971552073955536, -0.4775475263595581, -1.3980488777160645, -0.18642590939998627, -0.9123989343643188, 0.5537704229354858, -0.3462740480899811, -0.5182791352272034, 1.069893717765808, -0.14195716381072998, 0.4228779375553131, -0.5802431106567383, -1.5206806659698486, -1.2385220527648926, -0.5131803154945374, 0.058006152510643005, 0.9046098589897156, 0.13792307674884796, -0.4819745719432831, -1.0193817615509033, -0.1043049767613411, 0.5629732012748718, -0.39609041810035706, -0.9054643511772156, 0.0075250654481351376, 0.24341487884521484, 0.9825631976127625, 0.3799956738948822, 2.0571203231811523, -0.40682241320610046, 0.6816129088401794, 0.28505566716194153, -0.21231773495674133, -0.8401006460189819, 0.02104341983795166, -0.3190205991268158, -1.0568586587905884, 1.2545487880706787, -0.2596133351325989, 1.12460458278656, 0.9581298232078552, 0.13456369936466217, 0.0597972571849823, 0.39617785811424255, 0.421674519777298, 0.29839688539505005, 0.5632389187812805, 0.49910080432891846, -0.10798858851194382, -0.11904347687959671, 0.3410746455192566, -0.13204671442508698, 0.47237318754196167, -0.42175400257110596, 0.650764524936676, 0.1796715408563614, 0.4026961922645569, 0.501923680305481, 0.2478848546743393, 0.5674642324447632, 0.6605359315872192, 0.4520508646965027, -0.36473265290260315, 1.13140070438385, 0.7332407236099243, -0.802711546421051, 0.5061956644058228, 0.29733574390411377, 0.5858821868896484, 1.0159715414047241, 0.49037638306617737, -0.4298998713493347, 0.008528097532689571, 0.01988670788705349, 0.647376537322998, -0.000221415059058927, 0.5592238306999207, -1.2885518074035645, -0.35783395171165466, -0.01469860877841711, -0.2677590847015381, -1.3769738674163818, -0.5902727842330933, -0.9660661816596985, -0.8364692330360413, 1.0408990383148193, -0.9220778346061707, -0.6464837789535522, 0.44266486167907715, 0.3720921277999878, 1.0969607830047607, -0.5080428123474121, 0.04148286208510399, 0.2008965164422989, 0.5160264372825623, 0.05232817307114601, -1.218543291091919, 0.4208379089832306, -0.24355807900428772, -1.0375721454620361, 1.2204159498214722, 0.8600040078163147, -0.2883125841617584, -0.5335080623626709, 1.1393407583236694, -0.6178647875785828, 0.8895626664161682, -0.19621875882148743, -0.06203481927514076, 1.0370372533798218, -0.07961231470108032, -0.10775742679834366, 0.33841472864151, -0.43302321434020996, 0.3017716705799103, -1.2042216062545776, 0.5601984262466431, 0.41335925459861755, -0.24649101495742798, -0.0477745495736599, 0.0973876342177391, -0.49819839000701904, -0.38124796748161316, -1.2467509508132935, -0.5322380065917969, 0.03134532645344734, 0.9984041452407837, 0.6787906885147095, 0.6526946425437927, -0.28295332193374634, 0.35899606347084045, -0.24584056437015533, 0.4074610769748688, 0.33917734026908875, 0.8340765833854675, -0.6798887848854065, -0.6467978358268738, 0.24363651871681213, 1.1346179246902466, -0.7935081124305725, 0.25985005497932434, -0.029854057356715202, 0.4847850501537323, -1.381759524345398, -1.261519432067871, 0.16996297240257263, -0.18073157966136932, -0.9655662178993225, 1.327100396156311, 0.07991550117731094, -0.9340461492538452, 0.9125823974609375, 0.8980376124382019, -1.6128357648849487, -0.29740050435066223, 1.3800140619277954, 0.9272350072860718, 0.5531338453292847, 0.21597431600093842, -0.6183819770812988, 0.12095560133457184, -0.17756031453609467, 0.581550657749176, -0.3103291392326355, -0.24203957617282867, 0.38189440965652466, 0.33622050285339355, -0.35826435685157776, -0.6169346570968628, -0.27280017733573914, -0.7736434936523438, 0.49404650926589966, -0.10982108861207962, -0.19479623436927795, -0.5944305062294006, 0.17550887167453766, 0.21745182573795319, 0.29200273752212524, -0.5835112929344177, 0.40121522545814514, 1.1413698196411133, -0.7570382952690125, 0.1054716557264328, 0.5056400895118713, -0.4684614837169647, -0.05324781313538551, -0.6985005736351013, -0.30021923780441284, 1.229934811592102, 0.27960875630378723, 0.283799409866333, -0.2557637691497803, 0.1881309598684311, -0.2865733802318573, 0.24619892239570618, 0.00015231966972351074, 0.6866142153739929, 0.8866078853607178, 0.8432091474533081, 0.16686484217643738, 0.39845654368400574, -0.8452870845794678, 1.4856454133987427, 0.17297668755054474, 0.4626327157020569, 1.1783742904663086, 0.42554184794425964, -0.24265550076961517, -0.910582423210144, -0.5122216939926147, 0.4768104553222656, -0.42157575488090515, -1.5434472560882568, 0.02475241757929325, 1.1184115409851074, -0.41697123646736145, -0.22719334065914154, -0.8432290554046631, -0.24846681952476501, 0.5849250555038452, -0.3179154694080353, -0.15415680408477783, 0.010802078060805798, -0.6599926948547363, -0.5680645704269409, -0.39423856139183044, 0.6030900478363037, -0.2872925102710724, 0.16922792792320251, -0.422894686460495, -0.4747609794139862, 0.726047158241272, -1.2934620380401611, 0.7704787850379944, 0.1668609380722046, -0.12878809869289398, -0.5328594446182251, -0.2928054630756378, 0.78932785987854, -0.868039608001709, -0.5329636931419373, 0.3347477316856384, -0.17362788319587708, 0.30565863847732544, 0.6366897821426392, -0.6390156745910645, 0.26043832302093506, 1.0975406169891357, 0.1735703945159912, -0.10260608047246933, -0.02365603856742382, -0.30612650513648987, -0.04089193418622017, 0.7050548791885376, 1.3678197860717773, -0.19657038152217865, 0.049418769776821136, 1.1452518701553345, -0.15810643136501312, 0.48413464426994324, -0.21218448877334595, -0.07235384732484818, 0.15106719732284546, 1.0604978799819946, -0.887958288192749, -0.213522806763649, 0.4794853925704956, -1.1072196960449219, 0.4456885755062103, 0.4839174747467041, 0.0861307829618454, 0.12255865335464478, -0.27022916078567505, -0.5033141374588013, -0.22927798330783844, 0.3070770800113678, 0.4032990336418152, -0.8154269456863403, -0.1379108726978302, -1.0443869829177856, -0.3716321885585785, 0.2849904000759125, 0.13759230077266693, 0.7323493361473083, -0.8845424056053162, -0.0728713646531105, -0.24798431992530823, 1.3260366916656494, 0.3942298889160156, -1.623480200767517, -1.6232417821884155, -0.11083663254976273, 1.0251375436782837, -0.3609720766544342, 0.03875202313065529, -0.16894744336605072, -1.255350947380066, -1.0664998292922974, -0.8796232342720032, 0.15282857418060303, -0.6016327142715454, 0.21802835166454315, -0.9047738909721375, 0.02553386613726616, -0.09258890151977539, 0.1647273451089859, 0.4744870960712433, 0.6672095656394958, 0.08232253789901733, 0.609017014503479, 0.8413460850715637, -0.4639427065849304, -0.13847985863685608, 0.42899101972579956, 0.15705178678035736, 1.1672049760818481, -0.501354455947876, -0.04367918521165848, -0.6593639850616455, -0.5997791886329651, 0.870492696762085, -0.9273963570594788, 0.7667270302772522, -0.13340376317501068, 0.3271072506904602, 0.20575587451457977, -0.8877889513969421, 0.6971709132194519, 0.5383040308952332, 0.1360493302345276, -0.09642039984464645, 0.7710162997245789, -0.17650344967842102, 0.9556772708892822, 0.28920501470565796, -0.15006272494792938, 0.8313986659049988, 0.6752024292945862, -0.40016934275627136, -1.088746428489685, 1.727831244468689, -0.3160720765590668, -0.06933348625898361, -1.4496642351150513, -0.7744280099868774, 1.4722933769226074, 0.5927612781524658, 0.21859051287174225, 0.1828787624835968, -0.13521714508533478, -0.7429524064064026, 0.22657378017902374, -1.2651453018188477, -0.32805415987968445, 0.19094350934028625, -0.2527753710746765, 0.6958619952201843, 0.3212263286113739, -0.43158936500549316, 0.6621645092964172, 2.2289862632751465, 0.08800377696752548, 0.45068201422691345, 0.07892600446939468, -0.24512667953968048, -0.7649081945419312, 0.8365783095359802, -0.32413172721862793, 0.12233111262321472, 0.7825440168380737, -0.49488410353660583, -0.7300084829330444, -0.24660749733448029, 0.7980522513389587, 1.2592157125473022, -0.713848352432251, -0.8567062616348267, -0.01762532629072666, 0.9474735260009766, 0.47864529490470886, 0.4705173671245575, 0.5332598090171814, -0.44905874133110046, 0.35184720158576965, 1.0676780939102173, -0.2606600522994995, 0.6580814123153687, -0.47593584656715393, 0.2619589567184448, -0.37655410170555115, 1.3303016424179077, 0.3716006577014923, -1.150912880897522, 0.040988218039274216, -0.1772589087486267, -0.15251770615577698, 1.2696739435195923, -0.9747717380523682, -0.2624235451221466, -1.208828330039978, 0.8605745434761047, 0.4288804829120636, 0.8203335404396057, 1.3764358758926392, 0.5313624739646912, 0.5780356526374817, -0.042651232331991196, -0.3712703585624695, 0.7647461891174316, 0.24155575037002563, 0.848594069480896, -0.3531132936477661, 0.11326837539672852, -1.0382269620895386, -0.7367310523986816, 0.1904863864183426, 0.11650338023900986, -1.2591114044189453, 0.31314903497695923, -0.7221821546554565, -1.038111686706543, -1.087885856628418, 0.4489099681377411, 0.1322403997182846, 0.3289276361465454, 1.3409868478775024, -0.7668837904930115, 0.48565956950187683, -0.8195297122001648, 1.8901808261871338, -0.8864663243293762, 0.4016851782798767, -0.08915653079748154, -0.8248488306999207, 0.7754291296005249, 0.044126685708761215, 0.007960018701851368, -0.2723045349121094, -0.8092935085296631, 1.2997370958328247, -1.473394513130188, 0.3074958324432373, -0.023709794506430626, -0.693203330039978, 0.15125057101249695, -0.878999650478363, 0.5316171050071716, -1.3712161779403687, 0.7701994776725769, 0.050791844725608826, -0.15469461679458618, 0.5141816735267639, 0.06927329301834106, 1.1834306716918945, 1.0219414234161377, 0.6277756690979004, -0.28020650148391724, -0.18207550048828125, 0.6217793226242065, 0.7838411927223206, 0.14714765548706055, 0.8343258500099182, 0.019239751622080803, 0.534246027469635, -0.8007053732872009, -1.0096654891967773, -0.8992956280708313, -1.1736479997634888, -0.3106119632720947, 0.08412500470876694, 0.7091765999794006, 0.2744998335838318, 0.34692078828811646, 0.7882518172264099, -1.2527960538864136, -1.0031582117080688, 0.8406440019607544, -0.9628389477729797, -0.2453143149614334, -1.1806182861328125, -0.004484093748033047, -0.5947539210319519, 0.1504858434200287, 0.6611626744270325, -0.6704490780830383, 0.7503383755683899, 0.17018112540245056, -0.19780589640140533, 0.6250767707824707, -1.2449043989181519, 0.05822636932134628, -0.3097624182701111, 0.47548526525497437, 0.00535602169111371, 0.03664408624172211, 0.4045986831188202, -0.024279005825519562, -0.39808711409568787, -0.7009929418563843, -0.9311560988426208, -1.0706970691680908, -0.5040189623832703] +[0.41489696502685547, 0.18002641201019287, 0.561460554599762, -0.713772714138031, -0.07309852540493011, -1.1265439987182617, 0.20890603959560394, -0.3969886004924774, -0.7927326560020447, 0.4229166805744171, 0.5442555546760559, 0.21927449107170105, 0.6342783570289612, -0.2930449843406677, -0.5615965723991394, -0.014046917669475079, 1.0306090116500854, 0.23072512447834015, -0.1802285760641098, 0.740361213684082, -1.006202220916748, -0.5434468984603882, -0.7793133854866028, 0.4542013704776764, 0.7093661427497864, 0.2401447296142578, -0.7151932120323181, 0.029987050220370293, 0.9905703663825989, -0.5492140054702759, 0.7379021644592285, -0.16019490361213684, 0.09952100366353989, 0.22987930476665497, -0.08831606060266495, 0.38246139883995056, -0.40711942315101624, -0.30223748087882996, 0.8098399043083191, 0.77791827917099, -0.08636807650327682, 0.09846866130828857, -0.07165542989969254, -1.0506260395050049, 0.03086610697209835, 1.153760313987732, 0.34767594933509827, 0.06777606159448624, -0.9915438890457153, -0.11591936647891998, 0.4019276797771454, 6.8166046142578125, -0.7142663598060608, 0.5788649320602417, -0.21976980566978455, 1.6937469244003296, -0.6276425123214722, 0.0929224044084549, -0.34892621636390686, 0.257980614900589, 0.5500449538230896, -0.1231696680188179, -0.03384112939238548, -1.127967119216919, -0.060262493789196014, 0.028637632727622986, -0.47082453966140747, -0.5042051672935486, 1.4145902395248413, -1.293608546257019, -0.45750874280929565, -0.5364384651184082, -0.7269548177719116, 0.40877899527549744, 0.5220680832862854, 0.22253935039043427, 0.3341693878173828, 0.4579738676548004, 0.0024494763929396868, -0.7579873204231262, 0.7979139685630798, 0.007188692688941956, 0.6384243369102478, -0.7807246446609497, -0.2572494447231293, 0.43886980414390564, -0.38295242190361023, -0.11085496842861176, -0.3974635601043701, 0.04320823401212692, -0.8544299006462097, -0.152839794754982, -0.5147754549980164, -0.8496742248535156, -0.5240560173988342, 0.1129542738199234, 0.7663412094116211, 0.3181166350841522, -0.005823610816150904, 0.41654035449028015, 0.47667402029037476, -0.36631152033805847, -0.5527653098106384, -0.2773721218109131, 0.4723026752471924, 0.9344674348831177, -0.517783522605896, -0.9812882542610168, 0.6368355751037598, 0.23092560470104218, 0.11338550597429276, -0.18377621471881866, -0.45571041107177734, 0.49450069665908813, -0.614622175693512, -0.3892597258090973, -0.25843337178230286, -0.10395170748233795, 0.6270020604133606, -0.006832135375589132, 0.32202622294425964, -0.11719196289777756, -0.7887734174728394, -1.0492357015609741, 0.18433260917663574, -0.36697039008140564, 0.4181269109249115, 0.20344331860542297, 0.14691583812236786, 0.4187142550945282, -0.743256688117981, -0.19617392122745514, -0.6614394783973694, 0.05510752648115158, -0.17933416366577148, 0.41299089789390564, -0.27939847111701965, -1.0500783920288086, -1.214188575744629, 0.06328599900007248, 1.1770492792129517, 0.4944774806499481, 0.05039961263537407, -1.3062838315963745, -0.6730743646621704, -0.4485754370689392, 0.6543116569519043, 0.5538710355758667, 0.3313755691051483, -0.6852557063102722, 0.5944937467575073, 0.04546498879790306, 0.05270532891154289, 0.40245479345321655, 1.002812147140503, 0.08459307253360748, -0.5674684643745422, -0.06360945850610733, -0.7458858489990234, -0.7773066163063049, -0.37788987159729004, -0.5237630009651184, 0.23424871265888214, -0.41277259588241577, -0.08492272347211838, 0.5637866854667664, 0.06895969808101654, -0.8829466104507446, 0.5596416592597961, 0.1844397634267807, -0.1515999138355255, -0.25735196471214294, -0.7636865377426147, 0.2701745927333832, 0.5343819260597229, -0.15167692303657532, -0.17862817645072937, -0.026159757748246193, -1.290148377418518, 0.9481772780418396, -1.2689645290374756, 0.5989041924476624, 0.025032099336385727, -0.2453363686800003, -1.1416598558425903, -0.45058050751686096, -1.0790046453475952, 0.710077166557312, 0.418355256319046, -0.1667463779449463, -1.259493112564087, -1.3130468130111694, -0.6224498748779297, -0.2735031247138977, 0.4221976697444916, 1.065887689590454, -0.09739595651626587, -0.2756505608558655, -1.20378577709198, -0.21846549212932587, 0.5217752456665039, -0.5991029739379883, 0.004917327780276537, 0.6632588505744934, 0.5113404989242554, 0.5118624567985535, -0.08311142027378082, 0.2946402132511139, -0.42651858925819397, 0.28469544649124146, -1.3631603717803955, 0.06742022186517715, 0.7540102005004883, -0.850586473941803, 1.0223673582077026, -0.021624276414513588, -0.7806182503700256, 0.2796742022037506, -0.45584672689437866, -0.2959609925746918, 0.8150516748428345, -0.9451377987861633, -0.0019305909518152475, -0.45860522985458374, -1.139892816543579, -0.4995937943458557, -0.3039773106575012, 0.4720744490623474, 0.7143376469612122, -0.3116994798183441, 0.2628323435783386, -0.5481320023536682, -0.07789741456508636, -0.0565154068171978, 0.3773666024208069, 0.13579177856445312, -0.07674349844455719, 0.32884058356285095, -0.23524679243564606, 1.0552741289138794, -0.8928597569465637, 0.647858202457428, 0.4961360991001129, -0.32557034492492676, -0.5607933402061462, 0.3765297532081604, -0.3781016767024994, -1.273052453994751, -0.483956903219223, -0.6884268522262573, 0.03507574275135994, 0.33494946360588074, 0.589935302734375, -1.1322966814041138, 0.28506800532341003, -0.1504676192998886, 0.544804036617279, -0.48457589745521545, 0.946903645992279, -0.1040443629026413, 0.5274859666824341, 0.0161899384111166, 0.33835265040397644, -0.3791966438293457, -0.5960889458656311, -0.0719633474946022, 0.12016402930021286, -0.5230668187141418, -1.3283578157424927, -0.13496333360671997, -0.8513014912605286, 0.5400775671005249, -0.34770408272743225, -0.44533535838127136, 0.9882565140724182, -0.13792140781879425, 0.31111377477645874, -0.4985087215900421, -1.4423425197601318, -1.2591078281402588, -0.5890870690345764, 0.06626687198877335, 0.9693787693977356, 0.042641531676054, -0.518607497215271, -1.0431371927261353, -0.1935112178325653, 0.5081914067268372, -0.36752232909202576, -0.9058815836906433, -0.05688253417611122, 0.3604726493358612, 0.9649266004562378, 0.3637036681175232, 1.8936489820480347, -0.4933052361011505, 0.4767565429210663, 0.29292091727256775, -0.21942880749702454, -0.8247604966163635, -0.15233661234378815, -0.3363973796367645, -1.0418879985809326, 1.3412529230117798, -0.2611697316169739, 1.1505215167999268, 0.8415245413780212, 0.09075582027435303, -0.07369053363800049, 0.34144654870033264, 0.2466055452823639, 0.19890938699245453, 0.4674381613731384, 0.44403669238090515, -0.16418889164924622, -0.044367413967847824, 0.0848860889673233, -0.12216402590274811, 0.5234588980674744, -0.49518656730651855, 0.687107503414154, 0.08314637094736099, 0.2709135115146637, 0.5276418328285217, 0.33556511998176575, 0.6668796539306641, 0.599198043346405, 0.462322860956192, -0.31013399362564087, 1.1821662187576294, 0.6107273697853088, -0.7744988203048706, 0.45531532168388367, 0.37497183680534363, 0.5089811086654663, 1.1222643852233887, 0.3619610369205475, -0.3210321068763733, 0.0489053800702095, 0.027097228914499283, 0.46970149874687195, 0.019650882109999657, 0.5110194087028503, -1.2780526876449585, -0.33422714471817017, -0.008815762586891651, -0.31310003995895386, -1.333836555480957, -0.6688758134841919, -1.0299427509307861, -0.8237630128860474, 0.971903920173645, -0.8390913009643555, -0.7669461369514465, 0.42453432083129883, 0.36390241980552673, 1.1778573989868164, -0.4684995114803314, 0.210410013794899, 0.22335204482078552, 0.41366904973983765, 0.03556377440690994, -1.2555733919143677, 0.47800594568252563, -0.0914643257856369, -0.953837513923645, 1.0881595611572266, 0.7999917268753052, -0.25703558325767517, -0.5364018082618713, 1.07231605052948, -0.5731338858604431, 0.9637861251831055, -0.23160915076732635, -0.08170121163129807, 1.0511478185653687, -0.16382309794425964, -0.020108504220843315, 0.18154023587703705, -0.49983304738998413, 0.28992658853530884, -1.109437346458435, 0.467001736164093, 0.49530839920043945, -0.04226542264223099, -0.045648541301488876, 0.03818820044398308, -0.6033397316932678, -0.39582666754722595, -1.5049718618392944, -0.589576780796051, 0.06872391700744629, 1.043256163597107, 0.6970863342285156, 0.7028191685676575, -0.3780542016029358, 0.38150861859321594, -0.1790696680545807, 0.45752546191215515, 0.2951186001300812, 0.8329779505729675, -0.7458158731460571, -0.6089974641799927, 0.29394373297691345, 1.1143293380737305, -0.7228506803512573, 0.2119901329278946, -0.03686250001192093, 0.5622328519821167, -1.2694120407104492, -1.2862690687179565, 0.20426902174949646, -0.23095977306365967, -0.985540509223938, 1.40882408618927, 0.05481738597154617, -0.7725485563278198, 0.912451446056366, 0.9513072371482849, -1.6304607391357422, -0.2651917636394501, 1.3636319637298584, 0.9084669947624207, 0.48278096318244934, 0.2858031690120697, -0.48541703820228577, 0.19089536368846893, -0.16276292502880096, 0.618647575378418, -0.3150933086872101, -0.2570691704750061, 0.4068209230899811, 0.36377033591270447, -0.20864231884479523, -0.6517857313156128, -0.2810741066932678, -0.7485602498054504, 0.511651873588562, -0.045429520308971405, -0.13048768043518066, -0.5543938279151917, 0.25403741002082825, 0.3738241493701935, 0.31392988562583923, -0.5375092625617981, 0.3512679934501648, 0.983526349067688, -0.7378290891647339, 0.08495096117258072, 0.5141001343727112, -0.33415982127189636, 0.003666890552267432, -0.74089515209198, -0.5137088894844055, 1.2008111476898193, 0.2913973331451416, 0.2356109619140625, -0.374891996383667, 0.1308322250843048, -0.3207496106624603, 0.16697357594966888, -0.04032260924577713, 0.6326966881752014, 0.8855616450309753, 0.7824673056602478, 0.25811976194381714, 0.3850763738155365, -0.785941481590271, 1.5574308633804321, 0.06206521764397621, 0.2819133400917053, 1.1316373348236084, 0.39941638708114624, -0.30124297738075256, -0.9352133870124817, -0.516106903553009, 0.525023877620697, -0.3521271347999573, -1.5384856462478638, 0.011084230616688728, 1.0560556650161743, -0.3306128978729248, -0.17003631591796875, -0.9304596781730652, -0.22883984446525574, 0.4457363188266754, -0.2991601824760437, -0.10149872303009033, -0.162405863404274, -0.535854160785675, -0.6379427909851074, -0.3417190611362457, 0.5128260254859924, -0.40927988290786743, 0.1503661572933197, -0.44181278347969055, -0.494019091129303, 0.8243141770362854, -1.3137563467025757, 0.7403963804244995, 0.14349548518657684, -0.1009145975112915, -0.5087650418281555, -0.3688948154449463, 0.7094640731811523, -0.8127416968345642, -0.45292821526527405, 0.3924679160118103, -0.2823103070259094, 0.264538437128067, 0.7275561094284058, -0.5878637433052063, 0.20731671154499054, 1.0552395582199097, 0.169746533036232, -0.05283965915441513, -0.0673459842801094, -0.2665306031703949, -0.007745814975351095, 0.5111510157585144, 1.3251066207885742, -0.22384533286094666, -0.011066828854382038, 1.1494786739349365, -0.2440960705280304, 0.42581695318222046, -0.2626330554485321, -0.0741608515381813, 0.25561171770095825, 1.2040947675704956, -0.7080033421516418, -0.17008467018604279, 0.3879179358482361, -1.1145952939987183, 0.4029673635959625, 0.6401030421257019, 0.11682738363742828, 0.22853530943393707, -0.2842472493648529, -0.550287663936615, -0.11656884104013443, 0.3252657353878021, 0.3492045998573303, -0.6774864196777344, -0.19930227100849152, -1.079275369644165, -0.410704642534256, 0.1433437615633011, 0.10199572145938873, 0.7392443418502808, -0.9589189887046814, -0.11077690124511719, -0.3277633786201477, 1.3606294393539429, 0.3681701123714447, -1.5858020782470703, -1.6833293437957764, -0.19371488690376282, 1.1753634214401245, -0.38664963841438293, -0.05535077303647995, -0.14773130416870117, -1.214984655380249, -1.102107286453247, -0.8640909790992737, 0.12214784324169159, -0.46462467312812805, 0.27130046486854553, -0.727108359336853, 0.0034304927103221416, -0.0706263929605484, 0.14421261847019196, 0.5580758452415466, 0.6829376816749573, 0.070562943816185, 0.6693280935287476, 0.8190826177597046, -0.507415235042572, -0.018130268901586533, 0.3064761161804199, 0.17978478968143463, 1.1454379558563232, -0.310070663690567, -0.015288298018276691, -0.6705570816993713, -0.6802343130111694, 0.8009089231491089, -0.8601105809211731, 0.7256359457969666, -0.14849567413330078, 0.44545358419418335, 0.2789051830768585, -0.7910069823265076, 0.6146180033683777, 0.589844286441803, 0.08196008205413818, -0.02042974904179573, 0.8271803855895996, -0.1796117126941681, 0.8538872599601746, 0.37113118171691895, -0.14405234158039093, 0.848212718963623, 0.6218629479408264, -0.3892332911491394, -1.1145650148391724, 1.7460392713546753, -0.34239426255226135, -0.22511045634746552, -1.2837255001068115, -0.8734902143478394, 1.5402328968048096, 0.5981138944625854, 0.26523706316947937, 0.42352986335754395, -0.15274330973625183, -0.8479700088500977, 0.1663457453250885, -1.2514631748199463, -0.348184734582901, 0.17357604205608368, -0.28094592690467834, 0.7669747471809387, 0.3626784682273865, -0.6174952387809753, 0.6507523655891418, 2.320756196975708, 0.1719214767217636, 0.5024076104164124, 0.08224620670080185, -0.16726864874362946, -0.7558921575546265, 0.6991190910339355, -0.2307605743408203, 0.14962828159332275, 0.831000030040741, -0.5352258086204529, -0.7110792994499207, -0.20689690113067627, 0.8518713116645813, 1.2452000379562378, -0.6127898097038269, -0.840806782245636, 0.015019642189145088, 0.9831858277320862, 0.4216620922088623, 0.34534963965415955, 0.49341586232185364, -0.3096385896205902, 0.3454594910144806, 1.1474897861480713, -0.3702288269996643, 0.5736805200576782, -0.529059112071991, 0.2684384286403656, -0.565274178981781, 1.5739392042160034, 0.3678106367588043, -1.1600068807601929, 0.18976642191410065, -0.15612633526325226, -0.2328411042690277, 1.3208587169647217, -1.0418058633804321, -0.21566569805145264, -1.2317478656768799, 0.8842988610267639, 0.4452511966228485, 0.7638844847679138, 1.381919264793396, 0.5047497153282166, 0.5279115438461304, 0.008420669473707676, -0.40525880455970764, 0.6778031587600708, 0.2365281879901886, 0.8279597163200378, -0.2571316659450531, 0.13338637351989746, -0.980087399482727, -0.8114913105964661, 0.11777476221323013, 0.08072476089000702, -1.3490712642669678, 0.2666512727737427, -0.7261788249015808, -0.9886770248413086, -0.9911016821861267, 0.37455204129219055, 0.11867319047451019, 0.49124860763549805, 1.3961111307144165, -0.6709793210029602, 0.4587255120277405, -0.9463617205619812, 1.7625516653060913, -0.9426255822181702, 0.28480321168899536, -0.09367938339710236, -0.7351504564285278, 0.7064381241798401, 0.029818011447787285, 0.01765119470655918, -0.19622504711151123, -0.8554552793502808, 1.193114161491394, -1.4232760667800903, 0.36091509461402893, -0.25053295493125916, -0.6231593489646912, 0.12150875478982925, -0.8401833176612854, 0.5820302963256836, -1.3182824850082397, 0.6754477620124817, 0.07458074390888214, -0.15698251128196716, 0.6149181723594666, 0.05498393252491951, 1.2878520488739014, 1.1312137842178345, 0.6659514307975769, -0.410190612077713, -0.12032634764909744, 0.7545129060745239, 0.8842192888259888, 0.16177071630954742, 0.8057838082313538, -0.06899452209472656, 0.5601221323013306, -0.7878770232200623, -0.9139524102210999, -0.9517109990119934, -1.2109438180923462, -0.2928047180175781, 0.15414118766784668, 0.7641659379005432, 0.25945940613746643, 0.48417097330093384, 0.8565254211425781, -1.1209555864334106, -0.905066967010498, 0.8768170475959778, -0.8439682722091675, -0.34720560908317566, -1.254891276359558, -0.0403154082596302, -0.6506708860397339, 0.08829600363969803, 0.6325612664222717, -0.5611671805381775, 0.6844742894172668, 0.1881566196680069, -0.34477224946022034, 0.5640733242034912, -1.162740707397461, 0.03258917108178139, -0.17497269809246063, 0.5673249363899231, 0.12084273248910904, 0.13355965912342072, 0.332979291677475, -0.03616919741034508, -0.4313094913959503, -0.6343693733215332, -0.8951416015625, -1.1531368494033813, -0.4523777663707733] +[0.4920336604118347, 0.10908447951078415, 0.6220282912254333, -0.8172762393951416, -0.0172878447920084, -1.082179307937622, 0.08358962088823318, -0.43109652400016785, -0.6857222318649292, 0.482044517993927, 0.574638307094574, 0.23651844263076782, 0.6656460762023926, -0.3624168038368225, -0.6229116916656494, -0.04634393751621246, 0.9467546939849854, 0.31256917119026184, -0.26216524839401245, 0.8070294857025146, -1.053890347480774, -0.5277813673019409, -0.6911299824714661, 0.5467128753662109, 0.7301730513572693, 0.25805240869522095, -0.7111438512802124, 0.113237164914608, 0.8930057287216187, -0.5718024969100952, 0.6508647799491882, -0.09699757397174835, 0.10565908998250961, 0.12605233490467072, -0.15494464337825775, 0.26100000739097595, -0.3432985246181488, -0.396549254655838, 0.7586594223976135, 0.7824206352233887, -0.09715943038463593, 0.018737468868494034, -0.13504374027252197, -1.0563503503799438, 0.023445824161171913, 1.2112932205200195, 0.3816203773021698, -0.007280820049345493, -0.9029284119606018, -0.21816867589950562, 0.48887431621551514, 6.674034595489502, -0.7094519138336182, 0.5629515051841736, -0.1283189207315445, 1.6925941705703735, -0.6943728923797607, 0.14076462388038635, -0.324573278427124, 0.1854572296142578, 0.4622342586517334, -0.03962334245443344, -0.02855786122381687, -1.2092689275741577, -0.13577260076999664, 0.05619719251990318, -0.4515755772590637, -0.5282979011535645, 1.3394416570663452, -1.3122180700302124, -0.3638785779476166, -0.5524658560752869, -0.8665051460266113, 0.4188306927680969, 0.35245823860168457, 0.18959225714206696, 0.3422941267490387, 0.48402994871139526, -0.11255009472370148, -0.8726423382759094, 0.7677830457687378, -0.18959961831569672, 0.6283653974533081, -0.8090923428535461, -0.2189481109380722, 0.5197792649269104, -0.47023072838783264, -0.23056279122829437, -0.29831963777542114, 0.0698205977678299, -0.777651846408844, -0.1707899123430252, -0.4841335117816925, -0.8770488500595093, -0.5996758937835693, 0.10644242912530899, 0.7668167352676392, 0.5369940996170044, 0.08956141769886017, 0.46660399436950684, 0.5913860201835632, -0.4091580808162689, -0.6571468114852905, -0.20629428327083588, 0.4907554090023041, 0.9566454887390137, -0.4630260765552521, -1.0321314334869385, 0.6455925703048706, 0.29897087812423706, 0.09682691842317581, -0.2832922637462616, -0.4748339056968689, 0.4444367289543152, -0.5935534834861755, -0.46210870146751404, -0.17551198601722717, -0.1486099660396576, 0.6104698181152344, -0.08406971395015717, 0.27185019850730896, -0.04857826232910156, -0.7292516231536865, -1.1152054071426392, 0.06995436549186707, -0.48349177837371826, 0.5438783168792725, 0.10241805762052536, 0.25061455368995667, 0.4124375581741333, -0.7958027124404907, -0.09205793589353561, -0.6556338667869568, 0.038283880800008774, -0.13238945603370667, 0.49543488025665283, -0.3759034276008606, -1.0424665212631226, -1.1409229040145874, -0.04487154632806778, 1.1975750923156738, 0.5370091199874878, 0.10628437250852585, -1.2367820739746094, -0.5505634546279907, -0.47297072410583496, 0.7646276354789734, 0.6122051477432251, 0.31502312421798706, -0.7928292751312256, 0.5658049583435059, 0.12381043285131454, 0.0544818639755249, 0.34938663244247437, 1.024865746498108, 0.07034488022327423, -0.7987285256385803, -0.08529385179281235, -0.732083261013031, -0.7464345097541809, -0.2965873181819916, -0.5903446674346924, 0.31121835112571716, -0.49035149812698364, -0.1161579042673111, 0.6199470162391663, 0.02598324976861477, -0.9596051573753357, 0.67239910364151, 0.17341694235801697, -0.011908798478543758, -0.2514725923538208, -0.6672439575195312, 0.2682822346687317, 0.44056224822998047, -0.16246603429317474, -0.21381701529026031, -0.03889461234211922, -1.2547725439071655, 0.8832399249076843, -1.3109149932861328, 0.513184666633606, -0.024973154067993164, -0.2751806378364563, -1.2513153553009033, -0.36366549134254456, -1.1608620882034302, 0.7135887145996094, 0.4349428117275238, -0.05623399838805199, -1.0940048694610596, -1.4164471626281738, -0.5401841998100281, -0.14013978838920593, 0.43710315227508545, 0.9835366606712341, -0.045076530426740646, -0.22733141481876373, -1.212554931640625, -0.2311214804649353, 0.5540556907653809, -0.467276394367218, -0.042967986315488815, 0.7316970825195312, 0.4713551104068756, 0.5539708137512207, -0.19205771386623383, 0.3992154598236084, -0.4731062054634094, 0.328643798828125, -1.3466838598251343, 0.12016326189041138, 0.6908984780311584, -0.9389122724533081, 0.929217517375946, -0.09657981991767883, -0.7246034741401672, 0.3259926438331604, -0.38236841559410095, -0.19337618350982666, 0.9003579616546631, -0.8676863312721252, 0.02491917833685875, -0.44798213243484497, -1.0312516689300537, -0.3747483193874359, -0.2827095687389374, 0.39302024245262146, 0.7769198417663574, -0.1577269583940506, 0.3127179741859436, -0.5897473692893982, -0.027262575924396515, -0.04718969762325287, 0.4032242000102997, 0.10172925144433975, -0.19151008129119873, 0.25982531905174255, -0.386705607175827, 1.0409934520721436, -0.8055135607719421, 0.6805919408798218, 0.5046014189720154, -0.3699510097503662, -0.6516329646110535, 0.3443463146686554, -0.39972612261772156, -1.2775356769561768, -0.5017715096473694, -0.6229661703109741, -0.030185595154762268, 0.1970410794019699, 0.6446097493171692, -1.1042557954788208, 0.1773117482662201, -0.15625618398189545, 0.43976154923439026, -0.6175628900527954, 0.9377044439315796, -0.04408580809831619, 0.7155253291130066, 0.12891264259815216, 0.29426583647727966, -0.34475114941596985, -0.5334733724594116, -0.11781279742717743, 0.1971552073955536, -0.4775475263595581, -1.3980488777160645, -0.18642590939998627, -0.9123989343643188, 0.5537704229354858, -0.3462740480899811, -0.5182791352272034, 1.069893717765808, -0.14195716381072998, 0.4228779375553131, -0.5802431106567383, -1.5206806659698486, -1.2385220527648926, -0.5131803154945374, 0.058006152510643005, 0.9046098589897156, 0.13792307674884796, -0.4819745719432831, -1.0193817615509033, -0.1043049767613411, 0.5629732012748718, -0.39609041810035706, -0.9054643511772156, 0.0075250654481351376, 0.24341487884521484, 0.9825631976127625, 0.3799956738948822, 2.0571203231811523, -0.40682241320610046, 0.6816129088401794, 0.28505566716194153, -0.21231773495674133, -0.8401006460189819, 0.02104341983795166, -0.3190205991268158, -1.0568586587905884, 1.2545487880706787, -0.2596133351325989, 1.12460458278656, 0.9581298232078552, 0.13456369936466217, 0.0597972571849823, 0.39617785811424255, 0.421674519777298, 0.29839688539505005, 0.5632389187812805, 0.49910080432891846, -0.10798858851194382, -0.11904347687959671, 0.3410746455192566, -0.13204671442508698, 0.47237318754196167, -0.42175400257110596, 0.650764524936676, 0.1796715408563614, 0.4026961922645569, 0.501923680305481, 0.2478848546743393, 0.5674642324447632, 0.6605359315872192, 0.4520508646965027, -0.36473265290260315, 1.13140070438385, 0.7332407236099243, -0.802711546421051, 0.5061956644058228, 0.29733574390411377, 0.5858821868896484, 1.0159715414047241, 0.49037638306617737, -0.4298998713493347, 0.008528097532689571, 0.01988670788705349, 0.647376537322998, -0.000221415059058927, 0.5592238306999207, -1.2885518074035645, -0.35783395171165466, -0.01469860877841711, -0.2677590847015381, -1.3769738674163818, -0.5902727842330933, -0.9660661816596985, -0.8364692330360413, 1.0408990383148193, -0.9220778346061707, -0.6464837789535522, 0.44266486167907715, 0.3720921277999878, 1.0969607830047607, -0.5080428123474121, 0.04148286208510399, 0.2008965164422989, 0.5160264372825623, 0.05232817307114601, -1.218543291091919, 0.4208379089832306, -0.24355807900428772, -1.0375721454620361, 1.2204159498214722, 0.8600040078163147, -0.2883125841617584, -0.5335080623626709, 1.1393407583236694, -0.6178647875785828, 0.8895626664161682, -0.19621875882148743, -0.06203481927514076, 1.0370372533798218, -0.07961231470108032, -0.10775742679834366, 0.33841472864151, -0.43302321434020996, 0.3017716705799103, -1.2042216062545776, 0.5601984262466431, 0.41335925459861755, -0.24649101495742798, -0.0477745495736599, 0.0973876342177391, -0.49819839000701904, -0.38124796748161316, -1.2467509508132935, -0.5322380065917969, 0.03134532645344734, 0.9984041452407837, 0.6787906885147095, 0.6526946425437927, -0.28295332193374634, 0.35899606347084045, -0.24584056437015533, 0.4074610769748688, 0.33917734026908875, 0.8340765833854675, -0.6798887848854065, -0.6467978358268738, 0.24363651871681213, 1.1346179246902466, -0.7935081124305725, 0.25985005497932434, -0.029854057356715202, 0.4847850501537323, -1.381759524345398, -1.261519432067871, 0.16996297240257263, -0.18073157966136932, -0.9655662178993225, 1.327100396156311, 0.07991550117731094, -0.9340461492538452, 0.9125823974609375, 0.8980376124382019, -1.6128357648849487, -0.29740050435066223, 1.3800140619277954, 0.9272350072860718, 0.5531338453292847, 0.21597431600093842, -0.6183819770812988, 0.12095560133457184, -0.17756031453609467, 0.581550657749176, -0.3103291392326355, -0.24203957617282867, 0.38189440965652466, 0.33622050285339355, -0.35826435685157776, -0.6169346570968628, -0.27280017733573914, -0.7736434936523438, 0.49404650926589966, -0.10982108861207962, -0.19479623436927795, -0.5944305062294006, 0.17550887167453766, 0.21745182573795319, 0.29200273752212524, -0.5835112929344177, 0.40121522545814514, 1.1413698196411133, -0.7570382952690125, 0.1054716557264328, 0.5056400895118713, -0.4684614837169647, -0.05324781313538551, -0.6985005736351013, -0.30021923780441284, 1.229934811592102, 0.27960875630378723, 0.283799409866333, -0.2557637691497803, 0.1881309598684311, -0.2865733802318573, 0.24619892239570618, 0.00015231966972351074, 0.6866142153739929, 0.8866078853607178, 0.8432091474533081, 0.16686484217643738, 0.39845654368400574, -0.8452870845794678, 1.4856454133987427, 0.17297668755054474, 0.4626327157020569, 1.1783742904663086, 0.42554184794425964, -0.24265550076961517, -0.910582423210144, -0.5122216939926147, 0.4768104553222656, -0.42157575488090515, -1.5434472560882568, 0.02475241757929325, 1.1184115409851074, -0.41697123646736145, -0.22719334065914154, -0.8432290554046631, -0.24846681952476501, 0.5849250555038452, -0.3179154694080353, -0.15415680408477783, 0.010802078060805798, -0.6599926948547363, -0.5680645704269409, -0.39423856139183044, 0.6030900478363037, -0.2872925102710724, 0.16922792792320251, -0.422894686460495, -0.4747609794139862, 0.726047158241272, -1.2934620380401611, 0.7704787850379944, 0.1668609380722046, -0.12878809869289398, -0.5328594446182251, -0.2928054630756378, 0.78932785987854, -0.868039608001709, -0.5329636931419373, 0.3347477316856384, -0.17362788319587708, 0.30565863847732544, 0.6366897821426392, -0.6390156745910645, 0.26043832302093506, 1.0975406169891357, 0.1735703945159912, -0.10260608047246933, -0.02365603856742382, -0.30612650513648987, -0.04089193418622017, 0.7050548791885376, 1.3678197860717773, -0.19657038152217865, 0.049418769776821136, 1.1452518701553345, -0.15810643136501312, 0.48413464426994324, -0.21218448877334595, -0.07235384732484818, 0.15106719732284546, 1.0604978799819946, -0.887958288192749, -0.213522806763649, 0.4794853925704956, -1.1072196960449219, 0.4456885755062103, 0.4839174747467041, 0.0861307829618454, 0.12255865335464478, -0.27022916078567505, -0.5033141374588013, -0.22927798330783844, 0.3070770800113678, 0.4032990336418152, -0.8154269456863403, -0.1379108726978302, -1.0443869829177856, -0.3716321885585785, 0.2849904000759125, 0.13759230077266693, 0.7323493361473083, -0.8845424056053162, -0.0728713646531105, -0.24798431992530823, 1.3260366916656494, 0.3942298889160156, -1.623480200767517, -1.6232417821884155, -0.11083663254976273, 1.0251375436782837, -0.3609720766544342, 0.03875202313065529, -0.16894744336605072, -1.255350947380066, -1.0664998292922974, -0.8796232342720032, 0.15282857418060303, -0.6016327142715454, 0.21802835166454315, -0.9047738909721375, 0.02553386613726616, -0.09258890151977539, 0.1647273451089859, 0.4744870960712433, 0.6672095656394958, 0.08232253789901733, 0.609017014503479, 0.8413460850715637, -0.4639427065849304, -0.13847985863685608, 0.42899101972579956, 0.15705178678035736, 1.1672049760818481, -0.501354455947876, -0.04367918521165848, -0.6593639850616455, -0.5997791886329651, 0.870492696762085, -0.9273963570594788, 0.7667270302772522, -0.13340376317501068, 0.3271072506904602, 0.20575587451457977, -0.8877889513969421, 0.6971709132194519, 0.5383040308952332, 0.1360493302345276, -0.09642039984464645, 0.7710162997245789, -0.17650344967842102, 0.9556772708892822, 0.28920501470565796, -0.15006272494792938, 0.8313986659049988, 0.6752024292945862, -0.40016934275627136, -1.088746428489685, 1.727831244468689, -0.3160720765590668, -0.06933348625898361, -1.4496642351150513, -0.7744280099868774, 1.4722933769226074, 0.5927612781524658, 0.21859051287174225, 0.1828787624835968, -0.13521714508533478, -0.7429524064064026, 0.22657378017902374, -1.2651453018188477, -0.32805415987968445, 0.19094350934028625, -0.2527753710746765, 0.6958619952201843, 0.3212263286113739, -0.43158936500549316, 0.6621645092964172, 2.2289862632751465, 0.08800377696752548, 0.45068201422691345, 0.07892600446939468, -0.24512667953968048, -0.7649081945419312, 0.8365783095359802, -0.32413172721862793, 0.12233111262321472, 0.7825440168380737, -0.49488410353660583, -0.7300084829330444, -0.24660749733448029, 0.7980522513389587, 1.2592157125473022, -0.713848352432251, -0.8567062616348267, -0.01762532629072666, 0.9474735260009766, 0.47864529490470886, 0.4705173671245575, 0.5332598090171814, -0.44905874133110046, 0.35184720158576965, 1.0676780939102173, -0.2606600522994995, 0.6580814123153687, -0.47593584656715393, 0.2619589567184448, -0.37655410170555115, 1.3303016424179077, 0.3716006577014923, -1.150912880897522, 0.040988218039274216, -0.1772589087486267, -0.15251770615577698, 1.2696739435195923, -0.9747717380523682, -0.2624235451221466, -1.208828330039978, 0.8605745434761047, 0.4288804829120636, 0.8203335404396057, 1.3764358758926392, 0.5313624739646912, 0.5780356526374817, -0.042651232331991196, -0.3712703585624695, 0.7647461891174316, 0.24155575037002563, 0.848594069480896, -0.3531132936477661, 0.11326837539672852, -1.0382269620895386, -0.7367310523986816, 0.1904863864183426, 0.11650338023900986, -1.2591114044189453, 0.31314903497695923, -0.7221821546554565, -1.038111686706543, -1.087885856628418, 0.4489099681377411, 0.1322403997182846, 0.3289276361465454, 1.3409868478775024, -0.7668837904930115, 0.48565956950187683, -0.8195297122001648, 1.8901808261871338, -0.8864663243293762, 0.4016851782798767, -0.08915653079748154, -0.8248488306999207, 0.7754291296005249, 0.044126685708761215, 0.007960018701851368, -0.2723045349121094, -0.8092935085296631, 1.2997370958328247, -1.473394513130188, 0.3074958324432373, -0.023709794506430626, -0.693203330039978, 0.15125057101249695, -0.878999650478363, 0.5316171050071716, -1.3712161779403687, 0.7701994776725769, 0.050791844725608826, -0.15469461679458618, 0.5141816735267639, 0.06927329301834106, 1.1834306716918945, 1.0219414234161377, 0.6277756690979004, -0.28020650148391724, -0.18207550048828125, 0.6217793226242065, 0.7838411927223206, 0.14714765548706055, 0.8343258500099182, 0.019239751622080803, 0.534246027469635, -0.8007053732872009, -1.0096654891967773, -0.8992956280708313, -1.1736479997634888, -0.3106119632720947, 0.08412500470876694, 0.7091765999794006, 0.2744998335838318, 0.34692078828811646, 0.7882518172264099, -1.2527960538864136, -1.0031582117080688, 0.8406440019607544, -0.9628389477729797, -0.2453143149614334, -1.1806182861328125, -0.004484093748033047, -0.5947539210319519, 0.1504858434200287, 0.6611626744270325, -0.6704490780830383, 0.7503383755683899, 0.17018112540245056, -0.19780589640140533, 0.6250767707824707, -1.2449043989181519, 0.05822636932134628, -0.3097624182701111, 0.47548526525497437, 0.00535602169111371, 0.03664408624172211, 0.4045986831188202, -0.024279005825519562, -0.39808711409568787, -0.7009929418563843, -0.9311560988426208, -1.0706970691680908, -0.5040189623832703] diff --git a/src/api/server.py b/src/api/server.py index ee855b0..d21278b 100644 --- a/src/api/server.py +++ b/src/api/server.py @@ -15,7 +15,27 @@ _shared_embedder.index._load_model() # 预加载模型 def get_shared_embedder() -> SentenceTransformersRecall: return _shared_embedder -app = FastAPI(title='织忆 MemoryWeave API', version='2.6') +# D2: 事件消费者(后台线程,监听其他实例的 commit 事件) +_consumer = None + +def _start_event_consumer(): + """启动事件消费者(在 FastAPI startup 事件中调用)""" + global _consumer + try: + from src.storage.event_consumer import start_event_consumer + from src.storage.redis_store import get_commit_store, get_instance_id + + # 注册当前实例 + redis_store = get_commit_store() + redis_store.register_instance("127.0.0.1", 7821) + + # 启动事件消费者(传入 embedder 用于增量 merge) + _consumer = start_event_consumer(embedder=_shared_embedder) + print("[Server] 事件消费者已启动(多实例同步就绪)") + except Exception as e: + print(f"[Server] 事件消费者启动失败: {e}") + +app = FastAPI(title='织忆 MemoryWeave API', version='2.7') app.add_middleware( CORSMiddleware, @@ -25,6 +45,12 @@ app.add_middleware( allow_headers=['*'], ) + +@app.on_event("startup") +async def startup_event(): + """FastAPI 启动时初始化事件消费者""" + _start_event_consumer() + from src.api.routes import commit, recall, conflicts, feedback, admin, templates, sync app.include_router(commit.router, prefix='/api/v1', tags=['commit']) diff --git a/src/storage/event_consumer.py b/src/storage/event_consumer.py new file mode 100644 index 0000000..1a1ffe9 --- /dev/null +++ b/src/storage/event_consumer.py @@ -0,0 +1,171 @@ +"""事件传播层 — D2: 多实例事件消费 + CRDT merge + +职责: +- 消费 Redis Streams 事件(XREADGROUP) +- CRDT merge 到本地向量索引 +- 启动时全量同步 + 增量事件 + +模式: +- 后台线程持续运行,阻塞读事件 +- 收到事件后 merge 到本地 embedder +- ACK 确认处理完成 +""" +import json +import threading +import time +from datetime import datetime +from typing import Optional + +from storage.redis_store import get_commit_store, get_instance_id + + +class EventConsumer: + """Redis Stream 事件消费者 + + 多实例共享同一个 consumer group,各自消费不同消息。 + 处理完成后 ACK,防止重复消费。 + """ + + def __init__(self, embedder=None, poll_interval: float = 1.0): + """ + Args: + embedder: SentenceTransformersRecall 实例,用于增量添加文档 + poll_interval: 轮询间隔(秒) + """ + self._redis_store = None + self._embedder = embedder + self._poll_interval = poll_interval + self._running = False + self._thread: Optional[threading.Thread] = None + + @property + def redis_store(self): + if self._redis_store is None: + self._redis_store = get_commit_store() + return self._redis_store + + def _merge_event(self, event: dict) -> bool: + """将事件 merge 到本地状态 + + Args: + event: Redis Stream 事件(包含 event_type, commit_id, instance_id, data) + + Returns: + True if merged successfully + """ + try: + event_type = event.get("event_type") + instance_id = event.get("instance_id", "") + + # 忽略自己发布的 events(本地已处理) + if instance_id == get_instance_id(): + return False + + if event_type != "commit": + return False + + # 解析 data + data_raw = event.get("data", "{}") + if isinstance(data_raw, str): + data = json.loads(data_raw) + else: + data = data_raw + + commit_id = data.get("id") or event.get("commit_id") + commit_type = data.get("type", "episode") + content = data.get("content", "") or data.get("summary", "") + facts = data.get("facts", []) + timestamp = data.get("timestamp") or data.get("created_at", "") + + if not content and not facts: + return False + + # 构建 doc + doc = { + "id": commit_id, + "content": content, + "facts": facts, + "category": commit_type, + "timestamp": timestamp, + } + + # 增量添加到本地 embedder + if self._embedder: + self._embedder.add_documents([doc]) + + return True + + except Exception as e: + print(f"[EventConsumer] merge 失败: {e}") + return False + + def _consume_loop(self): + """事件消费循环(后台线程)""" + instance_id = get_instance_id() + print(f"[EventConsumer] 启动,实例ID: {instance_id}") + + while self._running: + try: + # 阻塞读取事件(5秒超时) + events = self.redis_store.read_events( + instance_id=instance_id, + count=10, + block=5000, + ) + + merged_count = 0 + for event in events: + event_id = event.get("_event_id") + if self._merge_event(event): + merged_count += 1 + print(f"[EventConsumer] merge: {event.get('commit_id')}") + + # ACK 已处理 + if event_id: + self.redis_store.ack_event(event_id) + + if merged_count > 0: + print(f"[EventConsumer] 本次合并 {merged_count} 条事件") + + except Exception as e: + print(f"[EventConsumer] 消费异常: {e}") + time.sleep(1) + + print(f"[EventConsumer] 停止") + + def start(self): + """启动后台消费线程""" + if self._running: + return + + self._running = True + self._thread = threading.Thread(target=self._consume_loop, daemon=True) + self._thread.start() + print(f"[EventConsumer] 后台线程已启动") + + def stop(self): + """停止后台消费线程""" + self._running = False + if self._thread: + self._thread.join(timeout=5) + print(f"[EventConsumer] 后台线程已停止") + + +def start_event_consumer(embedder=None, poll_interval: float = 1.0) -> EventConsumer: + """启动事件消费者(单例)""" + global _global_consumer + if _global_consumer is None: + _global_consumer = EventConsumer(embedder=embedder, poll_interval=poll_interval) + _global_consumer.start() + return _global_consumer + + +def stop_event_consumer(): + """停止事件消费者""" + global _global_consumer + if _global_consumer: + _global_consumer.stop() + _global_consumer = None + + +_global_consumer: Optional[EventConsumer] = None \ No newline at end of file