diff --git a/shinkai-libs/shinkai-tools-primitives/src/tools/tool_router_dep/workflows_data.rs b/shinkai-libs/shinkai-tools-primitives/src/tools/tool_router_dep/workflows_data.rs index 70d934b76..30f3735b9 100644 --- a/shinkai-libs/shinkai-tools-primitives/src/tools/tool_router_dep/workflows_data.rs +++ b/shinkai-libs/shinkai-tools-primitives/src/tools/tool_router_dep/workflows_data.rs @@ -1,2 +1,2 @@ -pub static WORKFLOWS_JSON_TESTING: &str = r###"[{"type":"Workflow","content":[{"workflow":{"name":"Extensive_summary","version":"v0.1","steps":[{"name":"Initialize","body":[{"type":"composite","value":[{"type":"registeroperation","value":{"register":"$PROMPT","value":"Summarize this: "}},{"type":"registeroperation","value":{"register":"$EMBEDDINGS","value":{"name":"process_embeddings_in_job_scope","args":[]}}}]}]},{"name":"Summarize","body":[{"type":"registeroperation","value":{"register":"$RESULT","value":{"name":"multi_inference","args":[{"type":"register","value":"$PROMPT"},{"type":"register","value":"$EMBEDDINGS"}]}}}]}],"raw":"\n workflow Extensive_summary v0.1 {\n step Initialize {\n $PROMPT = \"Summarize this: \"\n $EMBEDDINGS = call process_embeddings_in_job_scope()\n }\n step Summarize {\n $RESULT = call multi_inference($PROMPT, $EMBEDDINGS)\n }\n } @@official.shinkai\n ","description":"Reviews in depth all the content to generate a summary.","author":"@@official.shinkai","sticky":false},"embedding":{"id":"","vector":[0.6820248961448669,0.5723804831504822,0.056784410029649734,-0.029523666948080063,-0.2254689335823059,-0.053013481199741364,-0.6708416938781738,-0.2624345123767853,-0.033756330609321594,0.4013897180557251,-0.16321982443332672,0.971656858921051,0.2718249261379242,0.07108756899833679,0.2820807695388794,0.14116838574409485,-0.11496889591217041,-0.49301284551620483,-1.0789883136749268,-0.043452829122543335,0.19382520020008087,0.5948700308799744,0.6591302156448364,0.16274362802505493,-0.030279342085123062,-0.1913491189479828,-0.3163045048713684,-0.2898331880569458,-0.7694717645645142,-2.4501161575317383,0.5279894471168518,0.0053562745451927185,-0.5002804398536682,-0.5608552694320679,0.028381161391735077,-0.6834791302680969,0.328404039144516,0.2872193455696106,-0.27112722396850586,-0.2420305460691452,-0.20994114875793457,0.23660853505134583,-0.35357770323753357,0.590043306350708,0.27437782287597656,0.06486925482749939,-0.15818193554878235,-0.2542445659637451,0.3756386339664459,0.38245582580566406,-0.45134201645851135,-0.26646173000335693,-0.21188713610172272,0.5074135065078735,-0.45056354999542236,0.42795759439468384,-0.14764094352722168,-0.299643874168396,0.24885445833206177,0.021038610488176346,0.29774922132492065,0.527859091758728,-4.216637134552002,0.35374659299850464,0.19555260241031647,0.3751485049724579,0.17744454741477966,-0.2610761225223541,-0.172037273645401,0.032772570848464966,0.05567239597439766,0.19824181497097015,-0.13289085030555725,-0.1100323274731636,-0.23126265406608582,-0.34616896510124207,0.3950774073600769,0.35234352946281433,0.1308232843875885,-0.6239751577377319,-0.7391460537910461,0.4362350106239319,-0.0347885936498642,0.09445835649967194,-0.2117754966020584,0.7171225547790527,-0.3040316104888916,-0.3600367605686188,0.37041613459587097,-0.06581398844718933,-0.006318345665931702,-0.21981696784496307,-0.002286979928612709,0.2790469229221344,-0.7975400686264038,0.10219541937112808,0.15441451966762543,0.11658502370119095,0.4612636864185333,3.6136317253112793,0.6766623854637146,-0.28591224551200867,0.7045385241508484,-0.4960375726222992,0.1050494909286499,-0.5604535937309265,-0.25389742851257324,-0.2956107258796692,0.40285223722457886,-0.111656554043293,0.015156731009483337,-0.5351597666740417,-0.030287399888038635,0.3177969753742218,0.21704047918319702,0.7171976566314697,-0.46601396799087524,0.3439251184463501,-0.061566051095724106,0.20522497594356537,-0.6280752420425415,0.130172997713089,0.051850613206624985,0.21620029211044312,-0.2943073809146881,0.1809474229812622,-0.23445376753807068,0.2775576710700989,0.2914619445800781,0.0578656867146492,0.10241352021694183,-0.15168319642543793,-0.7568095326423645,0.092719167470932,-0.0777229368686676,-0.15893718600273132,0.5966013073921204,-0.7341698408126831,0.25946319103240967,-0.9252210259437561,0.09058776497840881,-1.5351767539978027,0.7115793824195862,0.29241278767585754,0.7798487544059753,-0.08018416166305542,-0.13354992866516113,-0.08928925544023514,-0.4238916337490082,-0.5697543025016785,0.06765686720609665,0.77348792552948,-0.04202955216169357,0.06487800180912018,0.5874587893486023,-0.11936471611261368,-0.25156763195991516,0.19140180945396423,-0.5563774108886719,0.31181517243385315,-0.32280847430229187,-0.15203385055065155,0.6281672716140747,0.6141714453697205,0.5077856183052063,-0.20541121065616608,0.334749698638916,-0.22992375493049622,0.3473362326622009,0.13209888339042664,-0.046164438128471375,-0.4251396954059601,0.33730384707450867,0.8212467432022095,0.177277609705925,-0.1610117256641388,-0.07467097789049149,0.2908981442451477,0.2191067337989807,-0.5679166316986084,0.7439255714416504,0.5261525511741638,-0.11653833091259003,-0.3659759759902954,-0.023860540241003036,-0.26393836736679077,0.42201778292655945,-0.21162325143814087,0.6553518176078796,0.7129044532775879,-0.8967499136924744,1.4437609910964966,-0.7139504551887512,-0.4562397301197052,0.1866864711046219,-0.1461351215839386,-0.5919792056083679,-0.022950291633605957,0.10381539165973663,0.28671005368232727,-0.5119964480400085,0.06818243861198425,-0.34842413663864136,-0.2360081672668457,-0.20727667212486267,-0.666267454624176,-0.2698496878147125,0.14760757982730865,-0.1733710914850235,-0.7490845322608948,0.17996001243591309,-0.1494026631116867,0.6294229030609131,0.6854228973388672,0.45075780153274536,0.16544346511363983,0.15525199472904205,0.40028688311576843,0.6559727787971497,0.5462879538536072,0.6049190759658813,-0.16969510912895203,-0.5258905291557312,-0.7370105385780334,-0.5058722496032715,0.05097363144159317,-0.4502354860305786,-0.16756923496723175,-0.3616001605987549,-0.07482671737670898,0.5364893674850464,0.3961637616157532,0.6380713582038879,0.7769057154655457,0.45226916670799255,0.12783251702785492,-0.06475261598825455,0.5124138593673706,0.2543259561061859,-0.3266713619232178,0.6652782559394836,-0.10381640493869781,-0.2858583927154541,0.369432270526886,0.4281133711338043,-0.397693008184433,-0.4147809147834778,-0.007397249341011047,-0.16696804761886597,1.8266067504882812,0.09511159360408783,-0.33791670203208923,0.20951442420482635,0.5353755950927734,0.4132263660430908,0.07172563672065735,-1.3672807216644287,0.033725690096616745,-0.6914818286895752,0.4152260720729828,-0.29042062163352966,0.2820392847061157,-0.12484639883041382,0.12444232404232025,-0.2538592219352722,-0.1376664787530899,-0.376803457736969,-0.21342863142490387,-0.3275066018104553,-0.1573990434408188,0.07955310493707657,0.7591940760612488,0.06325787305831909,-0.1243286207318306,-0.06205055117607117,0.27926522493362427,0.1881060153245926,-0.07187489420175552,-0.43998342752456665,-0.04985599219799042,0.35954052209854126,0.07155530899763107,0.37024304270744324,0.25004273653030396,-0.5525103211402893,-0.2558727264404297,-0.36321941018104553,0.04473167657852173,-0.09463290125131607,-0.01605386659502983,-0.21422991156578064,-0.40423282980918884,-0.07233521342277527,0.24171797931194305,1.5734977722167969,0.2532348036766052,0.3514263331890106,0.5783570408821106,0.38809657096862793,0.18779775500297546,-0.7362217903137207,0.018929127603769302,-0.2433643937110901,-0.1767692118883133,-0.6034640073776245,-0.2618042230606079,0.23901714384555817,0.25006982684135437,-0.3671899735927582,0.56818026304245,-0.45649564266204834,-0.5177562832832336,0.21355649828910828,0.04084805026650429,0.36265265941619873,-0.4912548065185547,0.3579895794391632,-0.06822404265403748,0.23526312410831451,-2.4479732513427734,-0.409572571516037,0.33847421407699585,0.39877307415008545,-0.31740933656692505,-0.13011762499809265,1.0355134010314941,-0.2030523419380188,0.004002278670668602,-0.17361848056316376,1.0097349882125854,0.3712850511074066,0.04738866910338402,-0.38382434844970703,-0.22995835542678833,0.10955353826284409,-0.5831428170204163,0.5505454540252686,-0.251912921667099,-0.6052247285842896,-0.11847558617591858,0.39012327790260315,1.722125768661499,0.4369223117828369,0.4068147540092468,-0.08888967335224152,0.16951988637447357,-0.7578551769256592,-1.5347665548324585,-0.09822624921798706,-0.1749330759048462,-0.40222880244255066,0.40935447812080383,-0.014797728508710861,-0.25942203402519226,0.7363397479057312,0.8023666143417358,0.1866847723722458,1.0114266872406006,-0.37116944789886475,1.44536292552948,-0.37696170806884766,-0.06581003218889236,0.011476762592792511,0.43547624349594116,0.33689627051353455,0.4570700526237488,-0.09152284264564514,-0.7278273105621338,-0.19184312224388123,-0.024527274072170258,0.5096248984336853,-0.4112659990787506,0.585030198097229,0.6007319092750549,0.13742738962173462,-0.0392843633890152,0.18517468869686127,0.4498704671859741,0.053321029990911484,0.055953219532966614,-0.3754947781562805,-0.2632603943347931,-0.8821566700935364,-0.5415434241294861]}},true]},{"type":"Workflow","content":[{"workflow":{"name":"Hyde_inference","version":"v0.1","steps":[{"name":"Initialize","body":[{"type":"composite","value":[{"type":"registeroperation","value":{"register":"$PROMPT","value":"write a passage to answer the question: "}},{"type":"registeroperation","value":{"register":"$HYDE_PROMPT","value":{"name":"concat","args":[{"type":"register","value":"$PROMPT"},{"type":"register","value":"$INPUT"}]}}},{"type":"registeroperation","value":{"register":"$HYDE_PASSAGE","value":{"name":"inference_no_ws","args":[{"type":"register","value":"$HYDE_PROMPT"}]}}},{"type":"registeroperation","value":{"register":"$HYDE_INPUT","value":{"name":"concat","args":[{"type":"register","value":"$INPUT"},{"type":"string","value":". "},{"type":"register","value":"$HYDE_PASSAGE"}]}}},{"type":"registeroperation","value":{"register":"$EMBEDDINGS","value":{"name":"search_embeddings_in_job_scope","args":[{"type":"register","value":"$HYDE_INPUT"}]}}}]}]},{"name":"Summarize","body":[{"type":"composite","value":[{"type":"registeroperation","value":{"register":"$CONNECTOR","value":"\\nLeverage the following information to answer the previous query: --- start ---"}},{"type":"registeroperation","value":{"register":"$NEW_INPUT","value":{"name":"concat","args":[{"type":"register","value":"$INPUT"},{"type":"register","value":"$CONNECTOR"},{"type":"register","value":"$EMBEDDINGS"}]}}},{"type":"registeroperation","value":{"register":"$RESULT","value":{"name":"inference","args":[{"type":"register","value":"$NEW_INPUT"}]}}}]}]}],"raw":"\n workflow Hyde_inference v0.1 {\n step Initialize {\n $PROMPT = \"write a passage to answer the question: \"\n $HYDE_PROMPT = call concat($PROMPT, $INPUT)\n $HYDE_PASSAGE = call inference_no_ws($HYDE_PROMPT)\n $HYDE_INPUT = call concat($INPUT, \". \", $HYDE_PASSAGE )\n $EMBEDDINGS = call search_embeddings_in_job_scope($HYDE_INPUT)\n }\n step Summarize {\n $CONNECTOR = \"\\nLeverage the following information to answer the previous query: --- start ---\"\n $NEW_INPUT = call concat($INPUT, $CONNECTOR, $EMBEDDINGS) \n $RESULT = call inference($NEW_INPUT)\n }\n } @@official.shinkai\n ","description":"Generates a passage to answer a question and uses embeddings to refine the answer.","author":"@@official.shinkai","sticky":false},"embedding":{"id":"","vector":[-0.04964948445558548,0.07351528108119965,-0.0037448257207870483,-0.5989986658096313,-0.2695397734642029,0.0556429848074913,-0.8189688920974731,0.17371350526809692,-0.042529553174972534,-0.278947651386261,-0.1592383086681366,0.7632817625999451,-0.15512093901634216,0.5815573930740356,0.40833333134651184,0.08403884619474411,0.10889555513858795,-0.09859824180603027,-1.4305481910705566,-0.36282309889793396,0.26563403010368347,0.5795038938522339,0.6247695684432983,0.09672331809997559,0.2193397581577301,-0.3369952440261841,0.45206624269485474,-0.20352067053318024,-0.8568096160888672,-1.5192517042160034,0.45000338554382324,0.1857410967350006,-0.5474480986595154,-0.6226603984832764,-0.3259250521659851,-0.8049982786178589,0.41149431467056274,-0.33869048953056335,-0.40478962659835815,0.14186139404773712,0.08049512654542923,0.12524786591529846,0.05503413826227188,0.5369344353675842,0.22099512815475464,-0.22166168689727783,0.49372294545173645,0.14834408462047577,0.7515535950660706,0.23170407116413116,-0.38584038615226746,-0.6664334535598755,0.08026009798049927,0.05644957721233368,-0.47618070244789124,-0.07221367955207825,-0.013390932232141495,-0.7227036356925964,0.2766876816749573,-0.2050083577632904,0.0018085697665810585,0.36839884519577026,-4.047801494598389,0.25997495651245117,0.6095144748687744,0.29139724373817444,0.1967528611421585,0.33130836486816406,0.10284334421157837,0.6389473080635071,0.3290032148361206,0.469316303730011,-0.6486641764640808,0.9727193713188171,0.1883121132850647,-0.33047881722450256,-0.36619096994400024,0.22055767476558685,0.3932532072067261,-0.5142701864242554,-0.008600234985351562,0.1599426567554474,-0.09545424580574036,0.23433077335357666,-0.042303428053855896,0.7357178926467896,-0.32235464453697205,0.08163000643253326,0.14104235172271729,-0.11884527653455734,-0.03371256962418556,0.0557616725564003,0.3496687710285187,-0.03216787800192833,-0.003476671874523163,0.3798062205314636,0.03774901106953621,0.20039451122283936,-0.3984847366809845,3.36946439743042,-0.13239504396915436,0.001673419028520584,0.7380388379096985,-0.30677103996276855,0.9782622456550598,-0.19148962199687958,-0.3291283845901489,-0.27219173312187195,0.11630738526582718,-0.3731819987297058,0.2829224765300751,-0.5195115208625793,-0.707719087600708,0.13076543807983398,0.09487534314393997,0.3715026080608368,-0.21381931006908417,0.06631460785865784,0.1631127893924713,0.6596425771713257,-0.34905654191970825,0.4622417092323303,-0.2369920015335083,-0.4202103316783905,-0.5958117246627808,-0.0054769366979599,0.05269158259034157,0.3168359696865082,-0.42596322298049927,-0.2948320209980011,0.19625362753868103,0.3843995928764343,-0.7386986017227173,0.29027774930000305,0.38638198375701904,0.398516982793808,0.5393836498260498,-0.7760148644447327,0.026768285781145096,-0.6783398985862732,0.3489813208580017,-1.9833325147628784,0.42915868759155273,-0.3807029724121094,0.7297704219818115,-0.3749578893184662,-0.988932728767395,-0.049560628831386566,-0.748236894607544,-0.39161738753318787,-0.07422567903995514,0.7568775415420532,-0.42796590924263,-0.6895531415939331,0.7455142736434937,0.3727438449859619,-0.302215039730072,-0.2940479516983032,-0.39270395040512085,0.48044177889823914,-0.45199188590049744,0.012708820402622223,-0.014463722705841064,0.38177770376205444,0.41518479585647583,-0.26775816082954407,0.0609671026468277,0.259851336479187,0.5660082101821899,0.28002557158470154,0.2567088007926941,0.08408413827419281,-0.17901833355426788,0.6893192529678345,-0.18076415359973907,-0.1638849675655365,0.7592079639434814,-0.2850896716117859,0.09555481374263763,-0.34255003929138184,0.21607792377471924,0.6083880066871643,-0.27518394589424133,-0.2888985574245453,0.4869835376739502,0.24507123231887817,-0.04523368924856186,0.08955748379230499,0.8814894556999207,0.7514408826828003,-0.7933105826377869,1.4745051860809326,-0.8296284675598145,0.20127254724502563,-0.17663174867630005,0.10280756652355194,0.7590713500976562,0.6627715826034546,0.011114057153463364,-0.21741513907909393,-0.2958572506904602,-0.07200832664966583,-0.028994381427764893,-0.11766113340854645,-0.29194989800453186,-0.8990501165390015,0.22843225300312042,0.3628116250038147,-0.7341636419296265,-0.3731664717197418,-0.16071830689907074,-0.0289015993475914,0.7402246594429016,0.38305380940437317,0.8563412427902222,0.43994849920272827,0.30292415618896484,-0.22889143228530884,0.16537168622016907,0.7458362579345703,0.012104399502277374,-0.15416470170021057,-0.14556102454662323,-0.748606264591217,-0.5879684686660767,0.3174847364425659,-0.35950881242752075,-0.18004687130451202,-0.31736502051353455,-0.17857733368873596,0.23575669527053833,0.9159373044967651,0.2646183967590332,1.1622544527053833,0.6009469628334045,-0.020364172756671906,0.005769722163677216,0.3249523639678955,0.10982750356197357,-0.18247875571250916,-0.018897704780101776,-0.3283432722091675,0.06723657250404358,-0.18632438778877258,0.016186058521270752,-0.299119770526886,0.27416902780532837,-0.4262268543243408,-0.17139290273189545,1.6794452667236328,0.958503246307373,0.46273133158683777,0.3776611387729645,0.4485767185688019,0.4364531934261322,0.14672908186912537,-1.850408911705017,0.0067354487255215645,-0.7456330060958862,0.5802070498466492,0.3341884911060333,-0.7816597819328308,0.8321707248687744,-0.13638745248317719,-0.02185065858066082,-0.4651019871234894,-0.46033725142478943,-0.7211554050445557,-0.36014968156814575,-0.14086481928825378,-0.5944161415100098,0.8056583404541016,-0.7071620225906372,0.3785657584667206,-0.332245409488678,-0.09814120084047318,0.4233565926551819,0.015407413244247437,-0.33447521924972534,-0.4071231186389923,-0.067552350461483,-0.013831926509737968,0.16377918422222137,0.4718702435493469,-0.27083900570869446,-0.020545989274978638,-0.7419271469116211,-0.41673678159713745,-0.10136746615171432,0.2697226405143738,-0.28535905480384827,-0.3748951554298401,-0.7390844821929932,0.034545667469501495,1.644720435142517,-0.009804271161556244,-0.3737269937992096,0.5042737722396851,0.20176424086093903,-0.45157724618911743,-0.029246389865875244,-0.25737810134887695,-0.16420505940914154,0.39507946372032166,-0.6092503666877747,-0.547132134437561,0.49879688024520874,0.050793204456567764,-0.42933282256126404,-0.6348257064819336,-0.5210633873939514,-0.01414722204208374,0.241664320230484,0.07189908623695374,0.6878603100776672,-0.44729337096214294,0.6146893501281738,0.3114408254623413,0.09885749220848083,-2.39998459815979,0.22510097920894623,0.08821532130241394,0.02281942591071129,-0.16851471364498138,-0.39948421716690063,0.4781944751739502,-0.1106119155883789,0.37788909673690796,-0.5341840386390686,1.6657711267471313,0.23619230091571808,-0.16936853528022766,-0.34403157234191895,-0.05048051103949547,0.5156921148300171,-0.5097588300704956,-0.1076057031750679,0.16615211963653564,-0.41826316714286804,-0.09777717292308807,0.4317220151424408,1.4926064014434814,0.4437429904937744,0.6409068703651428,-0.2857368588447571,0.4252455234527588,-0.4507920742034912,-1.395687222480774,0.32343316078186035,-0.14300259947776794,0.17345699667930603,0.6882900595664978,-0.031068190932273865,-0.014234764501452446,0.2588723599910736,0.6380057334899902,-0.10916788876056671,0.21145275235176086,0.41304823756217957,1.875705361366272,0.30104920268058777,-0.14842073619365692,-0.4808446764945984,-0.3084228038787842,-0.2934291660785675,0.12193095684051514,0.18131327629089355,-0.632544219493866,0.30189579725265503,0.13330793380737305,0.1023193746805191,-0.14311614632606506,0.4220004975795746,0.20342287421226501,0.7711853981018066,0.04235168173909187,-0.061884328722953796,1.1321145296096802,-0.16180944442749023,0.008948512375354767,-0.0014485716819763184,-0.1739363670349121,-0.3506462275981903,-0.4292738437652588]}},true]},{"type":"Workflow","content":[{"workflow":{"name":"baml_answer_with_citations","version":"v0.1","steps":[{"name":"Initialize","body":[{"type":"composite","value":[{"type":"registeroperation","value":{"register":"$DSL","value":"class Citation {\n citation_id int\n document_reference string @description(#\\\"The name of the document and the page number that supports the answer e.g., FILENAME: Page [PAGE NUMBER]. This is a reference. You must mention it NO MATTER WHAT.\\\"#)\n relevantTextFromDocument string @alias(\\\"relevantSentenceFromDocument\\\") @description(#\\\"The relevant text from the document that supports the answer. This is part of the citation. You must quote it EXACTLY as it appears in the document with any special characters it contains. You may cite a part of the sentence. The text should be contiguous and not broken up. You may NOT summarize or skip sentences. If you need to skip a sentence, start a new citation instead.\\\"#)\n }\n\n class Answer {\n answersInText Citation[] @alias(\\\"relevantSentencesFromText\\\")\n answer AnswerWithCitations @description(#\\\"An answer to the user's question that MUST cite sources from the relevantSentencesFromText. Like [0]. If multiple citations are needed, write them like [0][1][2].\\\"#)\n }\n\n class AnswerWithCitations {\n brief_introduction Paragraph @description(#\\\"3-4 long sentences. Must use the citations in the text.\\\"#)\n extensive_body Paragraph[] @description(#\\\"At least 3-6 long sentences. The more the better. Must use the citations in the text.\\\"#)\n conclusion Paragraph[] @description(#\\\"1-3 long sentences. Must use the citations in the text.\\\"#)\n }\n\n class Paragraph {\n sentences string[]\n }\n\n class Document {\n file string\n text string\n reference string\n }\n class Context {\n documents Document[]\n question string\n }\n\n function AnswerQuestion(context: Context) -> Answer {\n client ShinkaiProvider\n\n prompt #\\\"\n Out of the given content, do your best to answer the question.\n\n CONTEXT:\n {% for document in context.documents %}\n ----\n DOCUMENT NAME: {{ document.file }}\n PARTIAL TEXT: {{ document.text }}\n DOCUMENT REFERENCE: {{ document.reference }}\n ---\n {% endfor %}\n \n {{ ctx.output_format }}\n\n QUESTION: {{ context.question }}. Citing the references no matter what e.g., [0]. If multiple citations are needed, write them like [0][1][2].\n\n ANSWER:\n {{ _.role(\\\"user\\\") }}\n \\\"#\n }"}},{"type":"registeroperation","value":{"register":"$PARAM","value":"context"}},{"type":"registeroperation","value":{"register":"$FUNCTION","value":"AnswerQuestion"}},{"type":"registeroperation","value":{"register":"$RESULT","value":{"name":"baml_inference","args":[{"type":"register","value":"$INPUT"},{"type":"string","value":""},{"type":"string","value":""},{"type":"register","value":"$DSL"},{"type":"register","value":"$FUNCTION"},{"type":"register","value":"$PARAM"}]}}}]}]}],"raw":"\n workflow baml_answer_with_citations v0.1 {\n step Initialize {\n $DSL = \"class Citation {\n citation_id int\n document_reference string @description(#\\\"The name of the document and the page number that supports the answer e.g., FILENAME: Page [PAGE NUMBER]. This is a reference. You must mention it NO MATTER WHAT.\\\"#)\n relevantTextFromDocument string @alias(\\\"relevantSentenceFromDocument\\\") @description(#\\\"The relevant text from the document that supports the answer. This is part of the citation. You must quote it EXACTLY as it appears in the document with any special characters it contains. You may cite a part of the sentence. The text should be contiguous and not broken up. You may NOT summarize or skip sentences. If you need to skip a sentence, start a new citation instead.\\\"#)\n }\n\n class Answer {\n answersInText Citation[] @alias(\\\"relevantSentencesFromText\\\")\n answer AnswerWithCitations @description(#\\\"An answer to the user's question that MUST cite sources from the relevantSentencesFromText. Like [0]. If multiple citations are needed, write them like [0][1][2].\\\"#)\n }\n\n class AnswerWithCitations {\n brief_introduction Paragraph @description(#\\\"3-4 long sentences. Must use the citations in the text.\\\"#)\n extensive_body Paragraph[] @description(#\\\"At least 3-6 long sentences. The more the better. Must use the citations in the text.\\\"#)\n conclusion Paragraph[] @description(#\\\"1-3 long sentences. Must use the citations in the text.\\\"#)\n }\n\n class Paragraph {\n sentences string[]\n }\n\n class Document {\n file string\n text string\n reference string\n }\n class Context {\n documents Document[]\n question string\n }\n\n function AnswerQuestion(context: Context) -> Answer {\n client ShinkaiProvider\n\n prompt #\\\"\n Out of the given content, do your best to answer the question.\n\n CONTEXT:\n {% for document in context.documents %}\n ----\n DOCUMENT NAME: {{ document.file }}\n PARTIAL TEXT: {{ document.text }}\n DOCUMENT REFERENCE: {{ document.reference }}\n ---\n {% endfor %}\n \n {{ ctx.output_format }}\n\n QUESTION: {{ context.question }}. Citing the references no matter what e.g., [0]. If multiple citations are needed, write them like [0][1][2].\n\n ANSWER:\n {{ _.role(\\\"user\\\") }}\n \\\"#\n }\"\n $PARAM = \"context\"\n $FUNCTION = \"AnswerQuestion\"\n $RESULT = call baml_inference($INPUT, \"\", \"\", $DSL, $FUNCTION, $PARAM)\n }\n } @@official.shinkai\n ","description":"Generates an answer to a question with citations from the provided content using BAML. The answer includes quotes from the content as citations.","author":"@@official.shinkai","sticky":false},"embedding":{"id":"","vector":[0.3797622621059418,0.055756017565727234,-0.3101310729980469,-0.1303926408290863,-0.2349807769060135,-0.3620940148830414,-1.4513840675354004,0.4004634618759155,-0.09126128256320953,-0.2862396240234375,-0.21521227061748505,0.5031366348266602,0.5290755033493042,-0.1413222849369049,0.6188375949859619,0.38532504439353943,-0.11255966126918793,-0.5313267707824707,-1.018203854560852,0.16118848323822021,0.38974928855895996,0.26705488562583923,0.7251760363578796,0.3977380394935608,-0.11609482020139694,0.06196017935872078,0.13894720375537872,-0.2236107438802719,-1.2703726291656494,-1.2511805295944214,0.48944661021232605,0.2941161096096039,-0.36227738857269287,-0.2411549985408783,-0.49036508798599243,-0.4147837460041046,0.3464353680610657,-0.19157636165618896,-0.10052890330553055,0.33582234382629395,-0.34775447845458984,0.04653438180685043,0.608782172203064,-0.3258453607559204,-0.12086259573698044,-0.3823518753051758,1.0109241008758545,-0.23640067875385284,0.7499700784683228,0.8023027181625366,-0.3843623101711273,-0.3905274569988251,0.27414560317993164,0.29860666394233704,-0.4371856153011322,0.23716586828231812,0.04210366681218147,0.3562734127044678,-0.331453800201416,0.11200998723506927,0.37262940406799316,-0.3658697307109833,-3.935379981994629,0.14438453316688538,0.6308651566505432,0.21387910842895508,0.28002044558525085,-0.16130675375461578,-0.8150539994239807,-0.4389743506908417,-0.06972597539424896,-0.5424433946609497,-0.7765288949012756,0.5558378100395203,0.3599364161491394,-0.4887274503707886,-0.0007520616054534912,0.05174863338470459,0.590337872505188,-0.384021520614624,-0.053891345858573914,0.3669104278087616,-0.2317630499601364,0.25666916370391846,-0.7620011568069458,0.30930858850479126,-0.21822401881217957,-0.643441379070282,0.44276541471481323,0.660913348197937,-0.4575757086277008,-0.2502431869506836,0.15478183329105377,0.38664811849594116,-0.08887406438589096,0.2539937496185303,-0.03916637599468231,-0.5154840350151062,0.5459664463996887,2.9898178577423096,0.2672237455844879,-0.37507301568984985,0.8107877373695374,-0.5531704425811768,0.7260451912879944,-0.15623879432678223,0.3055795431137085,0.1754366159439087,0.09581713378429413,0.44947704672813416,0.31352749466896057,-0.28868404030799866,-0.5385019779205322,0.33680713176727295,-0.21201713383197784,0.7001216411590576,-0.7345210313796997,0.1426507532596588,0.11188594251871109,0.6378754377365112,0.36010265350341797,0.19299772381782532,-0.19160330295562744,-0.1184423640370369,0.14750339090824127,0.23624475300312042,0.017083611339330673,0.2653906047344208,0.2514684498310089,0.19559024274349213,0.5418351888656616,0.1569286286830902,-0.7294088006019592,0.328125923871994,0.02290940470993519,0.16350258886814117,1.043413758277893,-1.032653570175171,0.9681538343429565,-0.8715519309043884,0.21746881306171417,-1.6401642560958862,0.9072688221931458,0.3240673542022705,0.19921818375587463,-0.22009170055389404,-1.024997353553772,0.3806820213794708,-0.39549684524536133,-0.42126455903053284,-0.37500330805778503,0.12471919506788254,-0.46238279342651367,-0.11431951820850372,0.43173450231552124,-0.08136603981256485,-0.7753247022628784,-0.15560556948184967,-0.20577538013458252,0.16913741827011108,-0.24217629432678223,-0.3097689747810364,0.6912097334861755,-0.46705949306488037,-0.23456573486328125,-0.19368106126785278,-0.026194050908088684,0.29294338822364807,0.20618201792240143,0.038728564977645874,-0.313559353351593,-0.3366357088088989,0.00509969238191843,1.1993379592895508,0.15553726255893707,-0.14727765321731567,0.2659122943878174,-0.15252447128295898,0.7438075542449951,-0.1947561800479889,0.5643417239189148,0.5989380478858948,-0.6331312656402588,-0.3168948292732239,-0.23661555349826813,0.7672645449638367,0.46782436966896057,0.2681032121181488,1.418749451637268,1.2327861785888672,-0.46809977293014526,0.8014423847198486,-0.5430251359939575,-0.3643764853477478,0.15952736139297485,0.19020645320415497,0.7295116782188416,-0.0844498723745346,1.010969638824463,0.24072204530239105,0.3357287049293518,0.020911354571580887,0.2755776643753052,0.02969147264957428,-0.01337328553199768,-0.7969410419464111,-0.47564974427223206,0.5079171061515808,-0.5863653421401978,-0.7805141806602478,-0.10677085816860199,-0.8892369270324707,0.7942572236061096,0.6627474427223206,0.47531434893608093,0.3589997887611389,-0.15228474140167236,-0.10162676870822906,-0.11354662477970123,0.2639334201812744,0.07278834283351898,-0.48128312826156616,-0.8211566805839539,-0.2795396149158478,-0.7236523628234863,0.352206289768219,0.01859442889690399,-0.08775120973587036,-0.22070738673210144,-0.48127979040145874,0.36574625968933105,1.7433961629867554,0.982549786567688,1.0124894380569458,0.7370933890342712,0.4407808184623718,-0.21980562806129456,-0.13790135085582733,0.5385861396789551,-0.4323239326477051,-0.2465112805366516,-0.22517752647399902,-0.0271136611700058,0.26054584980010986,0.44240519404411316,-0.9002771377563477,0.22551384568214417,-0.5237748026847839,0.08540594577789307,1.3925650119781494,0.2770116627216339,-0.5225498676300049,0.44990918040275574,-0.1984628587961197,-0.12113264948129654,0.3022267520427704,-1.8065658807754517,-0.3099088966846466,-0.6861429214477539,0.7306676506996155,-0.30434128642082214,-0.2812166213989258,0.7118960618972778,0.04537050053477287,-0.39949703216552734,-0.9633961915969849,-0.8368886113166809,-1.018973708152771,-0.23503834009170532,-0.07855327427387238,-0.4439423978328705,1.099806547164917,-0.6865937113761902,-0.19636347889900208,0.16010379791259766,0.4755159914493561,0.8275705575942993,0.3734543025493622,-0.19382072985172272,-1.1013609170913696,0.4655303955078125,-0.4615223705768585,0.029980260878801346,-0.12803228199481964,-0.6200829744338989,-0.22082911431789398,-0.6129460334777832,-0.440936803817749,-0.12251780182123184,0.25749075412750244,-0.21793797612190247,-0.31565356254577637,-1.0452193021774292,0.48470351099967957,1.489746332168579,0.34717267751693726,-0.11593799293041229,0.5712113380432129,0.37145087122917175,-0.1405247449874878,0.10602741688489914,0.44691920280456543,0.2407248467206955,0.1857607066631317,-0.4698955714702606,-0.6073989272117615,0.003017023205757141,-0.692069411277771,-0.056892529129981995,0.2016339898109436,-0.6986490488052368,-0.4357801079750061,-0.3368676006793976,-0.21542751789093018,0.16499149799346924,-0.49468180537223816,0.7049293518066406,0.35484278202056885,-0.12084715068340302,-2.1006436347961426,0.17676638066768646,1.0268604755401611,-0.1937757432460785,-0.3107340335845947,-0.12163938581943512,0.4608701467514038,-0.5104370713233948,0.41666844487190247,-0.25553765892982483,1.501641869544983,0.391608864068985,-0.5072856545448303,-0.3386199176311493,0.35516029596328735,0.4765162467956543,-0.1931939572095871,-0.04903487116098404,-0.11199391633272171,-0.31363174319267273,-0.16184554994106293,1.0071266889572144,1.2638416290283203,1.3507024049758911,0.7613588571548462,0.4123046398162842,0.2764201760292053,-0.6620365977287292,-0.957791805267334,0.1179533302783966,0.05718009173870087,-0.5120300054550171,0.683925211429596,-0.38944295048713684,-0.40000054240226746,-0.1454511433839798,0.30291903018951416,-0.36079010367393494,-0.48647207021713257,0.13034778833389282,1.8149853944778442,0.11981132626533508,-0.16857168078422546,0.27804651856422424,-0.248652383685112,-0.22382158041000366,-0.02025716006755829,0.23994572460651398,-0.38804712891578674,0.15800036489963531,-0.7771037817001343,0.3905825614929199,-0.7868342995643616,-0.009819000959396362,-0.2602401375770569,0.5894878506660461,0.41537952423095703,0.20397962629795074,0.858824610710144,0.4924372136592865,-0.09800249338150024,0.33428242802619934,-0.15497006475925446,-0.18699677288532257,-0.10839053988456726]}},false]},{"type":"Workflow","content":[{"workflow":{"name":"answer_with_citations_workflow","version":"v0.1","steps":[{"name":"Initialize","body":[{"type":"composite","value":[{"type":"registeroperation","value":{"register":"$FILE_PIECES","value":{"name":"process_embeddings_in_job_scope_with_metadata","args":[]}}},{"type":"registeroperation","value":{"register":"$LLM_INPUT","value":{"name":"generate_json_map","args":[{"type":"string","value":"question"},{"type":"register","value":"$INPUT"},{"type":"string","value":"documents"},{"type":"register","value":"$FILE_PIECES"}]}}},{"type":"registeroperation","value":{"register":"$LLM_RESPONSE","value":{"name":"baml_answer_with_citations","args":[{"type":"register","value":"$LLM_INPUT"}]}}},{"type":"registeroperation","value":{"register":"$JINJA","value":"# Introduction\\n{%- for sentence in answer.brief_introduction.sentences %}\\n{{ sentence }}\\n{%- endfor %}\\n\\n# Body\\n{%- for section in answer.extensive_body %}\\n## Section {{ loop.index }}\\n{%- for sentence in section.sentences %}\\n{{ sentence }}\\n{%- endfor %}\\n{%- endfor %}\\n\\n# Conclusion\\n{%- for section in answer.conclusion %}\\n{{ section.sentences[0] }}\\n{%- endfor %}\\n\\n# Citations\\n{%- for citation in relevantSentencesFromText %}\\n[{{ citation.citation_id }}]: {{ citation.relevantSentenceFromDocument }}\\n{%- endfor %}"}},{"type":"registeroperation","value":{"register":"$RESULT","value":{"name":"shinkai__json-to-md","args":[{"type":"string","value":"message"},{"type":"register","value":"$LLM_RESPONSE"},{"type":"string","value":"template"},{"type":"register","value":"$JINJA"}]}}}]}]}],"raw":"\n workflow answer_with_citations_workflow v0.1 {\n step Initialize {\n $FILE_PIECES = call process_embeddings_in_job_scope_with_metadata()\n $LLM_INPUT = call generate_json_map(\"question\", $INPUT, \"documents\", $FILE_PIECES)\n $LLM_RESPONSE = call baml_answer_with_citations($LLM_INPUT)\n $JINJA = \"# Introduction\\n{%- for sentence in answer.brief_introduction.sentences %}\\n{{ sentence }}\\n{%- endfor %}\\n\\n# Body\\n{%- for section in answer.extensive_body %}\\n## Section {{ loop.index }}\\n{%- for sentence in section.sentences %}\\n{{ sentence }}\\n{%- endfor %}\\n{%- endfor %}\\n\\n# Conclusion\\n{%- for section in answer.conclusion %}\\n{{ section.sentences[0] }}\\n{%- endfor %}\\n\\n# Citations\\n{%- for citation in relevantSentencesFromText %}\\n[{{ citation.citation_id }}]: {{ citation.relevantSentenceFromDocument }}\\n{%- endfor %}\"\n \n $RESULT = call shinkai__json-to-md(\"message\",$LLM_RESPONSE,\"template\",$JINJA)\n }\n } @@official.shinkai\n ","description":"Generates an answer to a question with citations from the provided content using RAG workflow.","author":"@@official.shinkai","sticky":false},"embedding":{"id":"","vector":[0.302041232585907,0.6495791673660278,-0.16463279724121094,0.27348119020462036,-0.3640792667865753,-0.11759210377931595,-1.3377487659454346,0.2906632423400879,0.2659119963645935,0.0064449855126440525,-0.2225845754146576,0.7155923247337341,0.2863701581954956,0.013627946376800537,0.37820589542388916,0.4598727524280548,-0.10306946933269501,-0.6235101819038391,-1.3434779644012451,0.01579219475388527,0.563793957233429,0.4702529311180115,0.24035745859146118,0.08729343116283417,-0.1935933530330658,0.4073832631111145,0.22304141521453857,-0.16020876169204712,-1.2370494604110718,-1.8152098655700684,0.32133832573890686,0.5529523491859436,-0.47941479086875916,-0.2894234359264374,-0.22529128193855286,-0.6637700796127319,0.038934219628572464,-0.11896584928035736,-0.6196734309196472,0.3092517852783203,-0.017506450414657593,0.29310837388038635,0.2966788709163666,0.11765111237764359,0.5300358533859253,-0.6917188167572021,0.4312555491924286,-0.34250134229660034,0.3841196596622467,0.25088948011398315,-0.7944143414497375,-0.686835527420044,0.4505968391895294,0.30513784289360046,-0.24635744094848633,0.22689467668533325,0.5774812698364258,-0.17809458076953888,0.3844796121120453,-0.10836978256702423,0.4342154264450073,0.08909395337104797,-4.313159465789795,0.42584100365638733,0.14493651688098907,0.08237434923648834,0.3053835928440094,-0.2510621249675751,-0.26908355951309204,0.05084872245788574,-0.20760825276374817,-0.2481420487165451,-0.20238164067268372,0.025295820087194443,0.051211945712566376,-0.30147409439086914,-0.2935594916343689,-0.11286266148090363,0.3743446469306946,-0.5593183636665344,-0.17406244575977325,0.6305493712425232,-0.05546174198389053,-0.06269138306379318,-0.7509041428565979,0.3297814726829529,-0.4034028947353363,-0.2742491364479065,0.34146708250045776,0.5505414009094238,-0.5094859600067139,-0.09207914769649506,0.3118738830089569,-0.27273064851760864,-0.351421594619751,0.12499718368053436,0.02875395491719246,0.37674230337142944,0.3279470205307007,3.104065179824829,0.1853073239326477,-0.6978022456169128,0.8353964686393738,-0.6210517287254333,0.299731969833374,-0.2903611361980438,0.34038618206977844,-0.16563871502876282,0.27116236090660095,0.6264962553977966,0.3312639594078064,-0.5524058938026428,-0.25126639008522034,0.48475781083106995,0.27730247378349304,0.22434116899967194,-0.5458792448043823,0.20768611133098602,-0.3331827223300934,1.0173496007919312,-0.048498235642910004,-0.07441143691539764,-0.47644293308258057,-0.37685298919677734,0.2681230902671814,0.27811694145202637,0.027686040848493576,0.14175771176815033,0.3515598177909851,0.43409720063209534,0.5166351795196533,-0.4411574900150299,-0.823940634727478,-0.2513667643070221,-0.3378399610519409,0.3593744933605194,1.012085199356079,-0.8341009616851807,0.41486555337905884,-0.8454400897026062,0.045630961656570435,-1.0219558477401733,0.6480528116226196,-0.022864188998937607,0.5243897438049316,-0.09312224388122559,-0.7185470461845398,0.454501748085022,-0.5255737900733948,-0.05204040929675102,-0.3932226300239563,0.21987518668174744,-0.18833470344543457,0.1750001460313797,0.7764050960540771,-0.08508025854825974,-0.4201195240020752,-0.027372032403945923,-0.5477855801582336,0.5084601044654846,-0.27074211835861206,-0.3358495533466339,0.37030738592147827,-0.1664036065340042,0.30039411783218384,-0.16436031460762024,0.26987943053245544,-0.07586002349853516,0.20720936357975006,-0.33640843629837036,0.14486727118492126,-0.058277927339076996,0.08135819435119629,0.6479024887084961,-0.39269688725471497,0.25529712438583374,0.09676061570644379,0.03970225900411606,-0.0051755160093307495,-0.3197023868560791,0.7519499659538269,0.39787548780441284,-0.5427854061126709,-0.2278692126274109,-0.13041603565216064,0.7266638278961182,0.39746806025505066,0.35260921716690063,0.8904515504837036,0.9481697082519531,-0.534455418586731,1.077448844909668,-0.4851692318916321,0.09174691140651703,0.40167665481567383,0.011938601732254028,0.209327831864357,0.19621434807777405,0.9554470777511597,-0.17806030809879303,0.4127517342567444,0.34222567081451416,0.34531280398368835,0.0028178244829177856,0.08940697461366653,-0.48655739426612854,-0.11633729934692383,0.4609406292438507,-0.5707967281341553,-0.7172647714614868,-0.15549525618553162,-0.6388192176818848,0.9782460927963257,0.5757883191108704,0.4868878126144409,0.5279903411865234,-0.03237190097570419,-0.2205381691455841,0.16652852296829224,0.643582284450531,-0.2677132189273834,0.06080951169133186,-0.13484515249729156,-0.4923725724220276,-0.516819179058075,0.6620203852653503,0.07592541724443436,0.07159370183944702,0.06254155933856964,-0.5057934522628784,0.0764768123626709,1.0371267795562744,0.624696671962738,1.128337025642395,0.6512643098831177,0.3021669387817383,-0.4556947946548462,0.05481366068124771,0.30271732807159424,-0.613541305065155,0.12894059717655182,-0.10522378981113434,0.21463046967983246,-0.07597915828227997,0.36100587248802185,-0.7120083570480347,-0.252541184425354,-0.6509837508201599,0.09734252095222473,1.7409844398498535,0.018263503909111023,-0.38902392983436584,0.6623021960258484,0.26024848222732544,0.12274602800607681,0.2705548107624054,-1.983655333518982,-0.34808245301246643,-0.44870463013648987,0.8398820161819458,0.3027595579624176,-0.3285507261753082,0.8434791564941406,0.18463754653930664,-0.02081805095076561,-0.5282495617866516,-0.626075804233551,-0.9119731187820435,-0.0012827664613723755,-0.09766072779893875,-0.7564650774002075,0.7809023857116699,-0.6776382327079773,0.04063400253653526,-0.08290590345859528,0.14572179317474365,0.5667208433151245,0.3448168635368347,-0.5389902591705322,-0.8892549276351929,0.4638209342956543,-0.35105016827583313,-0.6134374141693115,0.05028517544269562,-0.3464180827140808,-0.25418758392333984,-0.7385156154632568,-0.05664042383432388,-0.23391547799110413,0.09158208966255188,-0.17262275516986847,-0.6692696213722229,-0.9896000623703003,0.6646811962127686,1.926600694656372,0.29630979895591736,0.04862155020236969,0.4683615267276764,0.31428056955337524,-0.5492845177650452,0.5060234665870667,0.14091579616069794,-0.30021777749061584,-0.13741666078567505,-0.7438650131225586,0.02209792286157608,0.4707602262496948,-0.4167380928993225,0.15437601506710052,0.48597821593284607,-0.5394192337989807,-0.09873858839273453,-0.10803239047527313,0.30014458298683167,0.3251103162765503,-0.39479196071624756,0.14275161921977997,0.3502808213233948,-0.34477901458740234,-2.357520818710327,0.013839280232787132,0.7088819146156311,-0.12972787022590637,-0.15496616065502167,-0.1557634323835373,0.5408610105514526,0.042263880372047424,0.21417298913002014,-0.45165085792541504,1.2327648401260376,0.5347790122032166,-0.3049626052379608,-0.43793389201164246,0.17141607403755188,0.9914730787277222,-0.23269782960414886,0.4983164072036743,-0.12929704785346985,-0.021774105727672577,-0.49563103914260864,0.6341679096221924,1.1403045654296875,0.5469133853912354,0.6069785356521606,-0.11656582355499268,0.21336913108825684,-0.5077071785926819,-1.2154546976089478,0.09518444538116455,0.06945158541202545,-0.6196871399879456,0.7504529356956482,-0.3938862979412079,-0.6696345806121826,-0.11530251801013947,0.42651259899139404,0.06762523949146271,-0.014222238212823868,-0.08163487166166306,1.8882081508636475,-0.18455733358860016,-0.29645416140556335,-0.11717289686203003,-0.2683551609516144,-0.560032069683075,0.3953476548194885,0.10460548102855682,-0.22123202681541443,0.167826309800148,-0.23793259263038635,0.37224283814430237,-0.7192226648330688,-0.13425150513648987,-0.3594304323196411,0.244207501411438,0.08292294293642044,0.3012055456638336,1.0009146928787231,0.4970721900463104,-0.14509020745754242,0.24888360500335693,-0.2440701127052307,-0.43989014625549316,0.009084545075893402]}},true]}]"###; -pub static WORKFLOWS_JSON: &str = r###"[{"type":"Workflow","content":[{"workflow":{"name":"Extensive_summary","version":"v0.1","steps":[{"name":"Initialize","body":[{"type":"composite","value":[{"type":"registeroperation","value":{"register":"$PROMPT","value":"Summarize this: "}},{"type":"registeroperation","value":{"register":"$EMBEDDINGS","value":{"name":"process_embeddings_in_job_scope","args":[]}}}]}]},{"name":"Summarize","body":[{"type":"registeroperation","value":{"register":"$RESULT","value":{"name":"multi_inference","args":[{"type":"register","value":"$PROMPT"},{"type":"register","value":"$EMBEDDINGS"}]}}}]}],"raw":"\n workflow Extensive_summary v0.1 {\n step Initialize {\n $PROMPT = \"Summarize this: \"\n $EMBEDDINGS = call process_embeddings_in_job_scope()\n }\n step Summarize {\n $RESULT = call multi_inference($PROMPT, $EMBEDDINGS)\n }\n } @@official.shinkai\n ","description":"Reviews in depth all the content to generate a summary.","author":"@@official.shinkai","sticky":false},"embedding":{"id":"","vector":[0.6820248961448669,0.5723804831504822,0.056784410029649734,-0.029523666948080063,-0.2254689335823059,-0.053013481199741364,-0.6708416938781738,-0.2624345123767853,-0.033756330609321594,0.4013897180557251,-0.16321982443332672,0.971656858921051,0.2718249261379242,0.07108756899833679,0.2820807695388794,0.14116838574409485,-0.11496889591217041,-0.49301284551620483,-1.0789883136749268,-0.043452829122543335,0.19382520020008087,0.5948700308799744,0.6591302156448364,0.16274362802505493,-0.030279342085123062,-0.1913491189479828,-0.3163045048713684,-0.2898331880569458,-0.7694717645645142,-2.4501161575317383,0.5279894471168518,0.0053562745451927185,-0.5002804398536682,-0.5608552694320679,0.028381161391735077,-0.6834791302680969,0.328404039144516,0.2872193455696106,-0.27112722396850586,-0.2420305460691452,-0.20994114875793457,0.23660853505134583,-0.35357770323753357,0.590043306350708,0.27437782287597656,0.06486925482749939,-0.15818193554878235,-0.2542445659637451,0.3756386339664459,0.38245582580566406,-0.45134201645851135,-0.26646173000335693,-0.21188713610172272,0.5074135065078735,-0.45056354999542236,0.42795759439468384,-0.14764094352722168,-0.299643874168396,0.24885445833206177,0.021038610488176346,0.29774922132492065,0.527859091758728,-4.216637134552002,0.35374659299850464,0.19555260241031647,0.3751485049724579,0.17744454741477966,-0.2610761225223541,-0.172037273645401,0.032772570848464966,0.05567239597439766,0.19824181497097015,-0.13289085030555725,-0.1100323274731636,-0.23126265406608582,-0.34616896510124207,0.3950774073600769,0.35234352946281433,0.1308232843875885,-0.6239751577377319,-0.7391460537910461,0.4362350106239319,-0.0347885936498642,0.09445835649967194,-0.2117754966020584,0.7171225547790527,-0.3040316104888916,-0.3600367605686188,0.37041613459587097,-0.06581398844718933,-0.006318345665931702,-0.21981696784496307,-0.002286979928612709,0.2790469229221344,-0.7975400686264038,0.10219541937112808,0.15441451966762543,0.11658502370119095,0.4612636864185333,3.6136317253112793,0.6766623854637146,-0.28591224551200867,0.7045385241508484,-0.4960375726222992,0.1050494909286499,-0.5604535937309265,-0.25389742851257324,-0.2956107258796692,0.40285223722457886,-0.111656554043293,0.015156731009483337,-0.5351597666740417,-0.030287399888038635,0.3177969753742218,0.21704047918319702,0.7171976566314697,-0.46601396799087524,0.3439251184463501,-0.061566051095724106,0.20522497594356537,-0.6280752420425415,0.130172997713089,0.051850613206624985,0.21620029211044312,-0.2943073809146881,0.1809474229812622,-0.23445376753807068,0.2775576710700989,0.2914619445800781,0.0578656867146492,0.10241352021694183,-0.15168319642543793,-0.7568095326423645,0.092719167470932,-0.0777229368686676,-0.15893718600273132,0.5966013073921204,-0.7341698408126831,0.25946319103240967,-0.9252210259437561,0.09058776497840881,-1.5351767539978027,0.7115793824195862,0.29241278767585754,0.7798487544059753,-0.08018416166305542,-0.13354992866516113,-0.08928925544023514,-0.4238916337490082,-0.5697543025016785,0.06765686720609665,0.77348792552948,-0.04202955216169357,0.06487800180912018,0.5874587893486023,-0.11936471611261368,-0.25156763195991516,0.19140180945396423,-0.5563774108886719,0.31181517243385315,-0.32280847430229187,-0.15203385055065155,0.6281672716140747,0.6141714453697205,0.5077856183052063,-0.20541121065616608,0.334749698638916,-0.22992375493049622,0.3473362326622009,0.13209888339042664,-0.046164438128471375,-0.4251396954059601,0.33730384707450867,0.8212467432022095,0.177277609705925,-0.1610117256641388,-0.07467097789049149,0.2908981442451477,0.2191067337989807,-0.5679166316986084,0.7439255714416504,0.5261525511741638,-0.11653833091259003,-0.3659759759902954,-0.023860540241003036,-0.26393836736679077,0.42201778292655945,-0.21162325143814087,0.6553518176078796,0.7129044532775879,-0.8967499136924744,1.4437609910964966,-0.7139504551887512,-0.4562397301197052,0.1866864711046219,-0.1461351215839386,-0.5919792056083679,-0.022950291633605957,0.10381539165973663,0.28671005368232727,-0.5119964480400085,0.06818243861198425,-0.34842413663864136,-0.2360081672668457,-0.20727667212486267,-0.666267454624176,-0.2698496878147125,0.14760757982730865,-0.1733710914850235,-0.7490845322608948,0.17996001243591309,-0.1494026631116867,0.6294229030609131,0.6854228973388672,0.45075780153274536,0.16544346511363983,0.15525199472904205,0.40028688311576843,0.6559727787971497,0.5462879538536072,0.6049190759658813,-0.16969510912895203,-0.5258905291557312,-0.7370105385780334,-0.5058722496032715,0.05097363144159317,-0.4502354860305786,-0.16756923496723175,-0.3616001605987549,-0.07482671737670898,0.5364893674850464,0.3961637616157532,0.6380713582038879,0.7769057154655457,0.45226916670799255,0.12783251702785492,-0.06475261598825455,0.5124138593673706,0.2543259561061859,-0.3266713619232178,0.6652782559394836,-0.10381640493869781,-0.2858583927154541,0.369432270526886,0.4281133711338043,-0.397693008184433,-0.4147809147834778,-0.007397249341011047,-0.16696804761886597,1.8266067504882812,0.09511159360408783,-0.33791670203208923,0.20951442420482635,0.5353755950927734,0.4132263660430908,0.07172563672065735,-1.3672807216644287,0.033725690096616745,-0.6914818286895752,0.4152260720729828,-0.29042062163352966,0.2820392847061157,-0.12484639883041382,0.12444232404232025,-0.2538592219352722,-0.1376664787530899,-0.376803457736969,-0.21342863142490387,-0.3275066018104553,-0.1573990434408188,0.07955310493707657,0.7591940760612488,0.06325787305831909,-0.1243286207318306,-0.06205055117607117,0.27926522493362427,0.1881060153245926,-0.07187489420175552,-0.43998342752456665,-0.04985599219799042,0.35954052209854126,0.07155530899763107,0.37024304270744324,0.25004273653030396,-0.5525103211402893,-0.2558727264404297,-0.36321941018104553,0.04473167657852173,-0.09463290125131607,-0.01605386659502983,-0.21422991156578064,-0.40423282980918884,-0.07233521342277527,0.24171797931194305,1.5734977722167969,0.2532348036766052,0.3514263331890106,0.5783570408821106,0.38809657096862793,0.18779775500297546,-0.7362217903137207,0.018929127603769302,-0.2433643937110901,-0.1767692118883133,-0.6034640073776245,-0.2618042230606079,0.23901714384555817,0.25006982684135437,-0.3671899735927582,0.56818026304245,-0.45649564266204834,-0.5177562832832336,0.21355649828910828,0.04084805026650429,0.36265265941619873,-0.4912548065185547,0.3579895794391632,-0.06822404265403748,0.23526312410831451,-2.4479732513427734,-0.409572571516037,0.33847421407699585,0.39877307415008545,-0.31740933656692505,-0.13011762499809265,1.0355134010314941,-0.2030523419380188,0.004002278670668602,-0.17361848056316376,1.0097349882125854,0.3712850511074066,0.04738866910338402,-0.38382434844970703,-0.22995835542678833,0.10955353826284409,-0.5831428170204163,0.5505454540252686,-0.251912921667099,-0.6052247285842896,-0.11847558617591858,0.39012327790260315,1.722125768661499,0.4369223117828369,0.4068147540092468,-0.08888967335224152,0.16951988637447357,-0.7578551769256592,-1.5347665548324585,-0.09822624921798706,-0.1749330759048462,-0.40222880244255066,0.40935447812080383,-0.014797728508710861,-0.25942203402519226,0.7363397479057312,0.8023666143417358,0.1866847723722458,1.0114266872406006,-0.37116944789886475,1.44536292552948,-0.37696170806884766,-0.06581003218889236,0.011476762592792511,0.43547624349594116,0.33689627051353455,0.4570700526237488,-0.09152284264564514,-0.7278273105621338,-0.19184312224388123,-0.024527274072170258,0.5096248984336853,-0.4112659990787506,0.585030198097229,0.6007319092750549,0.13742738962173462,-0.0392843633890152,0.18517468869686127,0.4498704671859741,0.053321029990911484,0.055953219532966614,-0.3754947781562805,-0.2632603943347931,-0.8821566700935364,-0.5415434241294861]}},true]},{"type":"Workflow","content":[{"workflow":{"name":"Hyde_inference","version":"v0.1","steps":[{"name":"Initialize","body":[{"type":"composite","value":[{"type":"registeroperation","value":{"register":"$PROMPT","value":"write a passage to answer the question: "}},{"type":"registeroperation","value":{"register":"$HYDE_PROMPT","value":{"name":"concat","args":[{"type":"register","value":"$PROMPT"},{"type":"register","value":"$INPUT"}]}}},{"type":"registeroperation","value":{"register":"$HYDE_PASSAGE","value":{"name":"inference_no_ws","args":[{"type":"register","value":"$HYDE_PROMPT"}]}}},{"type":"registeroperation","value":{"register":"$HYDE_INPUT","value":{"name":"concat","args":[{"type":"register","value":"$INPUT"},{"type":"string","value":". "},{"type":"register","value":"$HYDE_PASSAGE"}]}}},{"type":"registeroperation","value":{"register":"$EMBEDDINGS","value":{"name":"search_embeddings_in_job_scope","args":[{"type":"register","value":"$HYDE_INPUT"}]}}}]}]},{"name":"Summarize","body":[{"type":"composite","value":[{"type":"registeroperation","value":{"register":"$CONNECTOR","value":"\\nLeverage the following information to answer the previous query: --- start ---"}},{"type":"registeroperation","value":{"register":"$NEW_INPUT","value":{"name":"concat","args":[{"type":"register","value":"$INPUT"},{"type":"register","value":"$CONNECTOR"},{"type":"register","value":"$EMBEDDINGS"}]}}},{"type":"registeroperation","value":{"register":"$RESULT","value":{"name":"inference","args":[{"type":"register","value":"$NEW_INPUT"}]}}}]}]}],"raw":"\n workflow Hyde_inference v0.1 {\n step Initialize {\n $PROMPT = \"write a passage to answer the question: \"\n $HYDE_PROMPT = call concat($PROMPT, $INPUT)\n $HYDE_PASSAGE = call inference_no_ws($HYDE_PROMPT)\n $HYDE_INPUT = call concat($INPUT, \". \", $HYDE_PASSAGE )\n $EMBEDDINGS = call search_embeddings_in_job_scope($HYDE_INPUT)\n }\n step Summarize {\n $CONNECTOR = \"\\nLeverage the following information to answer the previous query: --- start ---\"\n $NEW_INPUT = call concat($INPUT, $CONNECTOR, $EMBEDDINGS) \n $RESULT = call inference($NEW_INPUT)\n }\n } @@official.shinkai\n ","description":"Generates a passage to answer a question and uses embeddings to refine the answer.","author":"@@official.shinkai","sticky":false},"embedding":{"id":"","vector":[-0.04964948445558548,0.07351528108119965,-0.0037448257207870483,-0.5989986658096313,-0.2695397734642029,0.0556429848074913,-0.8189688920974731,0.17371350526809692,-0.042529553174972534,-0.278947651386261,-0.1592383086681366,0.7632817625999451,-0.15512093901634216,0.5815573930740356,0.40833333134651184,0.08403884619474411,0.10889555513858795,-0.09859824180603027,-1.4305481910705566,-0.36282309889793396,0.26563403010368347,0.5795038938522339,0.6247695684432983,0.09672331809997559,0.2193397581577301,-0.3369952440261841,0.45206624269485474,-0.20352067053318024,-0.8568096160888672,-1.5192517042160034,0.45000338554382324,0.1857410967350006,-0.5474480986595154,-0.6226603984832764,-0.3259250521659851,-0.8049982786178589,0.41149431467056274,-0.33869048953056335,-0.40478962659835815,0.14186139404773712,0.08049512654542923,0.12524786591529846,0.05503413826227188,0.5369344353675842,0.22099512815475464,-0.22166168689727783,0.49372294545173645,0.14834408462047577,0.7515535950660706,0.23170407116413116,-0.38584038615226746,-0.6664334535598755,0.08026009798049927,0.05644957721233368,-0.47618070244789124,-0.07221367955207825,-0.013390932232141495,-0.7227036356925964,0.2766876816749573,-0.2050083577632904,0.0018085697665810585,0.36839884519577026,-4.047801494598389,0.25997495651245117,0.6095144748687744,0.29139724373817444,0.1967528611421585,0.33130836486816406,0.10284334421157837,0.6389473080635071,0.3290032148361206,0.469316303730011,-0.6486641764640808,0.9727193713188171,0.1883121132850647,-0.33047881722450256,-0.36619096994400024,0.22055767476558685,0.3932532072067261,-0.5142701864242554,-0.008600234985351562,0.1599426567554474,-0.09545424580574036,0.23433077335357666,-0.042303428053855896,0.7357178926467896,-0.32235464453697205,0.08163000643253326,0.14104235172271729,-0.11884527653455734,-0.03371256962418556,0.0557616725564003,0.3496687710285187,-0.03216787800192833,-0.003476671874523163,0.3798062205314636,0.03774901106953621,0.20039451122283936,-0.3984847366809845,3.36946439743042,-0.13239504396915436,0.001673419028520584,0.7380388379096985,-0.30677103996276855,0.9782622456550598,-0.19148962199687958,-0.3291283845901489,-0.27219173312187195,0.11630738526582718,-0.3731819987297058,0.2829224765300751,-0.5195115208625793,-0.707719087600708,0.13076543807983398,0.09487534314393997,0.3715026080608368,-0.21381931006908417,0.06631460785865784,0.1631127893924713,0.6596425771713257,-0.34905654191970825,0.4622417092323303,-0.2369920015335083,-0.4202103316783905,-0.5958117246627808,-0.0054769366979599,0.05269158259034157,0.3168359696865082,-0.42596322298049927,-0.2948320209980011,0.19625362753868103,0.3843995928764343,-0.7386986017227173,0.29027774930000305,0.38638198375701904,0.398516982793808,0.5393836498260498,-0.7760148644447327,0.026768285781145096,-0.6783398985862732,0.3489813208580017,-1.9833325147628784,0.42915868759155273,-0.3807029724121094,0.7297704219818115,-0.3749578893184662,-0.988932728767395,-0.049560628831386566,-0.748236894607544,-0.39161738753318787,-0.07422567903995514,0.7568775415420532,-0.42796590924263,-0.6895531415939331,0.7455142736434937,0.3727438449859619,-0.302215039730072,-0.2940479516983032,-0.39270395040512085,0.48044177889823914,-0.45199188590049744,0.012708820402622223,-0.014463722705841064,0.38177770376205444,0.41518479585647583,-0.26775816082954407,0.0609671026468277,0.259851336479187,0.5660082101821899,0.28002557158470154,0.2567088007926941,0.08408413827419281,-0.17901833355426788,0.6893192529678345,-0.18076415359973907,-0.1638849675655365,0.7592079639434814,-0.2850896716117859,0.09555481374263763,-0.34255003929138184,0.21607792377471924,0.6083880066871643,-0.27518394589424133,-0.2888985574245453,0.4869835376739502,0.24507123231887817,-0.04523368924856186,0.08955748379230499,0.8814894556999207,0.7514408826828003,-0.7933105826377869,1.4745051860809326,-0.8296284675598145,0.20127254724502563,-0.17663174867630005,0.10280756652355194,0.7590713500976562,0.6627715826034546,0.011114057153463364,-0.21741513907909393,-0.2958572506904602,-0.07200832664966583,-0.028994381427764893,-0.11766113340854645,-0.29194989800453186,-0.8990501165390015,0.22843225300312042,0.3628116250038147,-0.7341636419296265,-0.3731664717197418,-0.16071830689907074,-0.0289015993475914,0.7402246594429016,0.38305380940437317,0.8563412427902222,0.43994849920272827,0.30292415618896484,-0.22889143228530884,0.16537168622016907,0.7458362579345703,0.012104399502277374,-0.15416470170021057,-0.14556102454662323,-0.748606264591217,-0.5879684686660767,0.3174847364425659,-0.35950881242752075,-0.18004687130451202,-0.31736502051353455,-0.17857733368873596,0.23575669527053833,0.9159373044967651,0.2646183967590332,1.1622544527053833,0.6009469628334045,-0.020364172756671906,0.005769722163677216,0.3249523639678955,0.10982750356197357,-0.18247875571250916,-0.018897704780101776,-0.3283432722091675,0.06723657250404358,-0.18632438778877258,0.016186058521270752,-0.299119770526886,0.27416902780532837,-0.4262268543243408,-0.17139290273189545,1.6794452667236328,0.958503246307373,0.46273133158683777,0.3776611387729645,0.4485767185688019,0.4364531934261322,0.14672908186912537,-1.850408911705017,0.0067354487255215645,-0.7456330060958862,0.5802070498466492,0.3341884911060333,-0.7816597819328308,0.8321707248687744,-0.13638745248317719,-0.02185065858066082,-0.4651019871234894,-0.46033725142478943,-0.7211554050445557,-0.36014968156814575,-0.14086481928825378,-0.5944161415100098,0.8056583404541016,-0.7071620225906372,0.3785657584667206,-0.332245409488678,-0.09814120084047318,0.4233565926551819,0.015407413244247437,-0.33447521924972534,-0.4071231186389923,-0.067552350461483,-0.013831926509737968,0.16377918422222137,0.4718702435493469,-0.27083900570869446,-0.020545989274978638,-0.7419271469116211,-0.41673678159713745,-0.10136746615171432,0.2697226405143738,-0.28535905480384827,-0.3748951554298401,-0.7390844821929932,0.034545667469501495,1.644720435142517,-0.009804271161556244,-0.3737269937992096,0.5042737722396851,0.20176424086093903,-0.45157724618911743,-0.029246389865875244,-0.25737810134887695,-0.16420505940914154,0.39507946372032166,-0.6092503666877747,-0.547132134437561,0.49879688024520874,0.050793204456567764,-0.42933282256126404,-0.6348257064819336,-0.5210633873939514,-0.01414722204208374,0.241664320230484,0.07189908623695374,0.6878603100776672,-0.44729337096214294,0.6146893501281738,0.3114408254623413,0.09885749220848083,-2.39998459815979,0.22510097920894623,0.08821532130241394,0.02281942591071129,-0.16851471364498138,-0.39948421716690063,0.4781944751739502,-0.1106119155883789,0.37788909673690796,-0.5341840386390686,1.6657711267471313,0.23619230091571808,-0.16936853528022766,-0.34403157234191895,-0.05048051103949547,0.5156921148300171,-0.5097588300704956,-0.1076057031750679,0.16615211963653564,-0.41826316714286804,-0.09777717292308807,0.4317220151424408,1.4926064014434814,0.4437429904937744,0.6409068703651428,-0.2857368588447571,0.4252455234527588,-0.4507920742034912,-1.395687222480774,0.32343316078186035,-0.14300259947776794,0.17345699667930603,0.6882900595664978,-0.031068190932273865,-0.014234764501452446,0.2588723599910736,0.6380057334899902,-0.10916788876056671,0.21145275235176086,0.41304823756217957,1.875705361366272,0.30104920268058777,-0.14842073619365692,-0.4808446764945984,-0.3084228038787842,-0.2934291660785675,0.12193095684051514,0.18131327629089355,-0.632544219493866,0.30189579725265503,0.13330793380737305,0.1023193746805191,-0.14311614632606506,0.4220004975795746,0.20342287421226501,0.7711853981018066,0.04235168173909187,-0.061884328722953796,1.1321145296096802,-0.16180944442749023,0.008948512375354767,-0.0014485716819763184,-0.1739363670349121,-0.3506462275981903,-0.4292738437652588]}},true]},{"type":"Workflow","content":[{"workflow":{"name":"baml_answer_with_citations","version":"v0.1","steps":[{"name":"Initialize","body":[{"type":"composite","value":[{"type":"registeroperation","value":{"register":"$DSL","value":"class Citation {\n citation_id int\n document_reference string @description(#\\\"The name of the document and the page number that supports the answer e.g., FILENAME: Page [PAGE NUMBER]. This is a reference. You must mention it NO MATTER WHAT.\\\"#)\n relevantTextFromDocument string @alias(\\\"relevantSentenceFromDocument\\\") @description(#\\\"The relevant text from the document that supports the answer. This is part of the citation. You must quote it EXACTLY as it appears in the document with any special characters it contains. You may cite a part of the sentence. The text should be contiguous and not broken up. You may NOT summarize or skip sentences. If you need to skip a sentence, start a new citation instead.\\\"#)\n }\n\n class Answer {\n answersInText Citation[] @alias(\\\"relevantSentencesFromText\\\")\n answer AnswerWithCitations @description(#\\\"An answer to the user's question that MUST cite sources from the relevantSentencesFromText. Like [0]. If multiple citations are needed, write them like [0][1][2].\\\"#)\n }\n\n class AnswerWithCitations {\n brief_introduction Paragraph @description(#\\\"3-4 long sentences. Must use the citations in the text.\\\"#)\n extensive_body Paragraph[] @description(#\\\"At least 3-6 long sentences. The more the better. Must use the citations in the text.\\\"#)\n conclusion Paragraph[] @description(#\\\"1-3 long sentences. Must use the citations in the text.\\\"#)\n }\n\n class Paragraph {\n sentences string[]\n }\n\n class Document {\n file string\n text string\n reference string\n }\n class Context {\n documents Document[]\n question string\n }\n\n function AnswerQuestion(context: Context) -> Answer {\n client ShinkaiProvider\n\n prompt #\\\"\n Out of the given content, do your best to answer the question.\n\n CONTEXT:\n {% for document in context.documents %}\n ----\n DOCUMENT NAME: {{ document.file }}\n PARTIAL TEXT: {{ document.text }}\n DOCUMENT REFERENCE: {{ document.reference }}\n ---\n {% endfor %}\n \n {{ ctx.output_format }}\n\n QUESTION: {{ context.question }}. Citing the references no matter what e.g., [0]. If multiple citations are needed, write them like [0][1][2].\n\n ANSWER:\n {{ _.role(\\\"user\\\") }}\n \\\"#\n }"}},{"type":"registeroperation","value":{"register":"$PARAM","value":"context"}},{"type":"registeroperation","value":{"register":"$FUNCTION","value":"AnswerQuestion"}},{"type":"registeroperation","value":{"register":"$RESULT","value":{"name":"baml_inference","args":[{"type":"register","value":"$INPUT"},{"type":"string","value":""},{"type":"string","value":""},{"type":"register","value":"$DSL"},{"type":"register","value":"$FUNCTION"},{"type":"register","value":"$PARAM"}]}}}]}]}],"raw":"\n workflow baml_answer_with_citations v0.1 {\n step Initialize {\n $DSL = \"class Citation {\n citation_id int\n document_reference string @description(#\\\"The name of the document and the page number that supports the answer e.g., FILENAME: Page [PAGE NUMBER]. This is a reference. You must mention it NO MATTER WHAT.\\\"#)\n relevantTextFromDocument string @alias(\\\"relevantSentenceFromDocument\\\") @description(#\\\"The relevant text from the document that supports the answer. This is part of the citation. You must quote it EXACTLY as it appears in the document with any special characters it contains. You may cite a part of the sentence. The text should be contiguous and not broken up. You may NOT summarize or skip sentences. If you need to skip a sentence, start a new citation instead.\\\"#)\n }\n\n class Answer {\n answersInText Citation[] @alias(\\\"relevantSentencesFromText\\\")\n answer AnswerWithCitations @description(#\\\"An answer to the user's question that MUST cite sources from the relevantSentencesFromText. Like [0]. If multiple citations are needed, write them like [0][1][2].\\\"#)\n }\n\n class AnswerWithCitations {\n brief_introduction Paragraph @description(#\\\"3-4 long sentences. Must use the citations in the text.\\\"#)\n extensive_body Paragraph[] @description(#\\\"At least 3-6 long sentences. The more the better. Must use the citations in the text.\\\"#)\n conclusion Paragraph[] @description(#\\\"1-3 long sentences. Must use the citations in the text.\\\"#)\n }\n\n class Paragraph {\n sentences string[]\n }\n\n class Document {\n file string\n text string\n reference string\n }\n class Context {\n documents Document[]\n question string\n }\n\n function AnswerQuestion(context: Context) -> Answer {\n client ShinkaiProvider\n\n prompt #\\\"\n Out of the given content, do your best to answer the question.\n\n CONTEXT:\n {% for document in context.documents %}\n ----\n DOCUMENT NAME: {{ document.file }}\n PARTIAL TEXT: {{ document.text }}\n DOCUMENT REFERENCE: {{ document.reference }}\n ---\n {% endfor %}\n \n {{ ctx.output_format }}\n\n QUESTION: {{ context.question }}. Citing the references no matter what e.g., [0]. If multiple citations are needed, write them like [0][1][2].\n\n ANSWER:\n {{ _.role(\\\"user\\\") }}\n \\\"#\n }\"\n $PARAM = \"context\"\n $FUNCTION = \"AnswerQuestion\"\n $RESULT = call baml_inference($INPUT, \"\", \"\", $DSL, $FUNCTION, $PARAM)\n }\n } @@official.shinkai\n ","description":"Generates an answer to a question with citations from the provided content using BAML. The answer includes quotes from the content as citations.","author":"@@official.shinkai","sticky":false},"embedding":{"id":"","vector":[0.3797622621059418,0.055756017565727234,-0.3101310729980469,-0.1303926408290863,-0.2349807769060135,-0.3620940148830414,-1.4513840675354004,0.4004634618759155,-0.09126128256320953,-0.2862396240234375,-0.21521227061748505,0.5031366348266602,0.5290755033493042,-0.1413222849369049,0.6188375949859619,0.38532504439353943,-0.11255966126918793,-0.5313267707824707,-1.018203854560852,0.16118848323822021,0.38974928855895996,0.26705488562583923,0.7251760363578796,0.3977380394935608,-0.11609482020139694,0.06196017935872078,0.13894720375537872,-0.2236107438802719,-1.2703726291656494,-1.2511805295944214,0.48944661021232605,0.2941161096096039,-0.36227738857269287,-0.2411549985408783,-0.49036508798599243,-0.4147837460041046,0.3464353680610657,-0.19157636165618896,-0.10052890330553055,0.33582234382629395,-0.34775447845458984,0.04653438180685043,0.608782172203064,-0.3258453607559204,-0.12086259573698044,-0.3823518753051758,1.0109241008758545,-0.23640067875385284,0.7499700784683228,0.8023027181625366,-0.3843623101711273,-0.3905274569988251,0.27414560317993164,0.29860666394233704,-0.4371856153011322,0.23716586828231812,0.04210366681218147,0.3562734127044678,-0.331453800201416,0.11200998723506927,0.37262940406799316,-0.3658697307109833,-3.935379981994629,0.14438453316688538,0.6308651566505432,0.21387910842895508,0.28002044558525085,-0.16130675375461578,-0.8150539994239807,-0.4389743506908417,-0.06972597539424896,-0.5424433946609497,-0.7765288949012756,0.5558378100395203,0.3599364161491394,-0.4887274503707886,-0.0007520616054534912,0.05174863338470459,0.590337872505188,-0.384021520614624,-0.053891345858573914,0.3669104278087616,-0.2317630499601364,0.25666916370391846,-0.7620011568069458,0.30930858850479126,-0.21822401881217957,-0.643441379070282,0.44276541471481323,0.660913348197937,-0.4575757086277008,-0.2502431869506836,0.15478183329105377,0.38664811849594116,-0.08887406438589096,0.2539937496185303,-0.03916637599468231,-0.5154840350151062,0.5459664463996887,2.9898178577423096,0.2672237455844879,-0.37507301568984985,0.8107877373695374,-0.5531704425811768,0.7260451912879944,-0.15623879432678223,0.3055795431137085,0.1754366159439087,0.09581713378429413,0.44947704672813416,0.31352749466896057,-0.28868404030799866,-0.5385019779205322,0.33680713176727295,-0.21201713383197784,0.7001216411590576,-0.7345210313796997,0.1426507532596588,0.11188594251871109,0.6378754377365112,0.36010265350341797,0.19299772381782532,-0.19160330295562744,-0.1184423640370369,0.14750339090824127,0.23624475300312042,0.017083611339330673,0.2653906047344208,0.2514684498310089,0.19559024274349213,0.5418351888656616,0.1569286286830902,-0.7294088006019592,0.328125923871994,0.02290940470993519,0.16350258886814117,1.043413758277893,-1.032653570175171,0.9681538343429565,-0.8715519309043884,0.21746881306171417,-1.6401642560958862,0.9072688221931458,0.3240673542022705,0.19921818375587463,-0.22009170055389404,-1.024997353553772,0.3806820213794708,-0.39549684524536133,-0.42126455903053284,-0.37500330805778503,0.12471919506788254,-0.46238279342651367,-0.11431951820850372,0.43173450231552124,-0.08136603981256485,-0.7753247022628784,-0.15560556948184967,-0.20577538013458252,0.16913741827011108,-0.24217629432678223,-0.3097689747810364,0.6912097334861755,-0.46705949306488037,-0.23456573486328125,-0.19368106126785278,-0.026194050908088684,0.29294338822364807,0.20618201792240143,0.038728564977645874,-0.313559353351593,-0.3366357088088989,0.00509969238191843,1.1993379592895508,0.15553726255893707,-0.14727765321731567,0.2659122943878174,-0.15252447128295898,0.7438075542449951,-0.1947561800479889,0.5643417239189148,0.5989380478858948,-0.6331312656402588,-0.3168948292732239,-0.23661555349826813,0.7672645449638367,0.46782436966896057,0.2681032121181488,1.418749451637268,1.2327861785888672,-0.46809977293014526,0.8014423847198486,-0.5430251359939575,-0.3643764853477478,0.15952736139297485,0.19020645320415497,0.7295116782188416,-0.0844498723745346,1.010969638824463,0.24072204530239105,0.3357287049293518,0.020911354571580887,0.2755776643753052,0.02969147264957428,-0.01337328553199768,-0.7969410419464111,-0.47564974427223206,0.5079171061515808,-0.5863653421401978,-0.7805141806602478,-0.10677085816860199,-0.8892369270324707,0.7942572236061096,0.6627474427223206,0.47531434893608093,0.3589997887611389,-0.15228474140167236,-0.10162676870822906,-0.11354662477970123,0.2639334201812744,0.07278834283351898,-0.48128312826156616,-0.8211566805839539,-0.2795396149158478,-0.7236523628234863,0.352206289768219,0.01859442889690399,-0.08775120973587036,-0.22070738673210144,-0.48127979040145874,0.36574625968933105,1.7433961629867554,0.982549786567688,1.0124894380569458,0.7370933890342712,0.4407808184623718,-0.21980562806129456,-0.13790135085582733,0.5385861396789551,-0.4323239326477051,-0.2465112805366516,-0.22517752647399902,-0.0271136611700058,0.26054584980010986,0.44240519404411316,-0.9002771377563477,0.22551384568214417,-0.5237748026847839,0.08540594577789307,1.3925650119781494,0.2770116627216339,-0.5225498676300049,0.44990918040275574,-0.1984628587961197,-0.12113264948129654,0.3022267520427704,-1.8065658807754517,-0.3099088966846466,-0.6861429214477539,0.7306676506996155,-0.30434128642082214,-0.2812166213989258,0.7118960618972778,0.04537050053477287,-0.39949703216552734,-0.9633961915969849,-0.8368886113166809,-1.018973708152771,-0.23503834009170532,-0.07855327427387238,-0.4439423978328705,1.099806547164917,-0.6865937113761902,-0.19636347889900208,0.16010379791259766,0.4755159914493561,0.8275705575942993,0.3734543025493622,-0.19382072985172272,-1.1013609170913696,0.4655303955078125,-0.4615223705768585,0.029980260878801346,-0.12803228199481964,-0.6200829744338989,-0.22082911431789398,-0.6129460334777832,-0.440936803817749,-0.12251780182123184,0.25749075412750244,-0.21793797612190247,-0.31565356254577637,-1.0452193021774292,0.48470351099967957,1.489746332168579,0.34717267751693726,-0.11593799293041229,0.5712113380432129,0.37145087122917175,-0.1405247449874878,0.10602741688489914,0.44691920280456543,0.2407248467206955,0.1857607066631317,-0.4698955714702606,-0.6073989272117615,0.003017023205757141,-0.692069411277771,-0.056892529129981995,0.2016339898109436,-0.6986490488052368,-0.4357801079750061,-0.3368676006793976,-0.21542751789093018,0.16499149799346924,-0.49468180537223816,0.7049293518066406,0.35484278202056885,-0.12084715068340302,-2.1006436347961426,0.17676638066768646,1.0268604755401611,-0.1937757432460785,-0.3107340335845947,-0.12163938581943512,0.4608701467514038,-0.5104370713233948,0.41666844487190247,-0.25553765892982483,1.501641869544983,0.391608864068985,-0.5072856545448303,-0.3386199176311493,0.35516029596328735,0.4765162467956543,-0.1931939572095871,-0.04903487116098404,-0.11199391633272171,-0.31363174319267273,-0.16184554994106293,1.0071266889572144,1.2638416290283203,1.3507024049758911,0.7613588571548462,0.4123046398162842,0.2764201760292053,-0.6620365977287292,-0.957791805267334,0.1179533302783966,0.05718009173870087,-0.5120300054550171,0.683925211429596,-0.38944295048713684,-0.40000054240226746,-0.1454511433839798,0.30291903018951416,-0.36079010367393494,-0.48647207021713257,0.13034778833389282,1.8149853944778442,0.11981132626533508,-0.16857168078422546,0.27804651856422424,-0.248652383685112,-0.22382158041000366,-0.02025716006755829,0.23994572460651398,-0.38804712891578674,0.15800036489963531,-0.7771037817001343,0.3905825614929199,-0.7868342995643616,-0.009819000959396362,-0.2602401375770569,0.5894878506660461,0.41537952423095703,0.20397962629795074,0.858824610710144,0.4924372136592865,-0.09800249338150024,0.33428242802619934,-0.15497006475925446,-0.18699677288532257,-0.10839053988456726]}},false]},{"type":"Workflow","content":[{"workflow":{"name":"answer_with_citations_workflow","version":"v0.1","steps":[{"name":"Initialize","body":[{"type":"composite","value":[{"type":"registeroperation","value":{"register":"$FILE_PIECES","value":{"name":"process_embeddings_in_job_scope_with_metadata","args":[]}}},{"type":"registeroperation","value":{"register":"$LLM_INPUT","value":{"name":"generate_json_map","args":[{"type":"string","value":"question"},{"type":"register","value":"$INPUT"},{"type":"string","value":"documents"},{"type":"register","value":"$FILE_PIECES"}]}}},{"type":"registeroperation","value":{"register":"$LLM_RESPONSE","value":{"name":"baml_answer_with_citations","args":[{"type":"register","value":"$LLM_INPUT"}]}}},{"type":"registeroperation","value":{"register":"$JINJA","value":"# Introduction\\n{%- for sentence in answer.brief_introduction.sentences %}\\n{{ sentence }}\\n{%- endfor %}\\n\\n# Body\\n{%- for section in answer.extensive_body %}\\n## Section {{ loop.index }}\\n{%- for sentence in section.sentences %}\\n{{ sentence }}\\n{%- endfor %}\\n{%- endfor %}\\n\\n# Conclusion\\n{%- for section in answer.conclusion %}\\n{{ section.sentences[0] }}\\n{%- endfor %}\\n\\n# Citations\\n{%- for citation in relevantSentencesFromText %}\\n[{{ citation.citation_id }}]: {{ citation.relevantSentenceFromDocument }}\\n{%- endfor %}"}},{"type":"registeroperation","value":{"register":"$RESULT","value":{"name":"shinkai__json-to-md","args":[{"type":"string","value":"message"},{"type":"register","value":"$LLM_RESPONSE"},{"type":"string","value":"template"},{"type":"register","value":"$JINJA"}]}}}]}]}],"raw":"\n workflow answer_with_citations_workflow v0.1 {\n step Initialize {\n $FILE_PIECES = call process_embeddings_in_job_scope_with_metadata()\n $LLM_INPUT = call generate_json_map(\"question\", $INPUT, \"documents\", $FILE_PIECES)\n $LLM_RESPONSE = call baml_answer_with_citations($LLM_INPUT)\n $JINJA = \"# Introduction\\n{%- for sentence in answer.brief_introduction.sentences %}\\n{{ sentence }}\\n{%- endfor %}\\n\\n# Body\\n{%- for section in answer.extensive_body %}\\n## Section {{ loop.index }}\\n{%- for sentence in section.sentences %}\\n{{ sentence }}\\n{%- endfor %}\\n{%- endfor %}\\n\\n# Conclusion\\n{%- for section in answer.conclusion %}\\n{{ section.sentences[0] }}\\n{%- endfor %}\\n\\n# Citations\\n{%- for citation in relevantSentencesFromText %}\\n[{{ citation.citation_id }}]: {{ citation.relevantSentenceFromDocument }}\\n{%- endfor %}\"\n \n $RESULT = call shinkai__json-to-md(\"message\",$LLM_RESPONSE,\"template\",$JINJA)\n }\n } @@official.shinkai\n ","description":"Generates an answer to a question with citations from the provided content using RAG workflow.","author":"@@official.shinkai","sticky":false},"embedding":{"id":"","vector":[0.302041232585907,0.6495791673660278,-0.16463279724121094,0.27348119020462036,-0.3640792667865753,-0.11759210377931595,-1.3377487659454346,0.2906632423400879,0.2659119963645935,0.0064449855126440525,-0.2225845754146576,0.7155923247337341,0.2863701581954956,0.013627946376800537,0.37820589542388916,0.4598727524280548,-0.10306946933269501,-0.6235101819038391,-1.3434779644012451,0.01579219475388527,0.563793957233429,0.4702529311180115,0.24035745859146118,0.08729343116283417,-0.1935933530330658,0.4073832631111145,0.22304141521453857,-0.16020876169204712,-1.2370494604110718,-1.8152098655700684,0.32133832573890686,0.5529523491859436,-0.47941479086875916,-0.2894234359264374,-0.22529128193855286,-0.6637700796127319,0.038934219628572464,-0.11896584928035736,-0.6196734309196472,0.3092517852783203,-0.017506450414657593,0.29310837388038635,0.2966788709163666,0.11765111237764359,0.5300358533859253,-0.6917188167572021,0.4312555491924286,-0.34250134229660034,0.3841196596622467,0.25088948011398315,-0.7944143414497375,-0.686835527420044,0.4505968391895294,0.30513784289360046,-0.24635744094848633,0.22689467668533325,0.5774812698364258,-0.17809458076953888,0.3844796121120453,-0.10836978256702423,0.4342154264450073,0.08909395337104797,-4.313159465789795,0.42584100365638733,0.14493651688098907,0.08237434923648834,0.3053835928440094,-0.2510621249675751,-0.26908355951309204,0.05084872245788574,-0.20760825276374817,-0.2481420487165451,-0.20238164067268372,0.025295820087194443,0.051211945712566376,-0.30147409439086914,-0.2935594916343689,-0.11286266148090363,0.3743446469306946,-0.5593183636665344,-0.17406244575977325,0.6305493712425232,-0.05546174198389053,-0.06269138306379318,-0.7509041428565979,0.3297814726829529,-0.4034028947353363,-0.2742491364479065,0.34146708250045776,0.5505414009094238,-0.5094859600067139,-0.09207914769649506,0.3118738830089569,-0.27273064851760864,-0.351421594619751,0.12499718368053436,0.02875395491719246,0.37674230337142944,0.3279470205307007,3.104065179824829,0.1853073239326477,-0.6978022456169128,0.8353964686393738,-0.6210517287254333,0.299731969833374,-0.2903611361980438,0.34038618206977844,-0.16563871502876282,0.27116236090660095,0.6264962553977966,0.3312639594078064,-0.5524058938026428,-0.25126639008522034,0.48475781083106995,0.27730247378349304,0.22434116899967194,-0.5458792448043823,0.20768611133098602,-0.3331827223300934,1.0173496007919312,-0.048498235642910004,-0.07441143691539764,-0.47644293308258057,-0.37685298919677734,0.2681230902671814,0.27811694145202637,0.027686040848493576,0.14175771176815033,0.3515598177909851,0.43409720063209534,0.5166351795196533,-0.4411574900150299,-0.823940634727478,-0.2513667643070221,-0.3378399610519409,0.3593744933605194,1.012085199356079,-0.8341009616851807,0.41486555337905884,-0.8454400897026062,0.045630961656570435,-1.0219558477401733,0.6480528116226196,-0.022864188998937607,0.5243897438049316,-0.09312224388122559,-0.7185470461845398,0.454501748085022,-0.5255737900733948,-0.05204040929675102,-0.3932226300239563,0.21987518668174744,-0.18833470344543457,0.1750001460313797,0.7764050960540771,-0.08508025854825974,-0.4201195240020752,-0.027372032403945923,-0.5477855801582336,0.5084601044654846,-0.27074211835861206,-0.3358495533466339,0.37030738592147827,-0.1664036065340042,0.30039411783218384,-0.16436031460762024,0.26987943053245544,-0.07586002349853516,0.20720936357975006,-0.33640843629837036,0.14486727118492126,-0.058277927339076996,0.08135819435119629,0.6479024887084961,-0.39269688725471497,0.25529712438583374,0.09676061570644379,0.03970225900411606,-0.0051755160093307495,-0.3197023868560791,0.7519499659538269,0.39787548780441284,-0.5427854061126709,-0.2278692126274109,-0.13041603565216064,0.7266638278961182,0.39746806025505066,0.35260921716690063,0.8904515504837036,0.9481697082519531,-0.534455418586731,1.077448844909668,-0.4851692318916321,0.09174691140651703,0.40167665481567383,0.011938601732254028,0.209327831864357,0.19621434807777405,0.9554470777511597,-0.17806030809879303,0.4127517342567444,0.34222567081451416,0.34531280398368835,0.0028178244829177856,0.08940697461366653,-0.48655739426612854,-0.11633729934692383,0.4609406292438507,-0.5707967281341553,-0.7172647714614868,-0.15549525618553162,-0.6388192176818848,0.9782460927963257,0.5757883191108704,0.4868878126144409,0.5279903411865234,-0.03237190097570419,-0.2205381691455841,0.16652852296829224,0.643582284450531,-0.2677132189273834,0.06080951169133186,-0.13484515249729156,-0.4923725724220276,-0.516819179058075,0.6620203852653503,0.07592541724443436,0.07159370183944702,0.06254155933856964,-0.5057934522628784,0.0764768123626709,1.0371267795562744,0.624696671962738,1.128337025642395,0.6512643098831177,0.3021669387817383,-0.4556947946548462,0.05481366068124771,0.30271732807159424,-0.613541305065155,0.12894059717655182,-0.10522378981113434,0.21463046967983246,-0.07597915828227997,0.36100587248802185,-0.7120083570480347,-0.252541184425354,-0.6509837508201599,0.09734252095222473,1.7409844398498535,0.018263503909111023,-0.38902392983436584,0.6623021960258484,0.26024848222732544,0.12274602800607681,0.2705548107624054,-1.983655333518982,-0.34808245301246643,-0.44870463013648987,0.8398820161819458,0.3027595579624176,-0.3285507261753082,0.8434791564941406,0.18463754653930664,-0.02081805095076561,-0.5282495617866516,-0.626075804233551,-0.9119731187820435,-0.0012827664613723755,-0.09766072779893875,-0.7564650774002075,0.7809023857116699,-0.6776382327079773,0.04063400253653526,-0.08290590345859528,0.14572179317474365,0.5667208433151245,0.3448168635368347,-0.5389902591705322,-0.8892549276351929,0.4638209342956543,-0.35105016827583313,-0.6134374141693115,0.05028517544269562,-0.3464180827140808,-0.25418758392333984,-0.7385156154632568,-0.05664042383432388,-0.23391547799110413,0.09158208966255188,-0.17262275516986847,-0.6692696213722229,-0.9896000623703003,0.6646811962127686,1.926600694656372,0.29630979895591736,0.04862155020236969,0.4683615267276764,0.31428056955337524,-0.5492845177650452,0.5060234665870667,0.14091579616069794,-0.30021777749061584,-0.13741666078567505,-0.7438650131225586,0.02209792286157608,0.4707602262496948,-0.4167380928993225,0.15437601506710052,0.48597821593284607,-0.5394192337989807,-0.09873858839273453,-0.10803239047527313,0.30014458298683167,0.3251103162765503,-0.39479196071624756,0.14275161921977997,0.3502808213233948,-0.34477901458740234,-2.357520818710327,0.013839280232787132,0.7088819146156311,-0.12972787022590637,-0.15496616065502167,-0.1557634323835373,0.5408610105514526,0.042263880372047424,0.21417298913002014,-0.45165085792541504,1.2327648401260376,0.5347790122032166,-0.3049626052379608,-0.43793389201164246,0.17141607403755188,0.9914730787277222,-0.23269782960414886,0.4983164072036743,-0.12929704785346985,-0.021774105727672577,-0.49563103914260864,0.6341679096221924,1.1403045654296875,0.5469133853912354,0.6069785356521606,-0.11656582355499268,0.21336913108825684,-0.5077071785926819,-1.2154546976089478,0.09518444538116455,0.06945158541202545,-0.6196871399879456,0.7504529356956482,-0.3938862979412079,-0.6696345806121826,-0.11530251801013947,0.42651259899139404,0.06762523949146271,-0.014222238212823868,-0.08163487166166306,1.8882081508636475,-0.18455733358860016,-0.29645416140556335,-0.11717289686203003,-0.2683551609516144,-0.560032069683075,0.3953476548194885,0.10460548102855682,-0.22123202681541443,0.167826309800148,-0.23793259263038635,0.37224283814430237,-0.7192226648330688,-0.13425150513648987,-0.3594304323196411,0.244207501411438,0.08292294293642044,0.3012055456638336,1.0009146928787231,0.4970721900463104,-0.14509020745754242,0.24888360500335693,-0.2440701127052307,-0.43989014625549316,0.009084545075893402]}},true]}]"###; +pub static WORKFLOWS_JSON_TESTING: &str = r###"[{"type":"Workflow","content":[{"workflow":{"name":"Extensive_summary","version":"v0.1","steps":[{"name":"Initialize","body":[{"type":"composite","value":[{"type":"registeroperation","value":{"register":"$PROMPT","value":"Summarize this: "}},{"type":"registeroperation","value":{"register":"$EMBEDDINGS","value":{"name":"process_embeddings_in_job_scope","args":[]}}}]}]},{"name":"Summarize","body":[{"type":"registeroperation","value":{"register":"$RESULT","value":{"name":"multi_inference","args":[{"type":"register","value":"$PROMPT"},{"type":"register","value":"$EMBEDDINGS"}]}}}]}],"raw":"\n workflow Extensive_summary v0.1 {\n step Initialize {\n $PROMPT = \"Summarize this: \"\n $EMBEDDINGS = call process_embeddings_in_job_scope()\n }\n step Summarize {\n $RESULT = call multi_inference($PROMPT, $EMBEDDINGS)\n }\n } @@official.shinkai\n ","description":"Reviews in depth all the content to generate a summary.","author":"@@official.shinkai","sticky":false},"embedding":{"id":"","vector":[0.6820248961448669,0.5723804831504822,0.056784410029649734,-0.029523666948080063,-0.2254689335823059,-0.053013481199741364,-0.6708416938781738,-0.2624345123767853,-0.033756330609321594,0.4013897180557251,-0.16321982443332672,0.971656858921051,0.2718249261379242,0.07108756899833679,0.2820807695388794,0.14116838574409485,-0.11496889591217041,-0.49301284551620483,-1.0789883136749268,-0.043452829122543335,0.19382520020008087,0.5948700308799744,0.6591302156448364,0.16274362802505493,-0.030279342085123062,-0.1913491189479828,-0.3163045048713684,-0.2898331880569458,-0.7694717645645142,-2.4501161575317383,0.5279894471168518,0.0053562745451927185,-0.5002804398536682,-0.5608552694320679,0.028381161391735077,-0.6834791302680969,0.328404039144516,0.2872193455696106,-0.27112722396850586,-0.2420305460691452,-0.20994114875793457,0.23660853505134583,-0.35357770323753357,0.590043306350708,0.27437782287597656,0.06486925482749939,-0.15818193554878235,-0.2542445659637451,0.3756386339664459,0.38245582580566406,-0.45134201645851135,-0.26646173000335693,-0.21188713610172272,0.5074135065078735,-0.45056354999542236,0.42795759439468384,-0.14764094352722168,-0.299643874168396,0.24885445833206177,0.021038610488176346,0.29774922132492065,0.527859091758728,-4.216637134552002,0.35374659299850464,0.19555260241031647,0.3751485049724579,0.17744454741477966,-0.2610761225223541,-0.172037273645401,0.032772570848464966,0.05567239597439766,0.19824181497097015,-0.13289085030555725,-0.1100323274731636,-0.23126265406608582,-0.34616896510124207,0.3950774073600769,0.35234352946281433,0.1308232843875885,-0.6239751577377319,-0.7391460537910461,0.4362350106239319,-0.0347885936498642,0.09445835649967194,-0.2117754966020584,0.7171225547790527,-0.3040316104888916,-0.3600367605686188,0.37041613459587097,-0.06581398844718933,-0.006318345665931702,-0.21981696784496307,-0.002286979928612709,0.2790469229221344,-0.7975400686264038,0.10219541937112808,0.15441451966762543,0.11658502370119095,0.4612636864185333,3.6136317253112793,0.6766623854637146,-0.28591224551200867,0.7045385241508484,-0.4960375726222992,0.1050494909286499,-0.5604535937309265,-0.25389742851257324,-0.2956107258796692,0.40285223722457886,-0.111656554043293,0.015156731009483337,-0.5351597666740417,-0.030287399888038635,0.3177969753742218,0.21704047918319702,0.7171976566314697,-0.46601396799087524,0.3439251184463501,-0.061566051095724106,0.20522497594356537,-0.6280752420425415,0.130172997713089,0.051850613206624985,0.21620029211044312,-0.2943073809146881,0.1809474229812622,-0.23445376753807068,0.2775576710700989,0.2914619445800781,0.0578656867146492,0.10241352021694183,-0.15168319642543793,-0.7568095326423645,0.092719167470932,-0.0777229368686676,-0.15893718600273132,0.5966013073921204,-0.7341698408126831,0.25946319103240967,-0.9252210259437561,0.09058776497840881,-1.5351767539978027,0.7115793824195862,0.29241278767585754,0.7798487544059753,-0.08018416166305542,-0.13354992866516113,-0.08928925544023514,-0.4238916337490082,-0.5697543025016785,0.06765686720609665,0.77348792552948,-0.04202955216169357,0.06487800180912018,0.5874587893486023,-0.11936471611261368,-0.25156763195991516,0.19140180945396423,-0.5563774108886719,0.31181517243385315,-0.32280847430229187,-0.15203385055065155,0.6281672716140747,0.6141714453697205,0.5077856183052063,-0.20541121065616608,0.334749698638916,-0.22992375493049622,0.3473362326622009,0.13209888339042664,-0.046164438128471375,-0.4251396954059601,0.33730384707450867,0.8212467432022095,0.177277609705925,-0.1610117256641388,-0.07467097789049149,0.2908981442451477,0.2191067337989807,-0.5679166316986084,0.7439255714416504,0.5261525511741638,-0.11653833091259003,-0.3659759759902954,-0.023860540241003036,-0.26393836736679077,0.42201778292655945,-0.21162325143814087,0.6553518176078796,0.7129044532775879,-0.8967499136924744,1.4437609910964966,-0.7139504551887512,-0.4562397301197052,0.1866864711046219,-0.1461351215839386,-0.5919792056083679,-0.022950291633605957,0.10381539165973663,0.28671005368232727,-0.5119964480400085,0.06818243861198425,-0.34842413663864136,-0.2360081672668457,-0.20727667212486267,-0.666267454624176,-0.2698496878147125,0.14760757982730865,-0.1733710914850235,-0.7490845322608948,0.17996001243591309,-0.1494026631116867,0.6294229030609131,0.6854228973388672,0.45075780153274536,0.16544346511363983,0.15525199472904205,0.40028688311576843,0.6559727787971497,0.5462879538536072,0.6049190759658813,-0.16969510912895203,-0.5258905291557312,-0.7370105385780334,-0.5058722496032715,0.05097363144159317,-0.4502354860305786,-0.16756923496723175,-0.3616001605987549,-0.07482671737670898,0.5364893674850464,0.3961637616157532,0.6380713582038879,0.7769057154655457,0.45226916670799255,0.12783251702785492,-0.06475261598825455,0.5124138593673706,0.2543259561061859,-0.3266713619232178,0.6652782559394836,-0.10381640493869781,-0.2858583927154541,0.369432270526886,0.4281133711338043,-0.397693008184433,-0.4147809147834778,-0.007397249341011047,-0.16696804761886597,1.8266067504882812,0.09511159360408783,-0.33791670203208923,0.20951442420482635,0.5353755950927734,0.4132263660430908,0.07172563672065735,-1.3672807216644287,0.033725690096616745,-0.6914818286895752,0.4152260720729828,-0.29042062163352966,0.2820392847061157,-0.12484639883041382,0.12444232404232025,-0.2538592219352722,-0.1376664787530899,-0.376803457736969,-0.21342863142490387,-0.3275066018104553,-0.1573990434408188,0.07955310493707657,0.7591940760612488,0.06325787305831909,-0.1243286207318306,-0.06205055117607117,0.27926522493362427,0.1881060153245926,-0.07187489420175552,-0.43998342752456665,-0.04985599219799042,0.35954052209854126,0.07155530899763107,0.37024304270744324,0.25004273653030396,-0.5525103211402893,-0.2558727264404297,-0.36321941018104553,0.04473167657852173,-0.09463290125131607,-0.01605386659502983,-0.21422991156578064,-0.40423282980918884,-0.07233521342277527,0.24171797931194305,1.5734977722167969,0.2532348036766052,0.3514263331890106,0.5783570408821106,0.38809657096862793,0.18779775500297546,-0.7362217903137207,0.018929127603769302,-0.2433643937110901,-0.1767692118883133,-0.6034640073776245,-0.2618042230606079,0.23901714384555817,0.25006982684135437,-0.3671899735927582,0.56818026304245,-0.45649564266204834,-0.5177562832832336,0.21355649828910828,0.04084805026650429,0.36265265941619873,-0.4912548065185547,0.3579895794391632,-0.06822404265403748,0.23526312410831451,-2.4479732513427734,-0.409572571516037,0.33847421407699585,0.39877307415008545,-0.31740933656692505,-0.13011762499809265,1.0355134010314941,-0.2030523419380188,0.004002278670668602,-0.17361848056316376,1.0097349882125854,0.3712850511074066,0.04738866910338402,-0.38382434844970703,-0.22995835542678833,0.10955353826284409,-0.5831428170204163,0.5505454540252686,-0.251912921667099,-0.6052247285842896,-0.11847558617591858,0.39012327790260315,1.722125768661499,0.4369223117828369,0.4068147540092468,-0.08888967335224152,0.16951988637447357,-0.7578551769256592,-1.5347665548324585,-0.09822624921798706,-0.1749330759048462,-0.40222880244255066,0.40935447812080383,-0.014797728508710861,-0.25942203402519226,0.7363397479057312,0.8023666143417358,0.1866847723722458,1.0114266872406006,-0.37116944789886475,1.44536292552948,-0.37696170806884766,-0.06581003218889236,0.011476762592792511,0.43547624349594116,0.33689627051353455,0.4570700526237488,-0.09152284264564514,-0.7278273105621338,-0.19184312224388123,-0.024527274072170258,0.5096248984336853,-0.4112659990787506,0.585030198097229,0.6007319092750549,0.13742738962173462,-0.0392843633890152,0.18517468869686127,0.4498704671859741,0.053321029990911484,0.055953219532966614,-0.3754947781562805,-0.2632603943347931,-0.8821566700935364,-0.5415434241294861]}},true]},{"type":"Workflow","content":[{"workflow":{"name":"Hyde_inference","version":"v0.1","steps":[{"name":"Initialize","body":[{"type":"composite","value":[{"type":"registeroperation","value":{"register":"$PROMPT","value":"write a passage to answer the question: "}},{"type":"registeroperation","value":{"register":"$HYDE_PROMPT","value":{"name":"concat","args":[{"type":"register","value":"$PROMPT"},{"type":"register","value":"$INPUT"}]}}},{"type":"registeroperation","value":{"register":"$HYDE_PASSAGE","value":{"name":"inference_no_ws","args":[{"type":"register","value":"$HYDE_PROMPT"}]}}},{"type":"registeroperation","value":{"register":"$HYDE_INPUT","value":{"name":"concat","args":[{"type":"register","value":"$INPUT"},{"type":"string","value":". "},{"type":"register","value":"$HYDE_PASSAGE"}]}}},{"type":"registeroperation","value":{"register":"$EMBEDDINGS","value":{"name":"search_embeddings_in_job_scope","args":[{"type":"register","value":"$HYDE_INPUT"}]}}}]}]},{"name":"Summarize","body":[{"type":"composite","value":[{"type":"registeroperation","value":{"register":"$CONNECTOR","value":"\\nLeverage the following information to answer the previous query: --- start ---"}},{"type":"registeroperation","value":{"register":"$NEW_INPUT","value":{"name":"concat","args":[{"type":"register","value":"$INPUT"},{"type":"register","value":"$CONNECTOR"},{"type":"register","value":"$EMBEDDINGS"}]}}},{"type":"registeroperation","value":{"register":"$RESULT","value":{"name":"inference","args":[{"type":"register","value":"$NEW_INPUT"}]}}}]}]}],"raw":"\n workflow Hyde_inference v0.1 {\n step Initialize {\n $PROMPT = \"write a passage to answer the question: \"\n $HYDE_PROMPT = call concat($PROMPT, $INPUT)\n $HYDE_PASSAGE = call inference_no_ws($HYDE_PROMPT)\n $HYDE_INPUT = call concat($INPUT, \". \", $HYDE_PASSAGE )\n $EMBEDDINGS = call search_embeddings_in_job_scope($HYDE_INPUT)\n }\n step Summarize {\n $CONNECTOR = \"\\nLeverage the following information to answer the previous query: --- start ---\"\n $NEW_INPUT = call concat($INPUT, $CONNECTOR, $EMBEDDINGS) \n $RESULT = call inference($NEW_INPUT)\n }\n } @@official.shinkai\n ","description":"Generates a passage to answer a question and uses embeddings to refine the answer.","author":"@@official.shinkai","sticky":false},"embedding":{"id":"","vector":[-0.04964948445558548,0.07351528108119965,-0.0037448257207870483,-0.5989986658096313,-0.2695397734642029,0.0556429848074913,-0.8189688920974731,0.17371350526809692,-0.042529553174972534,-0.278947651386261,-0.1592383086681366,0.7632817625999451,-0.15512093901634216,0.5815573930740356,0.40833333134651184,0.08403884619474411,0.10889555513858795,-0.09859824180603027,-1.4305481910705566,-0.36282309889793396,0.26563403010368347,0.5795038938522339,0.6247695684432983,0.09672331809997559,0.2193397581577301,-0.3369952440261841,0.45206624269485474,-0.20352067053318024,-0.8568096160888672,-1.5192517042160034,0.45000338554382324,0.1857410967350006,-0.5474480986595154,-0.6226603984832764,-0.3259250521659851,-0.8049982786178589,0.41149431467056274,-0.33869048953056335,-0.40478962659835815,0.14186139404773712,0.08049512654542923,0.12524786591529846,0.05503413826227188,0.5369344353675842,0.22099512815475464,-0.22166168689727783,0.49372294545173645,0.14834408462047577,0.7515535950660706,0.23170407116413116,-0.38584038615226746,-0.6664334535598755,0.08026009798049927,0.05644957721233368,-0.47618070244789124,-0.07221367955207825,-0.013390932232141495,-0.7227036356925964,0.2766876816749573,-0.2050083577632904,0.0018085697665810585,0.36839884519577026,-4.047801494598389,0.25997495651245117,0.6095144748687744,0.29139724373817444,0.1967528611421585,0.33130836486816406,0.10284334421157837,0.6389473080635071,0.3290032148361206,0.469316303730011,-0.6486641764640808,0.9727193713188171,0.1883121132850647,-0.33047881722450256,-0.36619096994400024,0.22055767476558685,0.3932532072067261,-0.5142701864242554,-0.008600234985351562,0.1599426567554474,-0.09545424580574036,0.23433077335357666,-0.042303428053855896,0.7357178926467896,-0.32235464453697205,0.08163000643253326,0.14104235172271729,-0.11884527653455734,-0.03371256962418556,0.0557616725564003,0.3496687710285187,-0.03216787800192833,-0.003476671874523163,0.3798062205314636,0.03774901106953621,0.20039451122283936,-0.3984847366809845,3.36946439743042,-0.13239504396915436,0.001673419028520584,0.7380388379096985,-0.30677103996276855,0.9782622456550598,-0.19148962199687958,-0.3291283845901489,-0.27219173312187195,0.11630738526582718,-0.3731819987297058,0.2829224765300751,-0.5195115208625793,-0.707719087600708,0.13076543807983398,0.09487534314393997,0.3715026080608368,-0.21381931006908417,0.06631460785865784,0.1631127893924713,0.6596425771713257,-0.34905654191970825,0.4622417092323303,-0.2369920015335083,-0.4202103316783905,-0.5958117246627808,-0.0054769366979599,0.05269158259034157,0.3168359696865082,-0.42596322298049927,-0.2948320209980011,0.19625362753868103,0.3843995928764343,-0.7386986017227173,0.29027774930000305,0.38638198375701904,0.398516982793808,0.5393836498260498,-0.7760148644447327,0.026768285781145096,-0.6783398985862732,0.3489813208580017,-1.9833325147628784,0.42915868759155273,-0.3807029724121094,0.7297704219818115,-0.3749578893184662,-0.988932728767395,-0.049560628831386566,-0.748236894607544,-0.39161738753318787,-0.07422567903995514,0.7568775415420532,-0.42796590924263,-0.6895531415939331,0.7455142736434937,0.3727438449859619,-0.302215039730072,-0.2940479516983032,-0.39270395040512085,0.48044177889823914,-0.45199188590049744,0.012708820402622223,-0.014463722705841064,0.38177770376205444,0.41518479585647583,-0.26775816082954407,0.0609671026468277,0.259851336479187,0.5660082101821899,0.28002557158470154,0.2567088007926941,0.08408413827419281,-0.17901833355426788,0.6893192529678345,-0.18076415359973907,-0.1638849675655365,0.7592079639434814,-0.2850896716117859,0.09555481374263763,-0.34255003929138184,0.21607792377471924,0.6083880066871643,-0.27518394589424133,-0.2888985574245453,0.4869835376739502,0.24507123231887817,-0.04523368924856186,0.08955748379230499,0.8814894556999207,0.7514408826828003,-0.7933105826377869,1.4745051860809326,-0.8296284675598145,0.20127254724502563,-0.17663174867630005,0.10280756652355194,0.7590713500976562,0.6627715826034546,0.011114057153463364,-0.21741513907909393,-0.2958572506904602,-0.07200832664966583,-0.028994381427764893,-0.11766113340854645,-0.29194989800453186,-0.8990501165390015,0.22843225300312042,0.3628116250038147,-0.7341636419296265,-0.3731664717197418,-0.16071830689907074,-0.0289015993475914,0.7402246594429016,0.38305380940437317,0.8563412427902222,0.43994849920272827,0.30292415618896484,-0.22889143228530884,0.16537168622016907,0.7458362579345703,0.012104399502277374,-0.15416470170021057,-0.14556102454662323,-0.748606264591217,-0.5879684686660767,0.3174847364425659,-0.35950881242752075,-0.18004687130451202,-0.31736502051353455,-0.17857733368873596,0.23575669527053833,0.9159373044967651,0.2646183967590332,1.1622544527053833,0.6009469628334045,-0.020364172756671906,0.005769722163677216,0.3249523639678955,0.10982750356197357,-0.18247875571250916,-0.018897704780101776,-0.3283432722091675,0.06723657250404358,-0.18632438778877258,0.016186058521270752,-0.299119770526886,0.27416902780532837,-0.4262268543243408,-0.17139290273189545,1.6794452667236328,0.958503246307373,0.46273133158683777,0.3776611387729645,0.4485767185688019,0.4364531934261322,0.14672908186912537,-1.850408911705017,0.0067354487255215645,-0.7456330060958862,0.5802070498466492,0.3341884911060333,-0.7816597819328308,0.8321707248687744,-0.13638745248317719,-0.02185065858066082,-0.4651019871234894,-0.46033725142478943,-0.7211554050445557,-0.36014968156814575,-0.14086481928825378,-0.5944161415100098,0.8056583404541016,-0.7071620225906372,0.3785657584667206,-0.332245409488678,-0.09814120084047318,0.4233565926551819,0.015407413244247437,-0.33447521924972534,-0.4071231186389923,-0.067552350461483,-0.013831926509737968,0.16377918422222137,0.4718702435493469,-0.27083900570869446,-0.020545989274978638,-0.7419271469116211,-0.41673678159713745,-0.10136746615171432,0.2697226405143738,-0.28535905480384827,-0.3748951554298401,-0.7390844821929932,0.034545667469501495,1.644720435142517,-0.009804271161556244,-0.3737269937992096,0.5042737722396851,0.20176424086093903,-0.45157724618911743,-0.029246389865875244,-0.25737810134887695,-0.16420505940914154,0.39507946372032166,-0.6092503666877747,-0.547132134437561,0.49879688024520874,0.050793204456567764,-0.42933282256126404,-0.6348257064819336,-0.5210633873939514,-0.01414722204208374,0.241664320230484,0.07189908623695374,0.6878603100776672,-0.44729337096214294,0.6146893501281738,0.3114408254623413,0.09885749220848083,-2.39998459815979,0.22510097920894623,0.08821532130241394,0.02281942591071129,-0.16851471364498138,-0.39948421716690063,0.4781944751739502,-0.1106119155883789,0.37788909673690796,-0.5341840386390686,1.6657711267471313,0.23619230091571808,-0.16936853528022766,-0.34403157234191895,-0.05048051103949547,0.5156921148300171,-0.5097588300704956,-0.1076057031750679,0.16615211963653564,-0.41826316714286804,-0.09777717292308807,0.4317220151424408,1.4926064014434814,0.4437429904937744,0.6409068703651428,-0.2857368588447571,0.4252455234527588,-0.4507920742034912,-1.395687222480774,0.32343316078186035,-0.14300259947776794,0.17345699667930603,0.6882900595664978,-0.031068190932273865,-0.014234764501452446,0.2588723599910736,0.6380057334899902,-0.10916788876056671,0.21145275235176086,0.41304823756217957,1.875705361366272,0.30104920268058777,-0.14842073619365692,-0.4808446764945984,-0.3084228038787842,-0.2934291660785675,0.12193095684051514,0.18131327629089355,-0.632544219493866,0.30189579725265503,0.13330793380737305,0.1023193746805191,-0.14311614632606506,0.4220004975795746,0.20342287421226501,0.7711853981018066,0.04235168173909187,-0.061884328722953796,1.1321145296096802,-0.16180944442749023,0.008948512375354767,-0.0014485716819763184,-0.1739363670349121,-0.3506462275981903,-0.4292738437652588]}},true]},{"type":"Workflow","content":[{"workflow":{"name":"baml_answer_with_citations","version":"v0.1","steps":[{"name":"Initialize","body":[{"type":"composite","value":[{"type":"registeroperation","value":{"register":"$DSL","value":"class Citation {\n citation_id int\n document_reference string @description(#\\\"The name of the document and the page number that supports the answer e.g., FILENAME: Page [PAGE NUMBER]. This is a reference. You must mention it NO MATTER WHAT.\\\"#)\n relevantTextFromDocument string @alias(\\\"relevantSentenceFromDocument\\\") @description(#\\\"The relevant text from the document that supports the answer. This is part of the citation. You must quote it EXACTLY as it appears in the document with any special characters it contains. You may cite a part of the sentence. The text should be contiguous and not broken up. You may NOT summarize or skip sentences. If you need to skip a sentence, start a new citation instead.\\\"#)\n }\n\n class Answer {\n answersInText Citation[] @alias(\\\"relevantSentencesFromText\\\")\n answer AnswerWithCitations @description(#\\\"An answer to the user's question that MUST cite sources from the relevantSentencesFromText. Like [0]. If multiple citations are needed, write them like [0][1][2].\\\"#)\n }\n\n class AnswerWithCitations {\n brief_introduction Paragraph @description(#\\\"3-4 long sentences. Must use the citations in the text.\\\"#)\n extensive_body Paragraph[] @description(#\\\"At least 3-6 long sentences. The more the better. Must use the citations in the text.\\\"#)\n conclusion Paragraph[] @description(#\\\"1-3 long sentences. Must use the citations in the text.\\\"#)\n }\n\n class Paragraph {\n sentences string[]\n }\n\n class Document {\n file string\n text string\n reference string\n }\n class Context {\n documents Document[]\n question string\n }\n\n function AnswerQuestion(context: Context) -> Answer {\n client ShinkaiProvider\n\n prompt #\\\"\n Out of the given content, do your best to answer the question.\n\n CONTEXT:\n {% for document in context.documents %}\n ----\n DOCUMENT NAME: {{ document.file }}\n PARTIAL TEXT: {{ document.text }}\n DOCUMENT REFERENCE: {{ document.reference }}\n ---\n {% endfor %}\n \n {{ ctx.output_format }}\n\n QUESTION: {{ context.question }}. Citing the references no matter what e.g., [0]. If multiple citations are needed, write them like [0][1][2].\n\n ANSWER:\n {{ _.role(\\\"user\\\") }}\n \\\"#\n }"}},{"type":"registeroperation","value":{"register":"$PARAM","value":"context"}},{"type":"registeroperation","value":{"register":"$FUNCTION","value":"AnswerQuestion"}},{"type":"registeroperation","value":{"register":"$RESULT","value":{"name":"baml_inference","args":[{"type":"register","value":"$INPUT"},{"type":"string","value":""},{"type":"string","value":""},{"type":"register","value":"$DSL"},{"type":"register","value":"$FUNCTION"},{"type":"register","value":"$PARAM"}]}}}]}]}],"raw":"\n workflow baml_answer_with_citations v0.1 {\n step Initialize {\n $DSL = \"class Citation {\n citation_id int\n document_reference string @description(#\\\"The name of the document and the page number that supports the answer e.g., FILENAME: Page [PAGE NUMBER]. This is a reference. You must mention it NO MATTER WHAT.\\\"#)\n relevantTextFromDocument string @alias(\\\"relevantSentenceFromDocument\\\") @description(#\\\"The relevant text from the document that supports the answer. This is part of the citation. You must quote it EXACTLY as it appears in the document with any special characters it contains. You may cite a part of the sentence. The text should be contiguous and not broken up. You may NOT summarize or skip sentences. If you need to skip a sentence, start a new citation instead.\\\"#)\n }\n\n class Answer {\n answersInText Citation[] @alias(\\\"relevantSentencesFromText\\\")\n answer AnswerWithCitations @description(#\\\"An answer to the user's question that MUST cite sources from the relevantSentencesFromText. Like [0]. If multiple citations are needed, write them like [0][1][2].\\\"#)\n }\n\n class AnswerWithCitations {\n brief_introduction Paragraph @description(#\\\"3-4 long sentences. Must use the citations in the text.\\\"#)\n extensive_body Paragraph[] @description(#\\\"At least 3-6 long sentences. The more the better. Must use the citations in the text.\\\"#)\n conclusion Paragraph[] @description(#\\\"1-3 long sentences. Must use the citations in the text.\\\"#)\n }\n\n class Paragraph {\n sentences string[]\n }\n\n class Document {\n file string\n text string\n reference string\n }\n class Context {\n documents Document[]\n question string\n }\n\n function AnswerQuestion(context: Context) -> Answer {\n client ShinkaiProvider\n\n prompt #\\\"\n Out of the given content, do your best to answer the question.\n\n CONTEXT:\n {% for document in context.documents %}\n ----\n DOCUMENT NAME: {{ document.file }}\n PARTIAL TEXT: {{ document.text }}\n DOCUMENT REFERENCE: {{ document.reference }}\n ---\n {% endfor %}\n \n {{ ctx.output_format }}\n\n QUESTION: {{ context.question }}. Citing the references no matter what e.g., [0]. If multiple citations are needed, write them like [0][1][2].\n\n ANSWER:\n {{ _.role(\\\"user\\\") }}\n \\\"#\n }\"\n $PARAM = \"context\"\n $FUNCTION = \"AnswerQuestion\"\n $RESULT = call baml_inference($INPUT, \"\", \"\", $DSL, $FUNCTION, $PARAM)\n }\n } @@official.shinkai\n ","description":"Generates an answer to a question with citations from the provided content using BAML. The answer includes quotes from the content as citations.","author":"@@official.shinkai","sticky":false},"embedding":{"id":"","vector":[0.3797622621059418,0.055756017565727234,-0.3101310729980469,-0.1303926408290863,-0.2349807769060135,-0.3620940148830414,-1.4513840675354004,0.4004634618759155,-0.09126128256320953,-0.2862396240234375,-0.21521227061748505,0.5031366348266602,0.5290755033493042,-0.1413222849369049,0.6188375949859619,0.38532504439353943,-0.11255966126918793,-0.5313267707824707,-1.018203854560852,0.16118848323822021,0.38974928855895996,0.26705488562583923,0.7251760363578796,0.3977380394935608,-0.11609482020139694,0.06196017935872078,0.13894720375537872,-0.2236107438802719,-1.2703726291656494,-1.2511805295944214,0.48944661021232605,0.2941161096096039,-0.36227738857269287,-0.2411549985408783,-0.49036508798599243,-0.4147837460041046,0.3464353680610657,-0.19157636165618896,-0.10052890330553055,0.33582234382629395,-0.34775447845458984,0.04653438180685043,0.608782172203064,-0.3258453607559204,-0.12086259573698044,-0.3823518753051758,1.0109241008758545,-0.23640067875385284,0.7499700784683228,0.8023027181625366,-0.3843623101711273,-0.3905274569988251,0.27414560317993164,0.29860666394233704,-0.4371856153011322,0.23716586828231812,0.04210366681218147,0.3562734127044678,-0.331453800201416,0.11200998723506927,0.37262940406799316,-0.3658697307109833,-3.935379981994629,0.14438453316688538,0.6308651566505432,0.21387910842895508,0.28002044558525085,-0.16130675375461578,-0.8150539994239807,-0.4389743506908417,-0.06972597539424896,-0.5424433946609497,-0.7765288949012756,0.5558378100395203,0.3599364161491394,-0.4887274503707886,-0.0007520616054534912,0.05174863338470459,0.590337872505188,-0.384021520614624,-0.053891345858573914,0.3669104278087616,-0.2317630499601364,0.25666916370391846,-0.7620011568069458,0.30930858850479126,-0.21822401881217957,-0.643441379070282,0.44276541471481323,0.660913348197937,-0.4575757086277008,-0.2502431869506836,0.15478183329105377,0.38664811849594116,-0.08887406438589096,0.2539937496185303,-0.03916637599468231,-0.5154840350151062,0.5459664463996887,2.9898178577423096,0.2672237455844879,-0.37507301568984985,0.8107877373695374,-0.5531704425811768,0.7260451912879944,-0.15623879432678223,0.3055795431137085,0.1754366159439087,0.09581713378429413,0.44947704672813416,0.31352749466896057,-0.28868404030799866,-0.5385019779205322,0.33680713176727295,-0.21201713383197784,0.7001216411590576,-0.7345210313796997,0.1426507532596588,0.11188594251871109,0.6378754377365112,0.36010265350341797,0.19299772381782532,-0.19160330295562744,-0.1184423640370369,0.14750339090824127,0.23624475300312042,0.017083611339330673,0.2653906047344208,0.2514684498310089,0.19559024274349213,0.5418351888656616,0.1569286286830902,-0.7294088006019592,0.328125923871994,0.02290940470993519,0.16350258886814117,1.043413758277893,-1.032653570175171,0.9681538343429565,-0.8715519309043884,0.21746881306171417,-1.6401642560958862,0.9072688221931458,0.3240673542022705,0.19921818375587463,-0.22009170055389404,-1.024997353553772,0.3806820213794708,-0.39549684524536133,-0.42126455903053284,-0.37500330805778503,0.12471919506788254,-0.46238279342651367,-0.11431951820850372,0.43173450231552124,-0.08136603981256485,-0.7753247022628784,-0.15560556948184967,-0.20577538013458252,0.16913741827011108,-0.24217629432678223,-0.3097689747810364,0.6912097334861755,-0.46705949306488037,-0.23456573486328125,-0.19368106126785278,-0.026194050908088684,0.29294338822364807,0.20618201792240143,0.038728564977645874,-0.313559353351593,-0.3366357088088989,0.00509969238191843,1.1993379592895508,0.15553726255893707,-0.14727765321731567,0.2659122943878174,-0.15252447128295898,0.7438075542449951,-0.1947561800479889,0.5643417239189148,0.5989380478858948,-0.6331312656402588,-0.3168948292732239,-0.23661555349826813,0.7672645449638367,0.46782436966896057,0.2681032121181488,1.418749451637268,1.2327861785888672,-0.46809977293014526,0.8014423847198486,-0.5430251359939575,-0.3643764853477478,0.15952736139297485,0.19020645320415497,0.7295116782188416,-0.0844498723745346,1.010969638824463,0.24072204530239105,0.3357287049293518,0.020911354571580887,0.2755776643753052,0.02969147264957428,-0.01337328553199768,-0.7969410419464111,-0.47564974427223206,0.5079171061515808,-0.5863653421401978,-0.7805141806602478,-0.10677085816860199,-0.8892369270324707,0.7942572236061096,0.6627474427223206,0.47531434893608093,0.3589997887611389,-0.15228474140167236,-0.10162676870822906,-0.11354662477970123,0.2639334201812744,0.07278834283351898,-0.48128312826156616,-0.8211566805839539,-0.2795396149158478,-0.7236523628234863,0.352206289768219,0.01859442889690399,-0.08775120973587036,-0.22070738673210144,-0.48127979040145874,0.36574625968933105,1.7433961629867554,0.982549786567688,1.0124894380569458,0.7370933890342712,0.4407808184623718,-0.21980562806129456,-0.13790135085582733,0.5385861396789551,-0.4323239326477051,-0.2465112805366516,-0.22517752647399902,-0.0271136611700058,0.26054584980010986,0.44240519404411316,-0.9002771377563477,0.22551384568214417,-0.5237748026847839,0.08540594577789307,1.3925650119781494,0.2770116627216339,-0.5225498676300049,0.44990918040275574,-0.1984628587961197,-0.12113264948129654,0.3022267520427704,-1.8065658807754517,-0.3099088966846466,-0.6861429214477539,0.7306676506996155,-0.30434128642082214,-0.2812166213989258,0.7118960618972778,0.04537050053477287,-0.39949703216552734,-0.9633961915969849,-0.8368886113166809,-1.018973708152771,-0.23503834009170532,-0.07855327427387238,-0.4439423978328705,1.099806547164917,-0.6865937113761902,-0.19636347889900208,0.16010379791259766,0.4755159914493561,0.8275705575942993,0.3734543025493622,-0.19382072985172272,-1.1013609170913696,0.4655303955078125,-0.4615223705768585,0.029980260878801346,-0.12803228199481964,-0.6200829744338989,-0.22082911431789398,-0.6129460334777832,-0.440936803817749,-0.12251780182123184,0.25749075412750244,-0.21793797612190247,-0.31565356254577637,-1.0452193021774292,0.48470351099967957,1.489746332168579,0.34717267751693726,-0.11593799293041229,0.5712113380432129,0.37145087122917175,-0.1405247449874878,0.10602741688489914,0.44691920280456543,0.2407248467206955,0.1857607066631317,-0.4698955714702606,-0.6073989272117615,0.003017023205757141,-0.692069411277771,-0.056892529129981995,0.2016339898109436,-0.6986490488052368,-0.4357801079750061,-0.3368676006793976,-0.21542751789093018,0.16499149799346924,-0.49468180537223816,0.7049293518066406,0.35484278202056885,-0.12084715068340302,-2.1006436347961426,0.17676638066768646,1.0268604755401611,-0.1937757432460785,-0.3107340335845947,-0.12163938581943512,0.4608701467514038,-0.5104370713233948,0.41666844487190247,-0.25553765892982483,1.501641869544983,0.391608864068985,-0.5072856545448303,-0.3386199176311493,0.35516029596328735,0.4765162467956543,-0.1931939572095871,-0.04903487116098404,-0.11199391633272171,-0.31363174319267273,-0.16184554994106293,1.0071266889572144,1.2638416290283203,1.3507024049758911,0.7613588571548462,0.4123046398162842,0.2764201760292053,-0.6620365977287292,-0.957791805267334,0.1179533302783966,0.05718009173870087,-0.5120300054550171,0.683925211429596,-0.38944295048713684,-0.40000054240226746,-0.1454511433839798,0.30291903018951416,-0.36079010367393494,-0.48647207021713257,0.13034778833389282,1.8149853944778442,0.11981132626533508,-0.16857168078422546,0.27804651856422424,-0.248652383685112,-0.22382158041000366,-0.02025716006755829,0.23994572460651398,-0.38804712891578674,0.15800036489963531,-0.7771037817001343,0.3905825614929199,-0.7868342995643616,-0.009819000959396362,-0.2602401375770569,0.5894878506660461,0.41537952423095703,0.20397962629795074,0.858824610710144,0.4924372136592865,-0.09800249338150024,0.33428242802619934,-0.15497006475925446,-0.18699677288532257,-0.10839053988456726]}},false]},{"type":"Workflow","content":[{"workflow":{"name":"answer_with_citations_workflow","version":"v0.1","steps":[{"name":"Initialize","body":[{"type":"composite","value":[{"type":"registeroperation","value":{"register":"$FILE_PIECES","value":{"name":"process_embeddings_in_job_scope_with_metadata","args":[]}}},{"type":"registeroperation","value":{"register":"$LLM_INPUT","value":{"name":"generate_json_map","args":[{"type":"string","value":"question"},{"type":"register","value":"$INPUT"},{"type":"string","value":"documents"},{"type":"register","value":"$FILE_PIECES"}]}}},{"type":"registeroperation","value":{"register":"$LLM_RESPONSE","value":{"name":"baml_answer_with_citations","args":[{"type":"register","value":"$LLM_INPUT"}]}}},{"type":"registeroperation","value":{"register":"$JINJA","value":"# Introduction\\n{%- for sentence in answer.brief_introduction.sentences %}\\n{{ sentence }}\\n{%- endfor %}\\n\\n# Main Content\\n{%- if answer.extensive_body | length > 1 %}\\n{%- for part in answer.extensive_body %}\\n### Part {{ loop.index }}\\n{%- for sentence in part.sentences %}\\n{{ sentence }}\\n{%- endfor %}\\n{%- endfor %}\\n{%- else %}\\n{%- for part in answer.extensive_body %}\\n{%- for sentence in part.sentences %}\\n{{ sentence }}\\n{%- endfor %}\\n{%- endfor %}\\n{%- endif %}\\n\\n# Conclusion\\n{%- for section in answer.conclusion %}\\n{%- for sentence in section.sentences %}\\n{{ sentence }}\\n{%- endfor %}\\n{%- endfor %}\\n\\n# Citations\\n{%- for citation in relevantSentencesFromText %}\\n[{{ citation.citation_id }}]: {{ citation.relevantTextFromDocument }} ({{ citation.document_reference }})\\n{%- endfor %}"}},{"type":"registeroperation","value":{"register":"$PROMPT","value":"Apply the following template to the following answer (just give me the answer dont mention anything about a template): "}},{"type":"registeroperation","value":{"register":"$NEW_INPUT","value":{"name":"concat","args":[{"type":"register","value":"$PROMPT"},{"type":"register","value":"$JINJA"},{"type":"register","value":"$LLM_RESPONSE"}]}}},{"type":"registeroperation","value":{"register":"$RESULT","value":{"name":"inference","args":[{"type":"register","value":"$NEW_INPUT"}]}}}]}]}],"raw":"\n workflow answer_with_citations_workflow v0.1 {\n step Initialize {\n $FILE_PIECES = call process_embeddings_in_job_scope_with_metadata()\n $LLM_INPUT = call generate_json_map(\"question\", $INPUT, \"documents\", $FILE_PIECES)\n $LLM_RESPONSE = call baml_answer_with_citations($LLM_INPUT)\n $JINJA = \"# Introduction\\n{%- for sentence in answer.brief_introduction.sentences %}\\n{{ sentence }}\\n{%- endfor %}\\n\\n# Main Content\\n{%- if answer.extensive_body | length > 1 %}\\n{%- for part in answer.extensive_body %}\\n### Part {{ loop.index }}\\n{%- for sentence in part.sentences %}\\n{{ sentence }}\\n{%- endfor %}\\n{%- endfor %}\\n{%- else %}\\n{%- for part in answer.extensive_body %}\\n{%- for sentence in part.sentences %}\\n{{ sentence }}\\n{%- endfor %}\\n{%- endfor %}\\n{%- endif %}\\n\\n# Conclusion\\n{%- for section in answer.conclusion %}\\n{%- for sentence in section.sentences %}\\n{{ sentence }}\\n{%- endfor %}\\n{%- endfor %}\\n\\n# Citations\\n{%- for citation in relevantSentencesFromText %}\\n[{{ citation.citation_id }}]: {{ citation.relevantTextFromDocument }} ({{ citation.document_reference }})\\n{%- endfor %}\"\n \n $PROMPT = \"Apply the following template to the following answer (just give me the answer dont mention anything about a template): \"\n $NEW_INPUT = call concat($PROMPT, $JINJA, $LLM_RESPONSE) \n $RESULT = call inference($NEW_INPUT)\n }\n } @@official.shinkai\n ","description":"Generates an answer to a question with citations from the provided content using RAG workflow.","author":"@@official.shinkai","sticky":false},"embedding":{"id":"","vector":[0.302041232585907,0.6495791673660278,-0.16463279724121094,0.27348119020462036,-0.3640792667865753,-0.11759210377931595,-1.3377487659454346,0.2906632423400879,0.2659119963645935,0.0064449855126440525,-0.2225845754146576,0.7155923247337341,0.2863701581954956,0.013627946376800537,0.37820589542388916,0.4598727524280548,-0.10306946933269501,-0.6235101819038391,-1.3434779644012451,0.01579219475388527,0.563793957233429,0.4702529311180115,0.24035745859146118,0.08729343116283417,-0.1935933530330658,0.4073832631111145,0.22304141521453857,-0.16020876169204712,-1.2370494604110718,-1.8152098655700684,0.32133832573890686,0.5529523491859436,-0.47941479086875916,-0.2894234359264374,-0.22529128193855286,-0.6637700796127319,0.038934219628572464,-0.11896584928035736,-0.6196734309196472,0.3092517852783203,-0.017506450414657593,0.29310837388038635,0.2966788709163666,0.11765111237764359,0.5300358533859253,-0.6917188167572021,0.4312555491924286,-0.34250134229660034,0.3841196596622467,0.25088948011398315,-0.7944143414497375,-0.686835527420044,0.4505968391895294,0.30513784289360046,-0.24635744094848633,0.22689467668533325,0.5774812698364258,-0.17809458076953888,0.3844796121120453,-0.10836978256702423,0.4342154264450073,0.08909395337104797,-4.313159465789795,0.42584100365638733,0.14493651688098907,0.08237434923648834,0.3053835928440094,-0.2510621249675751,-0.26908355951309204,0.05084872245788574,-0.20760825276374817,-0.2481420487165451,-0.20238164067268372,0.025295820087194443,0.051211945712566376,-0.30147409439086914,-0.2935594916343689,-0.11286266148090363,0.3743446469306946,-0.5593183636665344,-0.17406244575977325,0.6305493712425232,-0.05546174198389053,-0.06269138306379318,-0.7509041428565979,0.3297814726829529,-0.4034028947353363,-0.2742491364479065,0.34146708250045776,0.5505414009094238,-0.5094859600067139,-0.09207914769649506,0.3118738830089569,-0.27273064851760864,-0.351421594619751,0.12499718368053436,0.02875395491719246,0.37674230337142944,0.3279470205307007,3.104065179824829,0.1853073239326477,-0.6978022456169128,0.8353964686393738,-0.6210517287254333,0.299731969833374,-0.2903611361980438,0.34038618206977844,-0.16563871502876282,0.27116236090660095,0.6264962553977966,0.3312639594078064,-0.5524058938026428,-0.25126639008522034,0.48475781083106995,0.27730247378349304,0.22434116899967194,-0.5458792448043823,0.20768611133098602,-0.3331827223300934,1.0173496007919312,-0.048498235642910004,-0.07441143691539764,-0.47644293308258057,-0.37685298919677734,0.2681230902671814,0.27811694145202637,0.027686040848493576,0.14175771176815033,0.3515598177909851,0.43409720063209534,0.5166351795196533,-0.4411574900150299,-0.823940634727478,-0.2513667643070221,-0.3378399610519409,0.3593744933605194,1.012085199356079,-0.8341009616851807,0.41486555337905884,-0.8454400897026062,0.045630961656570435,-1.0219558477401733,0.6480528116226196,-0.022864188998937607,0.5243897438049316,-0.09312224388122559,-0.7185470461845398,0.454501748085022,-0.5255737900733948,-0.05204040929675102,-0.3932226300239563,0.21987518668174744,-0.18833470344543457,0.1750001460313797,0.7764050960540771,-0.08508025854825974,-0.4201195240020752,-0.027372032403945923,-0.5477855801582336,0.5084601044654846,-0.27074211835861206,-0.3358495533466339,0.37030738592147827,-0.1664036065340042,0.30039411783218384,-0.16436031460762024,0.26987943053245544,-0.07586002349853516,0.20720936357975006,-0.33640843629837036,0.14486727118492126,-0.058277927339076996,0.08135819435119629,0.6479024887084961,-0.39269688725471497,0.25529712438583374,0.09676061570644379,0.03970225900411606,-0.0051755160093307495,-0.3197023868560791,0.7519499659538269,0.39787548780441284,-0.5427854061126709,-0.2278692126274109,-0.13041603565216064,0.7266638278961182,0.39746806025505066,0.35260921716690063,0.8904515504837036,0.9481697082519531,-0.534455418586731,1.077448844909668,-0.4851692318916321,0.09174691140651703,0.40167665481567383,0.011938601732254028,0.209327831864357,0.19621434807777405,0.9554470777511597,-0.17806030809879303,0.4127517342567444,0.34222567081451416,0.34531280398368835,0.0028178244829177856,0.08940697461366653,-0.48655739426612854,-0.11633729934692383,0.4609406292438507,-0.5707967281341553,-0.7172647714614868,-0.15549525618553162,-0.6388192176818848,0.9782460927963257,0.5757883191108704,0.4868878126144409,0.5279903411865234,-0.03237190097570419,-0.2205381691455841,0.16652852296829224,0.643582284450531,-0.2677132189273834,0.06080951169133186,-0.13484515249729156,-0.4923725724220276,-0.516819179058075,0.6620203852653503,0.07592541724443436,0.07159370183944702,0.06254155933856964,-0.5057934522628784,0.0764768123626709,1.0371267795562744,0.624696671962738,1.128337025642395,0.6512643098831177,0.3021669387817383,-0.4556947946548462,0.05481366068124771,0.30271732807159424,-0.613541305065155,0.12894059717655182,-0.10522378981113434,0.21463046967983246,-0.07597915828227997,0.36100587248802185,-0.7120083570480347,-0.252541184425354,-0.6509837508201599,0.09734252095222473,1.7409844398498535,0.018263503909111023,-0.38902392983436584,0.6623021960258484,0.26024848222732544,0.12274602800607681,0.2705548107624054,-1.983655333518982,-0.34808245301246643,-0.44870463013648987,0.8398820161819458,0.3027595579624176,-0.3285507261753082,0.8434791564941406,0.18463754653930664,-0.02081805095076561,-0.5282495617866516,-0.626075804233551,-0.9119731187820435,-0.0012827664613723755,-0.09766072779893875,-0.7564650774002075,0.7809023857116699,-0.6776382327079773,0.04063400253653526,-0.08290590345859528,0.14572179317474365,0.5667208433151245,0.3448168635368347,-0.5389902591705322,-0.8892549276351929,0.4638209342956543,-0.35105016827583313,-0.6134374141693115,0.05028517544269562,-0.3464180827140808,-0.25418758392333984,-0.7385156154632568,-0.05664042383432388,-0.23391547799110413,0.09158208966255188,-0.17262275516986847,-0.6692696213722229,-0.9896000623703003,0.6646811962127686,1.926600694656372,0.29630979895591736,0.04862155020236969,0.4683615267276764,0.31428056955337524,-0.5492845177650452,0.5060234665870667,0.14091579616069794,-0.30021777749061584,-0.13741666078567505,-0.7438650131225586,0.02209792286157608,0.4707602262496948,-0.4167380928993225,0.15437601506710052,0.48597821593284607,-0.5394192337989807,-0.09873858839273453,-0.10803239047527313,0.30014458298683167,0.3251103162765503,-0.39479196071624756,0.14275161921977997,0.3502808213233948,-0.34477901458740234,-2.357520818710327,0.013839280232787132,0.7088819146156311,-0.12972787022590637,-0.15496616065502167,-0.1557634323835373,0.5408610105514526,0.042263880372047424,0.21417298913002014,-0.45165085792541504,1.2327648401260376,0.5347790122032166,-0.3049626052379608,-0.43793389201164246,0.17141607403755188,0.9914730787277222,-0.23269782960414886,0.4983164072036743,-0.12929704785346985,-0.021774105727672577,-0.49563103914260864,0.6341679096221924,1.1403045654296875,0.5469133853912354,0.6069785356521606,-0.11656582355499268,0.21336913108825684,-0.5077071785926819,-1.2154546976089478,0.09518444538116455,0.06945158541202545,-0.6196871399879456,0.7504529356956482,-0.3938862979412079,-0.6696345806121826,-0.11530251801013947,0.42651259899139404,0.06762523949146271,-0.014222238212823868,-0.08163487166166306,1.8882081508636475,-0.18455733358860016,-0.29645416140556335,-0.11717289686203003,-0.2683551609516144,-0.560032069683075,0.3953476548194885,0.10460548102855682,-0.22123202681541443,0.167826309800148,-0.23793259263038635,0.37224283814430237,-0.7192226648330688,-0.13425150513648987,-0.3594304323196411,0.244207501411438,0.08292294293642044,0.3012055456638336,1.0009146928787231,0.4970721900463104,-0.14509020745754242,0.24888360500335693,-0.2440701127052307,-0.43989014625549316,0.009084545075893402]}},true]}]"###; +pub static WORKFLOWS_JSON: &str = r###"[{"type":"Workflow","content":[{"workflow":{"name":"Extensive_summary","version":"v0.1","steps":[{"name":"Initialize","body":[{"type":"composite","value":[{"type":"registeroperation","value":{"register":"$PROMPT","value":"Summarize this: "}},{"type":"registeroperation","value":{"register":"$EMBEDDINGS","value":{"name":"process_embeddings_in_job_scope","args":[]}}}]}]},{"name":"Summarize","body":[{"type":"registeroperation","value":{"register":"$RESULT","value":{"name":"multi_inference","args":[{"type":"register","value":"$PROMPT"},{"type":"register","value":"$EMBEDDINGS"}]}}}]}],"raw":"\n workflow Extensive_summary v0.1 {\n step Initialize {\n $PROMPT = \"Summarize this: \"\n $EMBEDDINGS = call process_embeddings_in_job_scope()\n }\n step Summarize {\n $RESULT = call multi_inference($PROMPT, $EMBEDDINGS)\n }\n } @@official.shinkai\n ","description":"Reviews in depth all the content to generate a summary.","author":"@@official.shinkai","sticky":false},"embedding":{"id":"","vector":[0.6820248961448669,0.5723804831504822,0.056784410029649734,-0.029523666948080063,-0.2254689335823059,-0.053013481199741364,-0.6708416938781738,-0.2624345123767853,-0.033756330609321594,0.4013897180557251,-0.16321982443332672,0.971656858921051,0.2718249261379242,0.07108756899833679,0.2820807695388794,0.14116838574409485,-0.11496889591217041,-0.49301284551620483,-1.0789883136749268,-0.043452829122543335,0.19382520020008087,0.5948700308799744,0.6591302156448364,0.16274362802505493,-0.030279342085123062,-0.1913491189479828,-0.3163045048713684,-0.2898331880569458,-0.7694717645645142,-2.4501161575317383,0.5279894471168518,0.0053562745451927185,-0.5002804398536682,-0.5608552694320679,0.028381161391735077,-0.6834791302680969,0.328404039144516,0.2872193455696106,-0.27112722396850586,-0.2420305460691452,-0.20994114875793457,0.23660853505134583,-0.35357770323753357,0.590043306350708,0.27437782287597656,0.06486925482749939,-0.15818193554878235,-0.2542445659637451,0.3756386339664459,0.38245582580566406,-0.45134201645851135,-0.26646173000335693,-0.21188713610172272,0.5074135065078735,-0.45056354999542236,0.42795759439468384,-0.14764094352722168,-0.299643874168396,0.24885445833206177,0.021038610488176346,0.29774922132492065,0.527859091758728,-4.216637134552002,0.35374659299850464,0.19555260241031647,0.3751485049724579,0.17744454741477966,-0.2610761225223541,-0.172037273645401,0.032772570848464966,0.05567239597439766,0.19824181497097015,-0.13289085030555725,-0.1100323274731636,-0.23126265406608582,-0.34616896510124207,0.3950774073600769,0.35234352946281433,0.1308232843875885,-0.6239751577377319,-0.7391460537910461,0.4362350106239319,-0.0347885936498642,0.09445835649967194,-0.2117754966020584,0.7171225547790527,-0.3040316104888916,-0.3600367605686188,0.37041613459587097,-0.06581398844718933,-0.006318345665931702,-0.21981696784496307,-0.002286979928612709,0.2790469229221344,-0.7975400686264038,0.10219541937112808,0.15441451966762543,0.11658502370119095,0.4612636864185333,3.6136317253112793,0.6766623854637146,-0.28591224551200867,0.7045385241508484,-0.4960375726222992,0.1050494909286499,-0.5604535937309265,-0.25389742851257324,-0.2956107258796692,0.40285223722457886,-0.111656554043293,0.015156731009483337,-0.5351597666740417,-0.030287399888038635,0.3177969753742218,0.21704047918319702,0.7171976566314697,-0.46601396799087524,0.3439251184463501,-0.061566051095724106,0.20522497594356537,-0.6280752420425415,0.130172997713089,0.051850613206624985,0.21620029211044312,-0.2943073809146881,0.1809474229812622,-0.23445376753807068,0.2775576710700989,0.2914619445800781,0.0578656867146492,0.10241352021694183,-0.15168319642543793,-0.7568095326423645,0.092719167470932,-0.0777229368686676,-0.15893718600273132,0.5966013073921204,-0.7341698408126831,0.25946319103240967,-0.9252210259437561,0.09058776497840881,-1.5351767539978027,0.7115793824195862,0.29241278767585754,0.7798487544059753,-0.08018416166305542,-0.13354992866516113,-0.08928925544023514,-0.4238916337490082,-0.5697543025016785,0.06765686720609665,0.77348792552948,-0.04202955216169357,0.06487800180912018,0.5874587893486023,-0.11936471611261368,-0.25156763195991516,0.19140180945396423,-0.5563774108886719,0.31181517243385315,-0.32280847430229187,-0.15203385055065155,0.6281672716140747,0.6141714453697205,0.5077856183052063,-0.20541121065616608,0.334749698638916,-0.22992375493049622,0.3473362326622009,0.13209888339042664,-0.046164438128471375,-0.4251396954059601,0.33730384707450867,0.8212467432022095,0.177277609705925,-0.1610117256641388,-0.07467097789049149,0.2908981442451477,0.2191067337989807,-0.5679166316986084,0.7439255714416504,0.5261525511741638,-0.11653833091259003,-0.3659759759902954,-0.023860540241003036,-0.26393836736679077,0.42201778292655945,-0.21162325143814087,0.6553518176078796,0.7129044532775879,-0.8967499136924744,1.4437609910964966,-0.7139504551887512,-0.4562397301197052,0.1866864711046219,-0.1461351215839386,-0.5919792056083679,-0.022950291633605957,0.10381539165973663,0.28671005368232727,-0.5119964480400085,0.06818243861198425,-0.34842413663864136,-0.2360081672668457,-0.20727667212486267,-0.666267454624176,-0.2698496878147125,0.14760757982730865,-0.1733710914850235,-0.7490845322608948,0.17996001243591309,-0.1494026631116867,0.6294229030609131,0.6854228973388672,0.45075780153274536,0.16544346511363983,0.15525199472904205,0.40028688311576843,0.6559727787971497,0.5462879538536072,0.6049190759658813,-0.16969510912895203,-0.5258905291557312,-0.7370105385780334,-0.5058722496032715,0.05097363144159317,-0.4502354860305786,-0.16756923496723175,-0.3616001605987549,-0.07482671737670898,0.5364893674850464,0.3961637616157532,0.6380713582038879,0.7769057154655457,0.45226916670799255,0.12783251702785492,-0.06475261598825455,0.5124138593673706,0.2543259561061859,-0.3266713619232178,0.6652782559394836,-0.10381640493869781,-0.2858583927154541,0.369432270526886,0.4281133711338043,-0.397693008184433,-0.4147809147834778,-0.007397249341011047,-0.16696804761886597,1.8266067504882812,0.09511159360408783,-0.33791670203208923,0.20951442420482635,0.5353755950927734,0.4132263660430908,0.07172563672065735,-1.3672807216644287,0.033725690096616745,-0.6914818286895752,0.4152260720729828,-0.29042062163352966,0.2820392847061157,-0.12484639883041382,0.12444232404232025,-0.2538592219352722,-0.1376664787530899,-0.376803457736969,-0.21342863142490387,-0.3275066018104553,-0.1573990434408188,0.07955310493707657,0.7591940760612488,0.06325787305831909,-0.1243286207318306,-0.06205055117607117,0.27926522493362427,0.1881060153245926,-0.07187489420175552,-0.43998342752456665,-0.04985599219799042,0.35954052209854126,0.07155530899763107,0.37024304270744324,0.25004273653030396,-0.5525103211402893,-0.2558727264404297,-0.36321941018104553,0.04473167657852173,-0.09463290125131607,-0.01605386659502983,-0.21422991156578064,-0.40423282980918884,-0.07233521342277527,0.24171797931194305,1.5734977722167969,0.2532348036766052,0.3514263331890106,0.5783570408821106,0.38809657096862793,0.18779775500297546,-0.7362217903137207,0.018929127603769302,-0.2433643937110901,-0.1767692118883133,-0.6034640073776245,-0.2618042230606079,0.23901714384555817,0.25006982684135437,-0.3671899735927582,0.56818026304245,-0.45649564266204834,-0.5177562832832336,0.21355649828910828,0.04084805026650429,0.36265265941619873,-0.4912548065185547,0.3579895794391632,-0.06822404265403748,0.23526312410831451,-2.4479732513427734,-0.409572571516037,0.33847421407699585,0.39877307415008545,-0.31740933656692505,-0.13011762499809265,1.0355134010314941,-0.2030523419380188,0.004002278670668602,-0.17361848056316376,1.0097349882125854,0.3712850511074066,0.04738866910338402,-0.38382434844970703,-0.22995835542678833,0.10955353826284409,-0.5831428170204163,0.5505454540252686,-0.251912921667099,-0.6052247285842896,-0.11847558617591858,0.39012327790260315,1.722125768661499,0.4369223117828369,0.4068147540092468,-0.08888967335224152,0.16951988637447357,-0.7578551769256592,-1.5347665548324585,-0.09822624921798706,-0.1749330759048462,-0.40222880244255066,0.40935447812080383,-0.014797728508710861,-0.25942203402519226,0.7363397479057312,0.8023666143417358,0.1866847723722458,1.0114266872406006,-0.37116944789886475,1.44536292552948,-0.37696170806884766,-0.06581003218889236,0.011476762592792511,0.43547624349594116,0.33689627051353455,0.4570700526237488,-0.09152284264564514,-0.7278273105621338,-0.19184312224388123,-0.024527274072170258,0.5096248984336853,-0.4112659990787506,0.585030198097229,0.6007319092750549,0.13742738962173462,-0.0392843633890152,0.18517468869686127,0.4498704671859741,0.053321029990911484,0.055953219532966614,-0.3754947781562805,-0.2632603943347931,-0.8821566700935364,-0.5415434241294861]}},true]},{"type":"Workflow","content":[{"workflow":{"name":"Hyde_inference","version":"v0.1","steps":[{"name":"Initialize","body":[{"type":"composite","value":[{"type":"registeroperation","value":{"register":"$PROMPT","value":"write a passage to answer the question: "}},{"type":"registeroperation","value":{"register":"$HYDE_PROMPT","value":{"name":"concat","args":[{"type":"register","value":"$PROMPT"},{"type":"register","value":"$INPUT"}]}}},{"type":"registeroperation","value":{"register":"$HYDE_PASSAGE","value":{"name":"inference_no_ws","args":[{"type":"register","value":"$HYDE_PROMPT"}]}}},{"type":"registeroperation","value":{"register":"$HYDE_INPUT","value":{"name":"concat","args":[{"type":"register","value":"$INPUT"},{"type":"string","value":". "},{"type":"register","value":"$HYDE_PASSAGE"}]}}},{"type":"registeroperation","value":{"register":"$EMBEDDINGS","value":{"name":"search_embeddings_in_job_scope","args":[{"type":"register","value":"$HYDE_INPUT"}]}}}]}]},{"name":"Summarize","body":[{"type":"composite","value":[{"type":"registeroperation","value":{"register":"$CONNECTOR","value":"\\nLeverage the following information to answer the previous query: --- start ---"}},{"type":"registeroperation","value":{"register":"$NEW_INPUT","value":{"name":"concat","args":[{"type":"register","value":"$INPUT"},{"type":"register","value":"$CONNECTOR"},{"type":"register","value":"$EMBEDDINGS"}]}}},{"type":"registeroperation","value":{"register":"$RESULT","value":{"name":"inference","args":[{"type":"register","value":"$NEW_INPUT"}]}}}]}]}],"raw":"\n workflow Hyde_inference v0.1 {\n step Initialize {\n $PROMPT = \"write a passage to answer the question: \"\n $HYDE_PROMPT = call concat($PROMPT, $INPUT)\n $HYDE_PASSAGE = call inference_no_ws($HYDE_PROMPT)\n $HYDE_INPUT = call concat($INPUT, \". \", $HYDE_PASSAGE )\n $EMBEDDINGS = call search_embeddings_in_job_scope($HYDE_INPUT)\n }\n step Summarize {\n $CONNECTOR = \"\\nLeverage the following information to answer the previous query: --- start ---\"\n $NEW_INPUT = call concat($INPUT, $CONNECTOR, $EMBEDDINGS) \n $RESULT = call inference($NEW_INPUT)\n }\n } @@official.shinkai\n ","description":"Generates a passage to answer a question and uses embeddings to refine the answer.","author":"@@official.shinkai","sticky":false},"embedding":{"id":"","vector":[-0.04964948445558548,0.07351528108119965,-0.0037448257207870483,-0.5989986658096313,-0.2695397734642029,0.0556429848074913,-0.8189688920974731,0.17371350526809692,-0.042529553174972534,-0.278947651386261,-0.1592383086681366,0.7632817625999451,-0.15512093901634216,0.5815573930740356,0.40833333134651184,0.08403884619474411,0.10889555513858795,-0.09859824180603027,-1.4305481910705566,-0.36282309889793396,0.26563403010368347,0.5795038938522339,0.6247695684432983,0.09672331809997559,0.2193397581577301,-0.3369952440261841,0.45206624269485474,-0.20352067053318024,-0.8568096160888672,-1.5192517042160034,0.45000338554382324,0.1857410967350006,-0.5474480986595154,-0.6226603984832764,-0.3259250521659851,-0.8049982786178589,0.41149431467056274,-0.33869048953056335,-0.40478962659835815,0.14186139404773712,0.08049512654542923,0.12524786591529846,0.05503413826227188,0.5369344353675842,0.22099512815475464,-0.22166168689727783,0.49372294545173645,0.14834408462047577,0.7515535950660706,0.23170407116413116,-0.38584038615226746,-0.6664334535598755,0.08026009798049927,0.05644957721233368,-0.47618070244789124,-0.07221367955207825,-0.013390932232141495,-0.7227036356925964,0.2766876816749573,-0.2050083577632904,0.0018085697665810585,0.36839884519577026,-4.047801494598389,0.25997495651245117,0.6095144748687744,0.29139724373817444,0.1967528611421585,0.33130836486816406,0.10284334421157837,0.6389473080635071,0.3290032148361206,0.469316303730011,-0.6486641764640808,0.9727193713188171,0.1883121132850647,-0.33047881722450256,-0.36619096994400024,0.22055767476558685,0.3932532072067261,-0.5142701864242554,-0.008600234985351562,0.1599426567554474,-0.09545424580574036,0.23433077335357666,-0.042303428053855896,0.7357178926467896,-0.32235464453697205,0.08163000643253326,0.14104235172271729,-0.11884527653455734,-0.03371256962418556,0.0557616725564003,0.3496687710285187,-0.03216787800192833,-0.003476671874523163,0.3798062205314636,0.03774901106953621,0.20039451122283936,-0.3984847366809845,3.36946439743042,-0.13239504396915436,0.001673419028520584,0.7380388379096985,-0.30677103996276855,0.9782622456550598,-0.19148962199687958,-0.3291283845901489,-0.27219173312187195,0.11630738526582718,-0.3731819987297058,0.2829224765300751,-0.5195115208625793,-0.707719087600708,0.13076543807983398,0.09487534314393997,0.3715026080608368,-0.21381931006908417,0.06631460785865784,0.1631127893924713,0.6596425771713257,-0.34905654191970825,0.4622417092323303,-0.2369920015335083,-0.4202103316783905,-0.5958117246627808,-0.0054769366979599,0.05269158259034157,0.3168359696865082,-0.42596322298049927,-0.2948320209980011,0.19625362753868103,0.3843995928764343,-0.7386986017227173,0.29027774930000305,0.38638198375701904,0.398516982793808,0.5393836498260498,-0.7760148644447327,0.026768285781145096,-0.6783398985862732,0.3489813208580017,-1.9833325147628784,0.42915868759155273,-0.3807029724121094,0.7297704219818115,-0.3749578893184662,-0.988932728767395,-0.049560628831386566,-0.748236894607544,-0.39161738753318787,-0.07422567903995514,0.7568775415420532,-0.42796590924263,-0.6895531415939331,0.7455142736434937,0.3727438449859619,-0.302215039730072,-0.2940479516983032,-0.39270395040512085,0.48044177889823914,-0.45199188590049744,0.012708820402622223,-0.014463722705841064,0.38177770376205444,0.41518479585647583,-0.26775816082954407,0.0609671026468277,0.259851336479187,0.5660082101821899,0.28002557158470154,0.2567088007926941,0.08408413827419281,-0.17901833355426788,0.6893192529678345,-0.18076415359973907,-0.1638849675655365,0.7592079639434814,-0.2850896716117859,0.09555481374263763,-0.34255003929138184,0.21607792377471924,0.6083880066871643,-0.27518394589424133,-0.2888985574245453,0.4869835376739502,0.24507123231887817,-0.04523368924856186,0.08955748379230499,0.8814894556999207,0.7514408826828003,-0.7933105826377869,1.4745051860809326,-0.8296284675598145,0.20127254724502563,-0.17663174867630005,0.10280756652355194,0.7590713500976562,0.6627715826034546,0.011114057153463364,-0.21741513907909393,-0.2958572506904602,-0.07200832664966583,-0.028994381427764893,-0.11766113340854645,-0.29194989800453186,-0.8990501165390015,0.22843225300312042,0.3628116250038147,-0.7341636419296265,-0.3731664717197418,-0.16071830689907074,-0.0289015993475914,0.7402246594429016,0.38305380940437317,0.8563412427902222,0.43994849920272827,0.30292415618896484,-0.22889143228530884,0.16537168622016907,0.7458362579345703,0.012104399502277374,-0.15416470170021057,-0.14556102454662323,-0.748606264591217,-0.5879684686660767,0.3174847364425659,-0.35950881242752075,-0.18004687130451202,-0.31736502051353455,-0.17857733368873596,0.23575669527053833,0.9159373044967651,0.2646183967590332,1.1622544527053833,0.6009469628334045,-0.020364172756671906,0.005769722163677216,0.3249523639678955,0.10982750356197357,-0.18247875571250916,-0.018897704780101776,-0.3283432722091675,0.06723657250404358,-0.18632438778877258,0.016186058521270752,-0.299119770526886,0.27416902780532837,-0.4262268543243408,-0.17139290273189545,1.6794452667236328,0.958503246307373,0.46273133158683777,0.3776611387729645,0.4485767185688019,0.4364531934261322,0.14672908186912537,-1.850408911705017,0.0067354487255215645,-0.7456330060958862,0.5802070498466492,0.3341884911060333,-0.7816597819328308,0.8321707248687744,-0.13638745248317719,-0.02185065858066082,-0.4651019871234894,-0.46033725142478943,-0.7211554050445557,-0.36014968156814575,-0.14086481928825378,-0.5944161415100098,0.8056583404541016,-0.7071620225906372,0.3785657584667206,-0.332245409488678,-0.09814120084047318,0.4233565926551819,0.015407413244247437,-0.33447521924972534,-0.4071231186389923,-0.067552350461483,-0.013831926509737968,0.16377918422222137,0.4718702435493469,-0.27083900570869446,-0.020545989274978638,-0.7419271469116211,-0.41673678159713745,-0.10136746615171432,0.2697226405143738,-0.28535905480384827,-0.3748951554298401,-0.7390844821929932,0.034545667469501495,1.644720435142517,-0.009804271161556244,-0.3737269937992096,0.5042737722396851,0.20176424086093903,-0.45157724618911743,-0.029246389865875244,-0.25737810134887695,-0.16420505940914154,0.39507946372032166,-0.6092503666877747,-0.547132134437561,0.49879688024520874,0.050793204456567764,-0.42933282256126404,-0.6348257064819336,-0.5210633873939514,-0.01414722204208374,0.241664320230484,0.07189908623695374,0.6878603100776672,-0.44729337096214294,0.6146893501281738,0.3114408254623413,0.09885749220848083,-2.39998459815979,0.22510097920894623,0.08821532130241394,0.02281942591071129,-0.16851471364498138,-0.39948421716690063,0.4781944751739502,-0.1106119155883789,0.37788909673690796,-0.5341840386390686,1.6657711267471313,0.23619230091571808,-0.16936853528022766,-0.34403157234191895,-0.05048051103949547,0.5156921148300171,-0.5097588300704956,-0.1076057031750679,0.16615211963653564,-0.41826316714286804,-0.09777717292308807,0.4317220151424408,1.4926064014434814,0.4437429904937744,0.6409068703651428,-0.2857368588447571,0.4252455234527588,-0.4507920742034912,-1.395687222480774,0.32343316078186035,-0.14300259947776794,0.17345699667930603,0.6882900595664978,-0.031068190932273865,-0.014234764501452446,0.2588723599910736,0.6380057334899902,-0.10916788876056671,0.21145275235176086,0.41304823756217957,1.875705361366272,0.30104920268058777,-0.14842073619365692,-0.4808446764945984,-0.3084228038787842,-0.2934291660785675,0.12193095684051514,0.18131327629089355,-0.632544219493866,0.30189579725265503,0.13330793380737305,0.1023193746805191,-0.14311614632606506,0.4220004975795746,0.20342287421226501,0.7711853981018066,0.04235168173909187,-0.061884328722953796,1.1321145296096802,-0.16180944442749023,0.008948512375354767,-0.0014485716819763184,-0.1739363670349121,-0.3506462275981903,-0.4292738437652588]}},true]},{"type":"Workflow","content":[{"workflow":{"name":"baml_answer_with_citations","version":"v0.1","steps":[{"name":"Initialize","body":[{"type":"composite","value":[{"type":"registeroperation","value":{"register":"$DSL","value":"class Citation {\n citation_id int\n document_reference string @description(#\\\"The name of the document and the page number that supports the answer e.g., FILENAME: Page [PAGE NUMBER]. This is a reference. You must mention it NO MATTER WHAT.\\\"#)\n relevantTextFromDocument string @alias(\\\"relevantSentenceFromDocument\\\") @description(#\\\"The relevant text from the document that supports the answer. This is part of the citation. You must quote it EXACTLY as it appears in the document with any special characters it contains. You may cite a part of the sentence. The text should be contiguous and not broken up. You may NOT summarize or skip sentences. If you need to skip a sentence, start a new citation instead.\\\"#)\n }\n\n class Answer {\n answersInText Citation[] @alias(\\\"relevantSentencesFromText\\\")\n answer AnswerWithCitations @description(#\\\"An answer to the user's question that MUST cite sources from the relevantSentencesFromText. Like [0]. If multiple citations are needed, write them like [0][1][2].\\\"#)\n }\n\n class AnswerWithCitations {\n brief_introduction Paragraph @description(#\\\"3-4 long sentences. Must use the citations in the text.\\\"#)\n extensive_body Paragraph[] @description(#\\\"At least 3-6 long sentences. The more the better. Must use the citations in the text.\\\"#)\n conclusion Paragraph[] @description(#\\\"1-3 long sentences. Must use the citations in the text.\\\"#)\n }\n\n class Paragraph {\n sentences string[]\n }\n\n class Document {\n file string\n text string\n reference string\n }\n class Context {\n documents Document[]\n question string\n }\n\n function AnswerQuestion(context: Context) -> Answer {\n client ShinkaiProvider\n\n prompt #\\\"\n Out of the given content, do your best to answer the question.\n\n CONTEXT:\n {% for document in context.documents %}\n ----\n DOCUMENT NAME: {{ document.file }}\n PARTIAL TEXT: {{ document.text }}\n DOCUMENT REFERENCE: {{ document.reference }}\n ---\n {% endfor %}\n \n {{ ctx.output_format }}\n\n QUESTION: {{ context.question }}. Citing the references no matter what e.g., [0]. If multiple citations are needed, write them like [0][1][2].\n\n ANSWER:\n {{ _.role(\\\"user\\\") }}\n \\\"#\n }"}},{"type":"registeroperation","value":{"register":"$PARAM","value":"context"}},{"type":"registeroperation","value":{"register":"$FUNCTION","value":"AnswerQuestion"}},{"type":"registeroperation","value":{"register":"$RESULT","value":{"name":"baml_inference","args":[{"type":"register","value":"$INPUT"},{"type":"string","value":""},{"type":"string","value":""},{"type":"register","value":"$DSL"},{"type":"register","value":"$FUNCTION"},{"type":"register","value":"$PARAM"}]}}}]}]}],"raw":"\n workflow baml_answer_with_citations v0.1 {\n step Initialize {\n $DSL = \"class Citation {\n citation_id int\n document_reference string @description(#\\\"The name of the document and the page number that supports the answer e.g., FILENAME: Page [PAGE NUMBER]. This is a reference. You must mention it NO MATTER WHAT.\\\"#)\n relevantTextFromDocument string @alias(\\\"relevantSentenceFromDocument\\\") @description(#\\\"The relevant text from the document that supports the answer. This is part of the citation. You must quote it EXACTLY as it appears in the document with any special characters it contains. You may cite a part of the sentence. The text should be contiguous and not broken up. You may NOT summarize or skip sentences. If you need to skip a sentence, start a new citation instead.\\\"#)\n }\n\n class Answer {\n answersInText Citation[] @alias(\\\"relevantSentencesFromText\\\")\n answer AnswerWithCitations @description(#\\\"An answer to the user's question that MUST cite sources from the relevantSentencesFromText. Like [0]. If multiple citations are needed, write them like [0][1][2].\\\"#)\n }\n\n class AnswerWithCitations {\n brief_introduction Paragraph @description(#\\\"3-4 long sentences. Must use the citations in the text.\\\"#)\n extensive_body Paragraph[] @description(#\\\"At least 3-6 long sentences. The more the better. Must use the citations in the text.\\\"#)\n conclusion Paragraph[] @description(#\\\"1-3 long sentences. Must use the citations in the text.\\\"#)\n }\n\n class Paragraph {\n sentences string[]\n }\n\n class Document {\n file string\n text string\n reference string\n }\n class Context {\n documents Document[]\n question string\n }\n\n function AnswerQuestion(context: Context) -> Answer {\n client ShinkaiProvider\n\n prompt #\\\"\n Out of the given content, do your best to answer the question.\n\n CONTEXT:\n {% for document in context.documents %}\n ----\n DOCUMENT NAME: {{ document.file }}\n PARTIAL TEXT: {{ document.text }}\n DOCUMENT REFERENCE: {{ document.reference }}\n ---\n {% endfor %}\n \n {{ ctx.output_format }}\n\n QUESTION: {{ context.question }}. Citing the references no matter what e.g., [0]. If multiple citations are needed, write them like [0][1][2].\n\n ANSWER:\n {{ _.role(\\\"user\\\") }}\n \\\"#\n }\"\n $PARAM = \"context\"\n $FUNCTION = \"AnswerQuestion\"\n $RESULT = call baml_inference($INPUT, \"\", \"\", $DSL, $FUNCTION, $PARAM)\n }\n } @@official.shinkai\n ","description":"Generates an answer to a question with citations from the provided content using BAML. The answer includes quotes from the content as citations.","author":"@@official.shinkai","sticky":false},"embedding":{"id":"","vector":[0.3797622621059418,0.055756017565727234,-0.3101310729980469,-0.1303926408290863,-0.2349807769060135,-0.3620940148830414,-1.4513840675354004,0.4004634618759155,-0.09126128256320953,-0.2862396240234375,-0.21521227061748505,0.5031366348266602,0.5290755033493042,-0.1413222849369049,0.6188375949859619,0.38532504439353943,-0.11255966126918793,-0.5313267707824707,-1.018203854560852,0.16118848323822021,0.38974928855895996,0.26705488562583923,0.7251760363578796,0.3977380394935608,-0.11609482020139694,0.06196017935872078,0.13894720375537872,-0.2236107438802719,-1.2703726291656494,-1.2511805295944214,0.48944661021232605,0.2941161096096039,-0.36227738857269287,-0.2411549985408783,-0.49036508798599243,-0.4147837460041046,0.3464353680610657,-0.19157636165618896,-0.10052890330553055,0.33582234382629395,-0.34775447845458984,0.04653438180685043,0.608782172203064,-0.3258453607559204,-0.12086259573698044,-0.3823518753051758,1.0109241008758545,-0.23640067875385284,0.7499700784683228,0.8023027181625366,-0.3843623101711273,-0.3905274569988251,0.27414560317993164,0.29860666394233704,-0.4371856153011322,0.23716586828231812,0.04210366681218147,0.3562734127044678,-0.331453800201416,0.11200998723506927,0.37262940406799316,-0.3658697307109833,-3.935379981994629,0.14438453316688538,0.6308651566505432,0.21387910842895508,0.28002044558525085,-0.16130675375461578,-0.8150539994239807,-0.4389743506908417,-0.06972597539424896,-0.5424433946609497,-0.7765288949012756,0.5558378100395203,0.3599364161491394,-0.4887274503707886,-0.0007520616054534912,0.05174863338470459,0.590337872505188,-0.384021520614624,-0.053891345858573914,0.3669104278087616,-0.2317630499601364,0.25666916370391846,-0.7620011568069458,0.30930858850479126,-0.21822401881217957,-0.643441379070282,0.44276541471481323,0.660913348197937,-0.4575757086277008,-0.2502431869506836,0.15478183329105377,0.38664811849594116,-0.08887406438589096,0.2539937496185303,-0.03916637599468231,-0.5154840350151062,0.5459664463996887,2.9898178577423096,0.2672237455844879,-0.37507301568984985,0.8107877373695374,-0.5531704425811768,0.7260451912879944,-0.15623879432678223,0.3055795431137085,0.1754366159439087,0.09581713378429413,0.44947704672813416,0.31352749466896057,-0.28868404030799866,-0.5385019779205322,0.33680713176727295,-0.21201713383197784,0.7001216411590576,-0.7345210313796997,0.1426507532596588,0.11188594251871109,0.6378754377365112,0.36010265350341797,0.19299772381782532,-0.19160330295562744,-0.1184423640370369,0.14750339090824127,0.23624475300312042,0.017083611339330673,0.2653906047344208,0.2514684498310089,0.19559024274349213,0.5418351888656616,0.1569286286830902,-0.7294088006019592,0.328125923871994,0.02290940470993519,0.16350258886814117,1.043413758277893,-1.032653570175171,0.9681538343429565,-0.8715519309043884,0.21746881306171417,-1.6401642560958862,0.9072688221931458,0.3240673542022705,0.19921818375587463,-0.22009170055389404,-1.024997353553772,0.3806820213794708,-0.39549684524536133,-0.42126455903053284,-0.37500330805778503,0.12471919506788254,-0.46238279342651367,-0.11431951820850372,0.43173450231552124,-0.08136603981256485,-0.7753247022628784,-0.15560556948184967,-0.20577538013458252,0.16913741827011108,-0.24217629432678223,-0.3097689747810364,0.6912097334861755,-0.46705949306488037,-0.23456573486328125,-0.19368106126785278,-0.026194050908088684,0.29294338822364807,0.20618201792240143,0.038728564977645874,-0.313559353351593,-0.3366357088088989,0.00509969238191843,1.1993379592895508,0.15553726255893707,-0.14727765321731567,0.2659122943878174,-0.15252447128295898,0.7438075542449951,-0.1947561800479889,0.5643417239189148,0.5989380478858948,-0.6331312656402588,-0.3168948292732239,-0.23661555349826813,0.7672645449638367,0.46782436966896057,0.2681032121181488,1.418749451637268,1.2327861785888672,-0.46809977293014526,0.8014423847198486,-0.5430251359939575,-0.3643764853477478,0.15952736139297485,0.19020645320415497,0.7295116782188416,-0.0844498723745346,1.010969638824463,0.24072204530239105,0.3357287049293518,0.020911354571580887,0.2755776643753052,0.02969147264957428,-0.01337328553199768,-0.7969410419464111,-0.47564974427223206,0.5079171061515808,-0.5863653421401978,-0.7805141806602478,-0.10677085816860199,-0.8892369270324707,0.7942572236061096,0.6627474427223206,0.47531434893608093,0.3589997887611389,-0.15228474140167236,-0.10162676870822906,-0.11354662477970123,0.2639334201812744,0.07278834283351898,-0.48128312826156616,-0.8211566805839539,-0.2795396149158478,-0.7236523628234863,0.352206289768219,0.01859442889690399,-0.08775120973587036,-0.22070738673210144,-0.48127979040145874,0.36574625968933105,1.7433961629867554,0.982549786567688,1.0124894380569458,0.7370933890342712,0.4407808184623718,-0.21980562806129456,-0.13790135085582733,0.5385861396789551,-0.4323239326477051,-0.2465112805366516,-0.22517752647399902,-0.0271136611700058,0.26054584980010986,0.44240519404411316,-0.9002771377563477,0.22551384568214417,-0.5237748026847839,0.08540594577789307,1.3925650119781494,0.2770116627216339,-0.5225498676300049,0.44990918040275574,-0.1984628587961197,-0.12113264948129654,0.3022267520427704,-1.8065658807754517,-0.3099088966846466,-0.6861429214477539,0.7306676506996155,-0.30434128642082214,-0.2812166213989258,0.7118960618972778,0.04537050053477287,-0.39949703216552734,-0.9633961915969849,-0.8368886113166809,-1.018973708152771,-0.23503834009170532,-0.07855327427387238,-0.4439423978328705,1.099806547164917,-0.6865937113761902,-0.19636347889900208,0.16010379791259766,0.4755159914493561,0.8275705575942993,0.3734543025493622,-0.19382072985172272,-1.1013609170913696,0.4655303955078125,-0.4615223705768585,0.029980260878801346,-0.12803228199481964,-0.6200829744338989,-0.22082911431789398,-0.6129460334777832,-0.440936803817749,-0.12251780182123184,0.25749075412750244,-0.21793797612190247,-0.31565356254577637,-1.0452193021774292,0.48470351099967957,1.489746332168579,0.34717267751693726,-0.11593799293041229,0.5712113380432129,0.37145087122917175,-0.1405247449874878,0.10602741688489914,0.44691920280456543,0.2407248467206955,0.1857607066631317,-0.4698955714702606,-0.6073989272117615,0.003017023205757141,-0.692069411277771,-0.056892529129981995,0.2016339898109436,-0.6986490488052368,-0.4357801079750061,-0.3368676006793976,-0.21542751789093018,0.16499149799346924,-0.49468180537223816,0.7049293518066406,0.35484278202056885,-0.12084715068340302,-2.1006436347961426,0.17676638066768646,1.0268604755401611,-0.1937757432460785,-0.3107340335845947,-0.12163938581943512,0.4608701467514038,-0.5104370713233948,0.41666844487190247,-0.25553765892982483,1.501641869544983,0.391608864068985,-0.5072856545448303,-0.3386199176311493,0.35516029596328735,0.4765162467956543,-0.1931939572095871,-0.04903487116098404,-0.11199391633272171,-0.31363174319267273,-0.16184554994106293,1.0071266889572144,1.2638416290283203,1.3507024049758911,0.7613588571548462,0.4123046398162842,0.2764201760292053,-0.6620365977287292,-0.957791805267334,0.1179533302783966,0.05718009173870087,-0.5120300054550171,0.683925211429596,-0.38944295048713684,-0.40000054240226746,-0.1454511433839798,0.30291903018951416,-0.36079010367393494,-0.48647207021713257,0.13034778833389282,1.8149853944778442,0.11981132626533508,-0.16857168078422546,0.27804651856422424,-0.248652383685112,-0.22382158041000366,-0.02025716006755829,0.23994572460651398,-0.38804712891578674,0.15800036489963531,-0.7771037817001343,0.3905825614929199,-0.7868342995643616,-0.009819000959396362,-0.2602401375770569,0.5894878506660461,0.41537952423095703,0.20397962629795074,0.858824610710144,0.4924372136592865,-0.09800249338150024,0.33428242802619934,-0.15497006475925446,-0.18699677288532257,-0.10839053988456726]}},false]},{"type":"Workflow","content":[{"workflow":{"name":"answer_with_citations_workflow","version":"v0.1","steps":[{"name":"Initialize","body":[{"type":"composite","value":[{"type":"registeroperation","value":{"register":"$FILE_PIECES","value":{"name":"process_embeddings_in_job_scope_with_metadata","args":[]}}},{"type":"registeroperation","value":{"register":"$LLM_INPUT","value":{"name":"generate_json_map","args":[{"type":"string","value":"question"},{"type":"register","value":"$INPUT"},{"type":"string","value":"documents"},{"type":"register","value":"$FILE_PIECES"}]}}},{"type":"registeroperation","value":{"register":"$LLM_RESPONSE","value":{"name":"baml_answer_with_citations","args":[{"type":"register","value":"$LLM_INPUT"}]}}},{"type":"registeroperation","value":{"register":"$JINJA","value":"# Introduction\\n{%- for sentence in answer.brief_introduction.sentences %}\\n{{ sentence }}\\n{%- endfor %}\\n\\n# Main Content\\n{%- if answer.extensive_body | length > 1 %}\\n{%- for part in answer.extensive_body %}\\n### Part {{ loop.index }}\\n{%- for sentence in part.sentences %}\\n{{ sentence }}\\n{%- endfor %}\\n{%- endfor %}\\n{%- else %}\\n{%- for part in answer.extensive_body %}\\n{%- for sentence in part.sentences %}\\n{{ sentence }}\\n{%- endfor %}\\n{%- endfor %}\\n{%- endif %}\\n\\n# Conclusion\\n{%- for section in answer.conclusion %}\\n{%- for sentence in section.sentences %}\\n{{ sentence }}\\n{%- endfor %}\\n{%- endfor %}\\n\\n# Citations\\n{%- for citation in relevantSentencesFromText %}\\n[{{ citation.citation_id }}]: {{ citation.relevantTextFromDocument }} ({{ citation.document_reference }})\\n{%- endfor %}"}},{"type":"registeroperation","value":{"register":"$PROMPT","value":"Apply the following template to the following answer (just give me the answer dont mention anything about a template): "}},{"type":"registeroperation","value":{"register":"$NEW_INPUT","value":{"name":"concat","args":[{"type":"register","value":"$PROMPT"},{"type":"register","value":"$JINJA"},{"type":"register","value":"$LLM_RESPONSE"}]}}},{"type":"registeroperation","value":{"register":"$RESULT","value":{"name":"inference","args":[{"type":"register","value":"$NEW_INPUT"}]}}}]}]}],"raw":"\n workflow answer_with_citations_workflow v0.1 {\n step Initialize {\n $FILE_PIECES = call process_embeddings_in_job_scope_with_metadata()\n $LLM_INPUT = call generate_json_map(\"question\", $INPUT, \"documents\", $FILE_PIECES)\n $LLM_RESPONSE = call baml_answer_with_citations($LLM_INPUT)\n $JINJA = \"# Introduction\\n{%- for sentence in answer.brief_introduction.sentences %}\\n{{ sentence }}\\n{%- endfor %}\\n\\n# Main Content\\n{%- if answer.extensive_body | length > 1 %}\\n{%- for part in answer.extensive_body %}\\n### Part {{ loop.index }}\\n{%- for sentence in part.sentences %}\\n{{ sentence }}\\n{%- endfor %}\\n{%- endfor %}\\n{%- else %}\\n{%- for part in answer.extensive_body %}\\n{%- for sentence in part.sentences %}\\n{{ sentence }}\\n{%- endfor %}\\n{%- endfor %}\\n{%- endif %}\\n\\n# Conclusion\\n{%- for section in answer.conclusion %}\\n{%- for sentence in section.sentences %}\\n{{ sentence }}\\n{%- endfor %}\\n{%- endfor %}\\n\\n# Citations\\n{%- for citation in relevantSentencesFromText %}\\n[{{ citation.citation_id }}]: {{ citation.relevantTextFromDocument }} ({{ citation.document_reference }})\\n{%- endfor %}\"\n \n $PROMPT = \"Apply the following template to the following answer (just give me the answer dont mention anything about a template): \"\n $NEW_INPUT = call concat($PROMPT, $JINJA, $LLM_RESPONSE) \n $RESULT = call inference($NEW_INPUT)\n }\n } @@official.shinkai\n ","description":"Generates an answer to a question with citations from the provided content using RAG workflow.","author":"@@official.shinkai","sticky":false},"embedding":{"id":"","vector":[0.302041232585907,0.6495791673660278,-0.16463279724121094,0.27348119020462036,-0.3640792667865753,-0.11759210377931595,-1.3377487659454346,0.2906632423400879,0.2659119963645935,0.0064449855126440525,-0.2225845754146576,0.7155923247337341,0.2863701581954956,0.013627946376800537,0.37820589542388916,0.4598727524280548,-0.10306946933269501,-0.6235101819038391,-1.3434779644012451,0.01579219475388527,0.563793957233429,0.4702529311180115,0.24035745859146118,0.08729343116283417,-0.1935933530330658,0.4073832631111145,0.22304141521453857,-0.16020876169204712,-1.2370494604110718,-1.8152098655700684,0.32133832573890686,0.5529523491859436,-0.47941479086875916,-0.2894234359264374,-0.22529128193855286,-0.6637700796127319,0.038934219628572464,-0.11896584928035736,-0.6196734309196472,0.3092517852783203,-0.017506450414657593,0.29310837388038635,0.2966788709163666,0.11765111237764359,0.5300358533859253,-0.6917188167572021,0.4312555491924286,-0.34250134229660034,0.3841196596622467,0.25088948011398315,-0.7944143414497375,-0.686835527420044,0.4505968391895294,0.30513784289360046,-0.24635744094848633,0.22689467668533325,0.5774812698364258,-0.17809458076953888,0.3844796121120453,-0.10836978256702423,0.4342154264450073,0.08909395337104797,-4.313159465789795,0.42584100365638733,0.14493651688098907,0.08237434923648834,0.3053835928440094,-0.2510621249675751,-0.26908355951309204,0.05084872245788574,-0.20760825276374817,-0.2481420487165451,-0.20238164067268372,0.025295820087194443,0.051211945712566376,-0.30147409439086914,-0.2935594916343689,-0.11286266148090363,0.3743446469306946,-0.5593183636665344,-0.17406244575977325,0.6305493712425232,-0.05546174198389053,-0.06269138306379318,-0.7509041428565979,0.3297814726829529,-0.4034028947353363,-0.2742491364479065,0.34146708250045776,0.5505414009094238,-0.5094859600067139,-0.09207914769649506,0.3118738830089569,-0.27273064851760864,-0.351421594619751,0.12499718368053436,0.02875395491719246,0.37674230337142944,0.3279470205307007,3.104065179824829,0.1853073239326477,-0.6978022456169128,0.8353964686393738,-0.6210517287254333,0.299731969833374,-0.2903611361980438,0.34038618206977844,-0.16563871502876282,0.27116236090660095,0.6264962553977966,0.3312639594078064,-0.5524058938026428,-0.25126639008522034,0.48475781083106995,0.27730247378349304,0.22434116899967194,-0.5458792448043823,0.20768611133098602,-0.3331827223300934,1.0173496007919312,-0.048498235642910004,-0.07441143691539764,-0.47644293308258057,-0.37685298919677734,0.2681230902671814,0.27811694145202637,0.027686040848493576,0.14175771176815033,0.3515598177909851,0.43409720063209534,0.5166351795196533,-0.4411574900150299,-0.823940634727478,-0.2513667643070221,-0.3378399610519409,0.3593744933605194,1.012085199356079,-0.8341009616851807,0.41486555337905884,-0.8454400897026062,0.045630961656570435,-1.0219558477401733,0.6480528116226196,-0.022864188998937607,0.5243897438049316,-0.09312224388122559,-0.7185470461845398,0.454501748085022,-0.5255737900733948,-0.05204040929675102,-0.3932226300239563,0.21987518668174744,-0.18833470344543457,0.1750001460313797,0.7764050960540771,-0.08508025854825974,-0.4201195240020752,-0.027372032403945923,-0.5477855801582336,0.5084601044654846,-0.27074211835861206,-0.3358495533466339,0.37030738592147827,-0.1664036065340042,0.30039411783218384,-0.16436031460762024,0.26987943053245544,-0.07586002349853516,0.20720936357975006,-0.33640843629837036,0.14486727118492126,-0.058277927339076996,0.08135819435119629,0.6479024887084961,-0.39269688725471497,0.25529712438583374,0.09676061570644379,0.03970225900411606,-0.0051755160093307495,-0.3197023868560791,0.7519499659538269,0.39787548780441284,-0.5427854061126709,-0.2278692126274109,-0.13041603565216064,0.7266638278961182,0.39746806025505066,0.35260921716690063,0.8904515504837036,0.9481697082519531,-0.534455418586731,1.077448844909668,-0.4851692318916321,0.09174691140651703,0.40167665481567383,0.011938601732254028,0.209327831864357,0.19621434807777405,0.9554470777511597,-0.17806030809879303,0.4127517342567444,0.34222567081451416,0.34531280398368835,0.0028178244829177856,0.08940697461366653,-0.48655739426612854,-0.11633729934692383,0.4609406292438507,-0.5707967281341553,-0.7172647714614868,-0.15549525618553162,-0.6388192176818848,0.9782460927963257,0.5757883191108704,0.4868878126144409,0.5279903411865234,-0.03237190097570419,-0.2205381691455841,0.16652852296829224,0.643582284450531,-0.2677132189273834,0.06080951169133186,-0.13484515249729156,-0.4923725724220276,-0.516819179058075,0.6620203852653503,0.07592541724443436,0.07159370183944702,0.06254155933856964,-0.5057934522628784,0.0764768123626709,1.0371267795562744,0.624696671962738,1.128337025642395,0.6512643098831177,0.3021669387817383,-0.4556947946548462,0.05481366068124771,0.30271732807159424,-0.613541305065155,0.12894059717655182,-0.10522378981113434,0.21463046967983246,-0.07597915828227997,0.36100587248802185,-0.7120083570480347,-0.252541184425354,-0.6509837508201599,0.09734252095222473,1.7409844398498535,0.018263503909111023,-0.38902392983436584,0.6623021960258484,0.26024848222732544,0.12274602800607681,0.2705548107624054,-1.983655333518982,-0.34808245301246643,-0.44870463013648987,0.8398820161819458,0.3027595579624176,-0.3285507261753082,0.8434791564941406,0.18463754653930664,-0.02081805095076561,-0.5282495617866516,-0.626075804233551,-0.9119731187820435,-0.0012827664613723755,-0.09766072779893875,-0.7564650774002075,0.7809023857116699,-0.6776382327079773,0.04063400253653526,-0.08290590345859528,0.14572179317474365,0.5667208433151245,0.3448168635368347,-0.5389902591705322,-0.8892549276351929,0.4638209342956543,-0.35105016827583313,-0.6134374141693115,0.05028517544269562,-0.3464180827140808,-0.25418758392333984,-0.7385156154632568,-0.05664042383432388,-0.23391547799110413,0.09158208966255188,-0.17262275516986847,-0.6692696213722229,-0.9896000623703003,0.6646811962127686,1.926600694656372,0.29630979895591736,0.04862155020236969,0.4683615267276764,0.31428056955337524,-0.5492845177650452,0.5060234665870667,0.14091579616069794,-0.30021777749061584,-0.13741666078567505,-0.7438650131225586,0.02209792286157608,0.4707602262496948,-0.4167380928993225,0.15437601506710052,0.48597821593284607,-0.5394192337989807,-0.09873858839273453,-0.10803239047527313,0.30014458298683167,0.3251103162765503,-0.39479196071624756,0.14275161921977997,0.3502808213233948,-0.34477901458740234,-2.357520818710327,0.013839280232787132,0.7088819146156311,-0.12972787022590637,-0.15496616065502167,-0.1557634323835373,0.5408610105514526,0.042263880372047424,0.21417298913002014,-0.45165085792541504,1.2327648401260376,0.5347790122032166,-0.3049626052379608,-0.43793389201164246,0.17141607403755188,0.9914730787277222,-0.23269782960414886,0.4983164072036743,-0.12929704785346985,-0.021774105727672577,-0.49563103914260864,0.6341679096221924,1.1403045654296875,0.5469133853912354,0.6069785356521606,-0.11656582355499268,0.21336913108825684,-0.5077071785926819,-1.2154546976089478,0.09518444538116455,0.06945158541202545,-0.6196871399879456,0.7504529356956482,-0.3938862979412079,-0.6696345806121826,-0.11530251801013947,0.42651259899139404,0.06762523949146271,-0.014222238212823868,-0.08163487166166306,1.8882081508636475,-0.18455733358860016,-0.29645416140556335,-0.11717289686203003,-0.2683551609516144,-0.560032069683075,0.3953476548194885,0.10460548102855682,-0.22123202681541443,0.167826309800148,-0.23793259263038635,0.37224283814430237,-0.7192226648330688,-0.13425150513648987,-0.3594304323196411,0.244207501411438,0.08292294293642044,0.3012055456638336,1.0009146928787231,0.4970721900463104,-0.14509020745754242,0.24888360500335693,-0.2440701127052307,-0.43989014625549316,0.009084545075893402]}},true]}]"###;