diff --git a/py/src/braintrust/integrations/bedrock_runtime/cassettes/1.34.116/test_wrap_bedrock_invoke_model_cohere_embedding_summarizes_vectors.yaml b/py/src/braintrust/integrations/bedrock_runtime/cassettes/1.34.116/test_wrap_bedrock_invoke_model_cohere_embedding_summarizes_vectors.yaml new file mode 100644 index 000000000..89e025990 --- /dev/null +++ b/py/src/braintrust/integrations/bedrock_runtime/cassettes/1.34.116/test_wrap_bedrock_invoke_model_cohere_embedding_summarizes_vectors.yaml @@ -0,0 +1,42 @@ +interactions: +- request: + body: '{"texts": ["hello", "hi"], "input_type": "search_document"}' + headers: + Accept: + - !!binary | + YXBwbGljYXRpb24vanNvbg== + Content-Length: + - '59' + Content-Type: + - !!binary | + YXBwbGljYXRpb24vanNvbg== + User-Agent: + - !!binary | + Qm90bzMvMS4zNC4xMTYgbWQvQm90b2NvcmUjMS4zNC4xMTYgdWEvMi4wIG9zL2xpbnV4IzYuMTgu + NTQuMS1taWNyb3NvZnQtc3RhbmRhcmQtV1NMMiBtZC9hcmNoI3g4Nl82NCBsYW5nL3B5dGhvbiMz + LjE1LjIgbWQvcHlpbXBsI0NQeXRob24gY2ZnL3JldHJ5LW1vZGUjbGVnYWN5IEJvdG9jb3JlLzEu + MzQuMTE2 + method: POST + uri: https://bedrock-runtime.us-east-1.amazonaws.com/model/cohere.embed-english-v3/invoke + response: + body: + string: '{"id":"131b4157-0062-4cd7-a9a2-e64ef69294f3","texts":["hello","hi"],"embeddings":[[-0.0013389587,0.016448975,-0.03665161,-0.06262207,0.009887695,-0.016708374,-0.027770996,0.0022392273,-1.7547607E-4,0.05154419,-0.025726318,-0.027191162,0.030685425,-0.03265381,0.020095825,-1.296997E-4,0.038482666,0.03527832,0.0056152344,-0.013305664,-0.04949951,0.023483276,-0.021072388,0.021621704,0.035705566,0.030578613,-0.005607605,-0.0010538101,-0.027496338,-0.03579712,0.007820129,0.007827759,0.028442383,0.02532959,-6.2942505E-4,0.066345215,-0.018569946,-0.004386902,0.008239746,0.0036392212,0.02670288,-0.02571106,-0.07537842,-0.029907227,-0.07684326,-0.027420044,-5.7697296E-4,0.0043182373,0.029083252,-0.028411865,-0.0012807846,0.00491333,-0.0075302124,0.062286377,-0.01802063,0.008476257,-0.060913086,-0.01612854,-0.0011062622,0.0340271,0.027313232,-0.008323669,0.04034424,0.045288086,-0.032043457,-0.034301758,0.007621765,0.0038337708,0.012390137,-0.017623901,-0.010971069,0.005870819,-0.01550293,-0.013092041,-0.0058288574,0.027160645,0.0036315918,0.009735107,0.004951477,-0.008460999,-0.07598877,-0.0050468445,-0.06591797,-0.057739258,0.027832031,0.014472961,-0.027511597,-0.019821167,-0.017486572,-0.033691406,-0.023895264,0.01852417,0.026245117,0.027923584,-0.028015137,-6.4468384E-4,0.009567261,0.023834229,-0.013076782,0.0070648193,-0.046783447,-0.013038635,-0.03152466,-0.024017334,-0.0049972534,0.020629883,-0.007217407,-0.0132751465,0.04284668,0.058563232,3.1530857E-5,0.06036377,0.0016098022,0.0236969,-0.00680542,-0.0020828247,-0.0026550293,-0.006587982,-0.041992188,0.03152466,0.03353882,0.03765869,-0.0178833,0.0035190582,-0.03475952,8.249283E-4,-0.014595032,-0.034484863,0.0546875,-0.025360107,-0.02255249,0.043792725,-0.123413086,-0.048736572,-0.014862061,0.0048294067,-0.007522583,-0.061401367,0.0140686035,-0.009902954,0.048675537,-0.0033035278,0.007041931,0.015655518,-0.045043945,0.015296936,-0.005268097,-2.169609E-4,0.007904053,-0.0011405945,-0.06262207,-0.02798462,0.0029907227,0.043884277,-0.0037574768,0.08770752,-0.02104187,0.034179688,-0.017608643,0.059570312,0.011520386,-0.00472641,0.019943237,-0.05078125,-0.03302002,0.017120361,-0.014930725,0.0075683594,0.016967773,0.06561279,-0.011917114,0.023101807,0.0018959045,0.026397705,0.016571045,-0.010955811,-0.018127441,0.012001038,0.046325684,-0.007648468,0.026473999,-0.013549805,-0.021697998,0.09106445,-0.04562378,-0.0637207,0.027709961,-0.016998291,0.01940918,0.008842468,0.05343628,-0.0046081543,-0.013824463,-0.021392822,-0.0026931763,-0.045440674,-0.0049743652,-0.00655365,-0.0049552917,0.032958984,0.0060806274,-0.017471313,0.021713257,-0.02255249,0.016784668,-0.03375244,0.010040283,0.008666992,0.012382507,0.026107788,0.0034103394,-0.014205933,0.012214661,-0.06488037,-0.030090332,-0.050445557,-0.07745361,-0.011253357,-0.028671265,0.049224854,0.017974854,-0.009681702,-0.0043563843,0.0015392303,-0.00737381,0.017654419,-0.046295166,-0.0027770996,-0.057861328,0.0046844482,0.010925293,0.0129852295,-0.018569946,-0.027053833,-0.043670654,-0.013511658,0.0025367737,0.04449463,0.008636475,0.0064888,2.2315979E-4,0.01260376,-0.02279663,0.0054473877,0.051086426,0.0236969,0.018127441,0.0064811707,0.018875122,0.008148193,0.010246277,-0.028015137,0.046081543,-0.0063056946,0.002445221,0.054016113,0.012290955,0.012397766,-0.035095215,0.06506348,-0.05267334,0.0051116943,-0.004573822,-0.016906738,-0.058258057,-0.019012451,-0.010185242,0.026916504,6.599426E-4,-0.030639648,0.015075684,0.021102905,-0.037353516,0.0070381165,0.08728027,0.06896973,-0.06414795,-0.009521484,-0.01524353,0.020980835,-0.01235199,0.0073013306,8.8119507E-4,0.019348145,0.040985107,5.302429E-4,-0.013412476,0.004081726,-0.0071792603,0.035491943,0.07885742,0.010917664,-0.006088257,0.041992188,0.031799316,0.03491211,0.0074539185,0.013946533,0.010383606,-0.012130737,-0.027542114,0.036254883,0.022277832,-0.010726929,-0.02444458,0.059295654,0.010803223,0.013809204,0.00674057,-0.033935547,0.038604736,3.7145615E-4,-0.0026359558,0.021148682,-0.028686523,-0.06188965,0.0178833,-0.0053367615,-0.040405273,-0.009552002,0.020584106,0.021484375,-0.06585693,-0.05569458,0.0023040771,0.0065460205,-0.09088135,-0.037109375,-0.06286621,0.01889038,0.05340576,0.0025157928,-0.017944336,-0.031951904,0.016067505,-0.0011177063,0.01979065,-0.008476257,-0.011177063,0.021240234,0.07354736,-0.0101623535,0.021743774,-0.0018844604,0.0026931763,-0.02609253,-0.029632568,0.014839172,-0.017669678,-0.0073051453,0.041809082,-0.05303955,-0.032440186,-0.0025749207,0.053497314,-0.042633057,-6.980896E-4,0.010749817,0.06719971,-0.054626465,0.038726807,-0.0068359375,-0.02545166,-0.05029297,-0.007019043,-0.05065918,5.874634E-4,-0.037841797,-0.042510986,-0.0022220612,0.0066375732,-0.03527832,0.02822876,-0.02368164,-0.07196045,-0.012321472,-0.050445557,-0.06744385,0.0049591064,-0.022567749,0.029708862,0.03878784,0.028793335,0.01852417,0.032562256,0.022735596,-0.011108398,0.022003174,0.05041504,0.027648926,-0.014511108,-0.0015153885,-0.041931152,-0.020050049,0.0047302246,0.012710571,-0.033294678,0.009239197,-0.08862305,0.008125305,-0.007858276,-0.02494812,-0.049713135,-0.020080566,-0.07611084,0.014945984,-0.04623413,-0.038513184,0.023895264,0.06500244,0.016662598,0.04196167,0.03366089,-0.005504608,3.0517578E-4,0.014541626,-0.064208984,0.024124146,0.012649536,0.006046295,-0.019256592,-0.00434494,-0.03488159,0.007801056,-0.028213501,0.04547119,0.006542206,0.048980713,0.039093018,-0.05441284,-0.02319336,-0.04473877,-0.005962372,-0.012512207,-0.043395996,0.045013428,-0.03387451,0.043701172,-0.016571045,-0.021560669,-0.024505615,0.010803223,0.006313324,0.0076026917,-9.613037E-4,-0.010360718,0.026245117,-0.022598267,-0.06359863,0.010025024,-0.080322266,0.0039596558,-0.054748535,0.05923462,-0.009025574,0.04550171,0.032043457,0.024871826,0.0021419525,0.019439697,0.04660034,-0.010673523,-0.06958008,0.007335663,-0.034118652,0.035125732,0.018615723,-2.975464E-4,-0.053253174,-0.011680603,-0.0026931763,-0.007156372,0.029846191,0.005706787,0.0019168854,0.0065231323,-0.022705078,-0.00995636,-0.0048675537,0.015075684,-0.026855469,0.008758545,-0.017181396,-0.074523926,-0.03704834,0.01902771,-0.054901123,0.008171082,-0.013435364,0.015449524,-0.01272583,0.00459671,0.048034668,-0.0524292,-0.038269043,-0.016830444,-0.023284912,-0.008010864,-0.004802704,-0.07116699,-0.079956055,0.00969696,0.03213501,-0.013847351,0.034332275,-0.06036377,-0.019927979,0.0234375,0.049316406,0.029571533,0.041259766,0.007583618,-0.010505676,0.015945435,-0.017211914,0.045654297,0.027297974,0.007633209,0.009002686,-0.014480591,0.0013523102,-0.009651184,0.054870605,0.023010254,5.0735474E-4,0.014343262,0.0035629272,0.022994995,-0.019363403,-0.055145264,0.028289795,0.02204895,0.029586792,0.01058197,-0.021896362,0.041748047,-0.027542114,0.014587402,0.0357666,-0.014015198,-0.0023422241,-4.1007996E-4,-0.04486084,-0.009429932,0.021224976,-0.016662598,0.032226562,0.09082031,-0.034332275,0.08843994,0.020324707,-0.035064697,0.055145264,0.010223389,-0.038330078,-0.048461914,-0.024246216,-0.01209259,-0.020004272,0.024856567,0.0073394775,-0.021133423,-0.039367676,0.012588501,-0.01966858,-0.0056762695,0.04336548,-0.0051193237,0.0041503906,0.0015478134,-0.016342163,-0.025405884,-0.0032863617,-0.022537231,-0.015853882,0.012664795,0.0010299683,0.010681152,0.00504303,0.012466431,0.0023727417,0.00390625,-0.044189453,0.012268066,0.0055007935,0.0079422,0.0064926147,-0.028579712,0.008735657,0.018798828,0.016815186,-0.036132812,-0.00819397,-0.0036716461,0.03237915,0.009300232,0.0141067505,-0.06878662,-0.013046265,7.686615E-4,-0.040863037,0.001947403,0.031082153,-0.04019165,-0.010177612,0.033050537,-0.03225708,0.02645874,0.009674072,0.0036945343,-5.874634E-4,-0.022857666,-0.010932922,0.031311035,-0.0076179504,-5.226135E-4,0.03845215,0.025054932,-0.0015602112,-0.012145996,-0.0054893494,-0.0031280518,0.03353882,-0.004886627,0.026931763,-0.046722412,0.038757324,0.009284973,0.0047073364,-0.0018672943,0.01727295,0.010543823,-0.0046195984,-0.06970215,0.01586914,0.08526611,-0.020690918,0.002544403,-0.07293701,0.017974854,0.0038757324,-0.020446777,-0.012702942,-0.016555786,-0.044952393,-0.053894043,-0.017684937,-0.010856628,-0.03829956,0.030761719,0.012496948,0.030593872,0.014129639,-0.010414124,0.0052375793,0.023651123,0.013191223,0.054840088,-0.014175415,-0.045715332,0.040100098,0.03894043,-0.01448822,-0.025634766,0.025848389,-0.01651001,0.053649902,0.053527832,-0.0024337769,-0.008331299,0.015808105,0.009231567,-0.013793945,-0.026809692,-0.015365601,0.015274048,0.039367676,0.018798828,0.039489746,-0.0077438354,-0.0357666,-0.041748047,0.007709503,0.015625,-0.032104492,-0.001947403,0.0418396,0.03060913,0.008285522,-0.033355713,-0.06616211,-0.010467529,-0.009727478,-0.03930664,0.002243042,0.010368347,-0.033203125,-0.03062439,-0.003370285,0.028213501,0.030349731,-0.043060303,0.06604004,-0.051116943,0.028503418,-0.01663208,-0.049682617,-0.031585693,0.007911682,0.02960205,-0.006969452,0.0074768066,-0.025039673,6.5898895E-4,-0.0025978088,-0.05621338,-0.03387451,-0.005393982,-0.02041626,-0.013870239,-0.02279663,-0.03012085,0.038635254,0.0020179749,0.04373169,0.012252808,-0.047210693,0.005065918,0.016021729,0.0011539459,0.009262085,0.028381348,-0.0078086853,-0.0107421875,-0.0084991455,0.0015411377,0.0029964447,0.0068359375,0.009109497,0.019424438,-0.046173096,0.0027236938,0.032806396,0.037261963,9.3078613E-4,0.04888916,-0.0017738342,0.04067993,-0.03878784,7.638931E-4,-0.012420654,0.017990112,0.017440796,-0.047088623,-0.03503418,-0.08465576,-0.04348755,0.01612854,0.03579712,-0.016326904,-0.024429321,-0.017868042,-0.0051612854,0.036468506,0.023727417,0.0546875,0.011421204,0.011520386,0.011238098,-6.866455E-5,0.08685303,0.045776367,0.011360168,-0.044067383,-0.04257202,0.0016708374,0.012817383,-0.029449463,0.0045394897,-0.0014152527,-2.6130676E-4,0.00856781,-0.0075263977,0.014343262,-0.01576233,-0.053375244,0.047912598,0.023040771,0.021118164,0.06567383,-0.016815186,0.04425049,0.00434494,0.049468994,0.05130005,-0.02659607,0.01828003,0.013771057,0.03488159,-0.021347046,-0.0062561035,0.0071640015,-0.010681152,0.0031929016,-0.01876831,-0.043273926,-0.018341064,0.047790527,0.01171875,0.02508545,0.0063171387,-0.019241333,-0.04421997,0.0058250427,-0.016448975,0.01953125,0.037902832,-0.021392822,0.025665283,-0.027694702,-0.055725098,0.030578613,0.02017212,-0.022918701,-0.0287323,0.032714844,0.03475952,-0.0010566711,-0.0010633469,0.06939697,0.060455322,0.011207581,-0.012382507,0.027252197,0.020935059,-0.025543213,-0.023864746,-0.026977539,0.027282715,-0.008430481,0.02015686,0.0029277802,0.025680542,0.0049972534,-0.008804321,0.028717041,0.015914917,-0.02168274,0.025619507,0.014678955,0.047027588,0.049316406,0.0058631897,-0.054748535,0.039001465,0.033203125,0.032104492,-0.05532837,1.8501282E-4,-0.015365601,-0.019317627,0.012496948,-0.056365967,-0.012168884,0.032196045,-0.0052337646,-0.03250122,-0.0025901794,-0.019851685,0.0031661987,0.010284424,0.022872925,0.023544312,-0.025024414,-0.01739502,-0.007888794,0.026611328,-0.06695557,0.030914307,0.032073975,0.013420105,0.009475708,0.017044067,0.0078125,-0.019454956,-0.025268555,-0.027282715,0.039215088,-0.0096588135,-0.00819397,0.044525146,-0.03137207,-0.0010089874,0.030395508,-0.03817749,-0.0051193237,0.0026283264,0.0132369995,-0.016204834,-0.005756378,-0.0012130737,-0.03579712,0.008613586,0.0053710938,-0.026550293,0.019958496,0.03591919,0.0034236908,-0.016662598,-0.035247803,0.02558899,-0.005760193,-0.008041382,0.024932861,-0.016479492,0.0079956055,-0.0491333,-0.028289795,0.0010490417,-0.07196045,-0.017852783,-0.011222839,0.008972168,-0.037506104,-0.056427002,0.026000977,-0.055664062,-0.03152466,-0.028427124,0.0032196045,-0.009338379,-0.027236938,-0.04751587,-2.7275085E-4,-0.002090454,-0.044067383,-0.015205383,-0.032104492,-0.0016822815,-0.0368042,-0.031707764,0.004131317,0.0015296936,0.057861328,-0.058807373,0.033325195,-0.01991272,-0.035949707,-0.02645874,-0.03050232,0.024887085,-0.033843994,-0.025634766,0.012512207,0.0014915466,0.06628418,-0.051605225,-0.0552063,-0.02557373,-0.020324707,-0.016448975,0.06109619,0.046417236,-0.0027236938,-0.07696533,0.010398865,-0.04434204,0.02015686,0.034729004,-0.011505127,-0.0054244995,-0.014854431,-0.021408081,-0.0053253174,0.006149292,-0.029953003,0.019836426,-9.822845E-4,-0.035705566,0.035217285,-0.029571533,0.056610107,0.005580902,0.045562744,-0.0395813,0.07385254,-0.043640137,-0.020431519,0.03665161,-0.0033016205,-0.018005371,0.020874023,-0.038635254,-0.05456543,0.052093506,-6.5231323E-4,0.01763916,-0.010421753,0.06512451,0.016036987,-0.030334473,0.0096588135,0.02784729,0.019012451,-5.950928E-4,-0.03540039,0.008621216,-0.02607727,-0.009902954,-0.080322266,-0.04537964,0.04046631,-0.004421234,-0.042053223,0.021453857,-0.028869629,-0.013465881,-0.020980835,-0.019866943,-0.051757812,-0.04107666,0.0011444092,-0.0055389404,0.020889282],[0.0034828186,3.33786E-4,-0.02420044,-0.06829834,0.0016040802,-0.012207031,-0.031555176,0.006526947,0.00944519,0.070007324,-0.032714844,-0.020462036,0.026443481,-0.011947632,0.0037555695,0.007926941,0.016647339,0.05041504,0.0135650635,-0.02734375,-0.046691895,0.0036010742,-0.040039062,-0.00365448,0.041870117,0.04660034,-0.044891357,0.0018615723,-0.028366089,-0.03857422,0.00447464,0.02619934,0.046539307,0.0033359528,-0.020874023,0.028564453,-0.012649536,-0.023590088,-0.011581421,0.010925293,0.018157959,-0.011169434,-0.08276367,-0.015235901,-0.09259033,-0.030044556,-0.0074882507,0.01525116,0.025360107,-0.007904053,0.011764526,-0.0047912598,-0.0049362183,0.038726807,-0.01789856,-0.008331299,-0.068603516,0.010482788,0.0068588257,0.01360321,0.018692017,-0.015777588,0.05291748,0.06323242,-0.035247803,-0.032104492,-0.022964478,0.019042969,0.021194458,-0.03338623,-0.027069092,0.0047836304,0.006340027,-0.005264282,-0.016647339,0.017501831,0.043701172,0.042510986,-0.013710022,-0.0206604,-0.064086914,-0.0013275146,-0.042114258,-0.024353027,0.014564514,0.0284729,-0.021911621,-0.03955078,-0.0041389465,-0.036621094,-0.012954712,0.004135132,0.028442383,0.05291748,-0.02709961,0.011657715,-0.02444458,-0.0074691772,-0.024597168,2.5177002E-4,-0.015792847,-0.01826477,-0.035827637,-0.019180298,-0.019378662,-0.0033111572,-0.01499176,-3.1661987E-4,0.03778076,0.085632324,-0.009521484,0.056427002,0.0115356445,0.021209717,-0.0049362183,0.020584106,0.020843506,-0.0042495728,-0.030685425,0.023773193,0.059051514,0.041870117,-0.0053215027,0.0046424866,-0.03918457,0.009666443,-0.022567749,-0.04360962,0.042633057,-0.026229858,0.0037956238,0.046142578,-0.15270996,-0.06695557,-0.049713135,0.019134521,0.0029621124,-0.06390381,0.0033493042,0.014602661,0.027664185,0.0011787415,0.029083252,-0.013015747,-0.050567627,0.023910522,0.011650085,-0.016998291,-0.0068893433,-0.0013475418,-0.06298828,-0.033477783,0.026123047,0.03930664,-0.021896362,0.052978516,-0.05279541,0.020553589,-0.017684937,0.044799805,-6.0653687E-4,0.007858276,0.031585693,-0.025131226,-0.0039024353,-0.0030021667,-0.0037078857,0.017425537,0.014923096,0.044281006,-0.015792847,0.012527466,-0.009788513,0.014312744,0.016708374,0.0042762756,-0.012107849,0.03289795,0.052093506,-0.00258255,0.008857727,-0.025360107,0.01020813,0.07128906,-0.051696777,-0.06121826,0.01007843,-0.03010559,0.031402588,0.008903503,0.022369385,-0.014274597,-0.018661499,-0.033813477,-0.020507812,-0.06286621,0.028427124,-0.015098572,-0.0152282715,0.042877197,0.006412506,-0.019683838,0.008964539,-0.026947021,-0.021697998,-0.028533936,-0.0016546249,0.015411377,0.015792847,0.042816162,-0.00283432,7.247925E-5,0.0041999817,-0.031341553,-0.0039596558,-0.03225708,-0.08581543,-0.027374268,-0.012893677,0.0546875,0.038726807,-0.00945282,-0.00333786,0.0038719177,0.016921997,0.0026435852,-0.047943115,-0.016113281,-0.025787354,-0.0054626465,0.011894226,0.028182983,0.004119873,-0.012077332,-0.04107666,-0.015701294,-0.0078048706,0.034118652,0.016098022,0.020248413,-0.0038757324,0.0035705566,-0.024032593,0.0034809113,0.025802612,-0.009223938,0.009300232,0.020507812,0.0035533905,-0.00868988,0.032226562,-0.011566162,0.047790527,-0.024154663,0.015594482,0.05960083,0.01096344,0.0073051453,-0.03967285,0.051940918,-0.038604736,0.007507324,-0.016815186,-0.018707275,-0.034729004,-0.01979065,0.0045776367,0.03189087,0.011459351,-0.028930664,0.006954193,0.010147095,-0.032104492,-0.008964539,0.07318115,0.08050537,-0.039215088,-0.015625,-0.01071167,0.010307312,-0.0062408447,0.010231018,-2.3078918E-4,0.017913818,0.053253174,0.009246826,-0.01474762,-0.006713867,0.021911621,0.05569458,0.07897949,0.018295288,0.011581421,0.040405273,0.044799805,0.040618896,0.04989624,0.017807007,0.022445679,-0.016143799,-0.01626587,0.04486084,0.001408577,-0.0016994476,-0.022613525,0.051330566,-0.0031433105,0.035125732,0.011306763,-0.04284668,0.04309082,0.013977051,0.01586914,-0.017547607,0.009239197,-0.043914795,0.015357971,-1.3875961E-4,-0.052490234,-0.032440186,0.03466797,0.018737793,-0.07476807,-0.050476074,0.008285522,-0.009178162,-0.08129883,-0.03982544,-0.06604004,0.023101807,0.05227661,-0.016464233,-0.025405884,-0.09301758,0.011306763,-0.012145996,0.021972656,-0.012512207,-0.015777588,0.0059776306,0.066711426,0.00724411,0.03250122,-0.0020046234,-0.022567749,-0.020248413,-0.020385742,0.024597168,-0.027999878,-0.019073486,0.064941406,-0.06500244,-0.04748535,0.0051498413,0.0635376,-0.045806885,-0.0039901733,0.012481689,0.07684326,-0.060272217,0.007293701,-0.0033569336,-0.035308838,-0.024398804,0.013687134,-0.062194824,0.0036392212,-0.022857666,-0.018493652,0.014976501,-0.010429382,-0.036010742,0.028503418,-0.0010099411,-0.042266846,0.017562866,-0.058258057,-0.05380249,-0.0077209473,-0.027618408,0.053222656,0.03161621,0.042053223,-0.0062217712,0.053466797,-0.0067825317,-0.014266968,0.04019165,0.05758667,0.037261963,-0.012962341,-0.014732361,-0.034606934,-0.011909485,-0.0043029785,0.009391785,-0.017623901,-0.014572144,-0.085510254,-0.0028381348,0.002008438,-0.02708435,-0.04650879,-0.021102905,-0.07092285,0.026184082,-0.034973145,-0.029205322,0.030273438,0.057861328,0.005622864,0.041931152,0.0040283203,-0.0030574799,-0.00957489,0.02355957,-0.02279663,0.031097412,0.016082764,-0.006149292,-0.012145996,0.0066871643,-0.030883789,0.0011825562,-0.039367676,0.048583984,-0.007858276,0.06427002,0.048461914,-0.06921387,-0.046966553,-0.037597656,-0.004814148,-0.0062446594,-0.038848877,0.046203613,-0.03665161,0.05606079,-0.012641907,-0.032989502,-0.049682617,0.01890564,0.0037651062,-0.002155304,0.001083374,-0.008842468,0.046569824,-0.04953003,-0.03945923,-0.006072998,-0.090026855,0.011024475,-0.03024292,0.04559326,-0.003932953,0.024505615,0.039031982,0.015365601,-0.0031852722,0.009590149,0.03265381,-0.016586304,-0.08093262,-0.009841919,-0.02458191,0.024276733,0.009979248,0.01222229,-0.03656006,-0.03756714,-0.0037231445,0.008270264,0.015319824,-9.441376E-4,0.022766113,-1.6021729E-4,-0.02571106,0.0030555725,-7.276535E-4,0.02204895,-0.008850098,8.087158E-4,-6.198883E-5,-0.0769043,-0.014572144,0.011764526,-0.036865234,0.02784729,-0.011192322,-0.012321472,-0.034454346,0.012290955,0.028518677,-0.048919678,-0.017654419,-0.037963867,-0.025680542,-0.017318726,0.008720398,-0.0569458,-0.07104492,0.03540039,0.0121154785,-0.033081055,0.018676758,-0.057006836,-0.018295288,0.021636963,0.064086914,0.015365601,0.04925537,0.013122559,-0.006931305,0.006454468,-0.023605347,0.07312012,-0.011383057,-0.008300781,0.00605011,-0.011688232,-0.010421753,0.02192688,0.0289917,0.0262146,0.002937317,0.016937256,-0.009994507,0.03640747,-0.016220093,-0.038208008,0.045043945,0.019882202,0.03463745,0.011520386,-0.03387451,0.0519104,-0.012634277,-0.009628296,0.027832031,-0.010002136,0.023925781,0.013572693,-0.04031372,-0.012435913,0.013336182,-0.018554688,0.033691406,0.0814209,-0.022628784,0.06585693,0.027130127,-0.015258789,0.028274536,0.0067367554,-0.020904541,-0.032928467,-0.026901245,-0.018447876,-0.038360596,0.04559326,-3.6239624E-4,-0.010177612,-0.021835327,-0.004196167,0.0066986084,0.006668091,0.035308838,0.0034866333,-0.005130768,-0.012237549,-0.013961792,-0.023895264,0.027313232,-0.030700684,-0.01322937,6.542206E-4,0.028366089,0.008995056,0.0031261444,-0.0049057007,0.010406494,0.0126953125,-0.03918457,0.04949951,0.009384155,0.011253357,0.0012512207,-0.050323486,-0.003616333,0.029037476,0.031280518,-0.022445679,-0.010520935,-0.00409317,0.02897644,0.0058555603,0.04248047,-0.04135132,-0.006336212,0.0030670166,-0.02368164,0.003622055,0.020401001,-0.029632568,-0.030136108,0.021362305,0.009963989,0.03149414,-0.012069702,-0.01889038,0.012573242,0.023010254,0.0019779205,0.0074920654,-0.008720398,-0.019378662,0.018417358,0.03540039,-0.0010471344,-0.01876831,-0.018112183,-0.016967773,0.025787354,-0.004638672,0.0335083,-0.045532227,0.028839111,0.03161621,0.0035152435,-0.004573822,0.011528015,2.5177002E-4,-5.79834E-4,-0.057403564,0.018569946,0.064086914,-0.02166748,-0.011314392,-0.06359863,0.06347656,0.0076026917,-0.037506104,-0.005821228,-0.0049476624,-0.012207031,-0.045928955,0.015106201,0.0101623535,-0.03564453,0.032958984,-0.009155273,0.03491211,-0.0019836426,0.015220642,0.0134887695,0.027709961,-0.016616821,0.06713867,-0.017425537,-0.042419434,0.019836426,0.061676025,-0.0051879883,-0.010848999,0.05026245,-0.0050354004,0.05126953,0.047943115,0.010986328,0.0028381348,-7.829666E-4,-0.008956909,-0.020050049,-0.010513306,-0.03692627,0.03564453,0.04660034,0.015838623,0.024414062,0.0069465637,-0.041992188,-0.058807373,0.027618408,0.028503418,-0.034484863,-0.0014648438,0.042053223,0.014030457,0.0065231323,-0.022979736,-0.05883789,-0.011421204,0.0052261353,-0.019607544,-0.008377075,0.018249512,-0.016723633,-0.022720337,0.0036296844,0.0011825562,0.042663574,-0.03164673,0.0368042,-0.04244995,0.020111084,-0.01235199,-0.03817749,-0.03353882,-0.013313293,0.02078247,-0.015533447,0.023345947,-0.028045654,-0.008041382,-0.014694214,-0.04156494,-0.021728516,0.010757446,0.0044403076,-0.03173828,-0.019714355,-0.0146484375,0.0178833,0.011985779,0.0446167,0.022628784,-0.078063965,0.023590088,0.0051574707,-0.020309448,-0.011566162,0.040039062,-0.023040771,-0.02166748,-0.0030078888,-0.01600647,-0.024093628,0.024261475,0.0016803741,0.01512146,-0.05886841,-0.005317688,0.028060913,0.04019165,-0.00756073,0.06085205,0.0079193115,0.048065186,-0.05029297,-0.004047394,-0.023468018,0.0065307617,-0.01133728,-0.036315918,-0.027679443,-0.05532837,-0.039642334,-7.6675415E-4,0.020599365,-0.007293701,-0.029937744,-0.017150879,-0.005203247,0.037261963,0.011245728,0.036712646,-0.038116455,0.016555786,0.040252686,-0.013198853,0.077819824,0.046081543,0.02407837,-0.028930664,-0.05041504,0.0028152466,-0.0011501312,-0.01361084,0.0071792603,-0.013183594,0.0013809204,0.020187378,0.010421753,0.020935059,-0.008483887,-0.066223145,0.02998352,0.013908386,-0.016433716,0.019424438,-0.01071167,0.08258057,-1.9836426E-4,0.04055786,0.06542969,0.00566864,0.021957397,0.003414154,0.06616211,-0.00932312,-0.010848999,-0.030899048,0.010475159,0.016601562,-0.0078125,-0.019317627,-0.038330078,0.06451416,0.010131836,0.009735107,0.017730713,0.013336182,-0.026748657,0.028564453,-0.04385376,0.04046631,0.04449463,-0.021987915,0.04107666,-0.007858276,-0.060150146,0.027374268,0.0140686035,-0.019836426,-0.05593872,0.047851562,0.041625977,-0.016113281,-0.01676941,0.05923462,0.06713867,-0.0076789856,0.012229919,0.0440979,0.04626465,-0.010826111,-0.0073013306,-0.042541504,0.034973145,-0.0036621094,0.040985107,-0.004470825,0.044921875,0.021499634,-0.014160156,0.044799805,0.019638062,-0.02545166,0.022262573,0.035064697,0.058898926,0.043304443,0.015342712,-0.060546875,0.028457642,0.017456055,0.045166016,-0.05670166,0.008934021,-0.004714966,-0.006072998,0.020996094,-0.06866455,-0.036102295,0.037628174,0.0084991455,-0.02532959,0.003540039,-0.011978149,0.014442444,0.021209717,0.024383545,0.0152282715,-0.011886597,-0.017562866,-0.010513306,0.021331787,-0.06719971,0.034240723,0.030929565,0.011817932,0.00447464,0.02128601,0.014511108,-0.02545166,-0.034301758,-0.029174805,0.028625488,-5.7554245E-4,-0.014175415,0.033172607,-0.007396698,-0.0036315918,0.032287598,-0.033233643,0.010223389,-0.03604126,0.030181885,-0.014457703,-0.0061416626,-0.0065612793,-0.04031372,-0.011779785,0.008331299,0.0042495728,0.016738892,0.03717041,0.012420654,-0.012008667,-0.025863647,0.040130615,0.013923645,0.0050354004,0.011665344,-0.018630981,0.006263733,-0.054626465,-0.036499023,0.004081726,-0.034576416,-0.02935791,-0.013168335,0.012763977,-0.035064697,-0.045532227,0.024398804,-0.042816162,-0.02243042,-0.00579834,-0.003189087,-0.0087509155,-0.022262573,-0.026763916,0.033325195,0.010055542,-0.032562256,0.0065841675,-0.01687622,-9.651184E-4,-0.004890442,-0.019073486,0.015281677,-0.0011291504,0.01701355,-0.0423584,0.046020508,-0.018127441,-0.020828247,-0.04260254,-0.027511597,0.017791748,-0.017044067,-0.029586792,0.016799927,0.0015583038,0.039855957,-0.06713867,-0.03378296,-0.012039185,0.011764526,-0.005836487,0.048095703,0.0115356445,-0.010421753,-0.05496216,0.03363037,-0.029830933,0.009063721,0.012306213,0.0024986267,-0.01574707,-0.014892578,-0.01158905,-7.6293945E-5,0.018936157,-0.053222656,0.02116394,-0.0062179565,-0.037353516,0.025360107,-0.02180481,0.06149292,0.025878906,0.05142212,-0.028366089,0.053985596,-0.025985718,0.0023078918,0.008300781,0.009811401,-0.02909851,-0.0015659332,-0.037139893,-0.05722046,0.037231445,0.0030174255,0.013191223,-0.027511597,0.03692627,0.008285522,-0.008331299,-0.007598877,0.03164673,-0.0023460388,0.013023376,-0.06451416,-0.015853882,-0.018005371,-0.008743286,-0.0647583,-0.0423584,0.039367676,-0.009597778,-0.039978027,0.013298035,-0.030410767,2.7179718E-4,-0.042541504,0.023422241,-0.0440979,-0.030273438,0.019165039,-0.014694214,0.030914307]],"response_type":"embeddings_floats"}' + headers: + Connection: + - keep-alive + Content-Length: + - '25541' + Content-Type: + - application/json + Date: + - Sun, 08 Nov 2026 22:16:23 GMT + X-Amzn-Bedrock-Input-Token-Count: + - '2' + X-Amzn-Bedrock-Invocation-Latency: + - '135' + x-amzn-RequestId: + - 131b4157-0062-4cd7-a9a2-e64ef69294f3 + status: + code: 200 + message: OK +version: 1 diff --git a/py/src/braintrust/integrations/bedrock_runtime/cassettes/1.34.116/test_wrap_bedrock_invoke_model_titan_embedding_logs_token_metrics.yaml b/py/src/braintrust/integrations/bedrock_runtime/cassettes/1.34.116/test_wrap_bedrock_invoke_model_titan_embedding_logs_token_metrics.yaml new file mode 100644 index 000000000..1126cff1f --- /dev/null +++ b/py/src/braintrust/integrations/bedrock_runtime/cassettes/1.34.116/test_wrap_bedrock_invoke_model_titan_embedding_logs_token_metrics.yaml @@ -0,0 +1,42 @@ +interactions: +- request: + body: '{"inputText": "hello", "dimensions": 256}' + headers: + Accept: + - !!binary | + YXBwbGljYXRpb24vanNvbg== + Content-Length: + - '41' + Content-Type: + - !!binary | + YXBwbGljYXRpb24vanNvbg== + User-Agent: + - !!binary | + Qm90bzMvMS4zNC4xMTYgbWQvQm90b2NvcmUjMS4zNC4xMTYgdWEvMi4wIG9zL2xpbnV4IzYuMTgu + NTQuMS1taWNyb3NvZnQtc3RhbmRhcmQtV1NMMiBtZC9hcmNoI3g4Nl82NCBsYW5nL3B5dGhvbiMz + LjE1LjIgbWQvcHlpbXBsI0NQeXRob24gY2ZnL3JldHJ5LW1vZGUjbGVnYWN5IEJvdG9jb3JlLzEu + MzQuMTE2 + method: POST + uri: https://bedrock-runtime.us-east-1.amazonaws.com/model/amazon.titan-embed-text-v2%3A0/invoke + response: + body: + string: '{"embedding":[-0.0944368839263916,0.07884403318166733,0.04861341044306755,0.01253932248800993,0.07099796831607819,-0.06391870975494385,0.016239842399954796,0.0544363409280777,0.027892548590898514,0.017718682065606117,-0.01724734529852867,0.06530170142650604,0.012446895241737366,-0.0947560966014862,-0.020621588453650475,-0.06218312680721283,-0.025729060173034668,-0.06211123615503311,0.08439737558364868,0.005627803970128298,-0.059602007269859314,0.029576780274510384,0.06017368659377098,-0.03541340306401253,-0.05041574686765671,-0.04588508978486061,-0.06186476722359657,-0.061127059161663055,0.015418266877532005,-0.09817847609519958,0.08339351415634155,-0.011714322492480278,-0.015609968453645706,-0.023935282602906227,0.027495453134179115,0.06756959110498428,0.03417761251330376,-0.038919657468795776,-0.021717024967074394,-0.02830333635210991,0.09334144741296768,-0.04973109811544418,-0.010735276155173779,0.03623155876994133,0.005819505546241999,0.06371331214904785,0.03853197395801544,0.05733753740787506,0.07452390342950821,-0.015651045367121696,-0.020662667229771614,0.04120209813117981,-0.077443927526474,0.05051330849528313,-0.012994613498449326,0.02341495081782341,-0.005353945307433605,0.08305118978023529,-0.01673278957605362,0.026016611605882645,0.033561430871486664,-0.013857269659638405,0.06689351052045822,0.0039264545775949955,9.448138880543411E-4,-0.06906726211309433,-0.05759256333112717,0.00979046244174242,-0.001293984125368297,0.010879051871597767,-0.03232307359576225,0.0158290546387434,-0.006490460596978664,-0.08732510358095169,-0.030170712620019913,0.015199178829789162,0.07484568655490875,-0.015883825719356537,-0.10873574763536453,0.13835960626602173,0.028467651456594467,0.009475523605942726,-0.07920004427433014,-0.0175954457372427,0.07230564206838608,-0.005668883211910725,0.0353689007461071,0.07751581817865372,-0.013857697136700153,-0.03776516765356064,-0.027214746922254562,0.0075242784805595875,0.041804589331150055,0.040791310369968414,0.07015242427587509,0.005559339188039303,-0.00955768208950758,-0.0806960016489029,-0.0681292936205864,-0.07720430195331573,-0.024089330807328224,0.0507383868098259,0.05882493034005165,-0.02149793691933155,0.06356269121170044,0.036258943378925323,-0.032822009176015854,0.021429473534226418,0.03721659630537033,0.014596688561141491,0.0075704921036958694,0.031083006411790848,0.029439851641654968,-0.06597265601158142,-0.005223862361162901,-0.07941228896379471,-0.00976992305368185,0.06317929178476334,0.08209268003702164,0.04050375893712044,-0.0167122520506382,0.04655604436993599,0.0015438805567100644,0.04732627421617508,-0.024109868332743645,-0.04781579598784447,-0.06521953642368317,-0.07123417407274246,-0.002923445776104927,0.05392970144748688,0.09652847796678543,-0.0856083482503891,-0.0450429730117321,-0.014281750656664371,0.03386438637971878,0.07605066895484924,-0.12987767159938812,-0.01839648373425007,-0.12495505064725876,0.0486784502863884,-0.02846422977745533,0.06712671369314194,-0.00516909034922719,-0.05452534556388855,0.15259428322315216,-0.055059369653463364,0.016075527295470238,-0.006682161241769791,0.0170579981058836,0.00505270017310977,-0.10305316746234894,0.03560167923569679,0.022292129695415497,0.09287931025028229,0.04682648181915283,0.04411185160279274,-0.0033265319652855396,0.024171488359570503,-0.060522858053445816,0.1258382499217987,0.0010808875085785985,2.678684249985963E-4,0.14235879480838776,-0.07270616292953491,0.0955905094742775,-0.03150748834013939,-0.04603571072220802,-0.020621588453650475,-0.03113093227148056,-0.018430715426802635,0.07123759388923645,-0.07002747803926468,-0.03310956433415413,0.033670973032712936,-0.07559879869222641,0.07635533064603806,0.0020351153798401356,-0.027064124122262,-0.13104157149791718,0.05052700266242027,0.03368809074163437,-0.00955768208950758,-0.029686324298381805,-0.08044610172510147,0.08161000907421112,-0.06940957903862,0.03427346423268318,-0.05576455220580101,-0.027320867404341698,-0.04107886180281639,-0.03577626496553421,0.0187593474984169,-8.489631582051516E-4,-0.098582424223423,0.014220133423805237,0.06881051510572433,-0.00477884104475379,-0.05229339376091957,0.14443498849868774,0.06601373106241226,0.010543574579060078,-0.06921788305044174,0.054853975772857666,-0.016787560656666756,-0.043132804334163666,0.0543336421251297,0.07504252344369888,0.034216124564409256,-0.01677386835217476,-0.018184242770075798,-0.0562780424952507,-0.026215162128210068,-0.05749671533703804,-0.05175936594605446,-0.06246725469827652,-0.015000632032752037,0.10397060215473175,-0.020662667229771614,-0.05688053369522095,0.03514981269836426,0.037655625492334366,0.014357062987983227,-0.025215575471520424,0.05266310274600983,0.045727621763944626,-0.014042124152183533,-0.0031493795104324818,-0.07477722316980362,0.086963951587677,0.02310001477599144,-0.10989109426736832,-0.047048989683389664,-0.0547170452773571,-0.02055654674768448,-0.031877197325229645,0.042823005467653275,-0.05081455036997795,-0.03278093412518501,0.008592328988015652,-0.009270130656659603,-0.022661838680505753,-0.08174693584442139,-0.05882493034005165,0.06775273382663727,0.04511828348040581,0.011508071795105934,-0.004227699711918831,0.05078716576099396,-0.07170315086841583,-0.492508202791214,0.029594752937555313,0.054237790405750275,0.0808979719877243,0.06886186450719833,0.005367638077586889,0.007051871623843908],"embeddingsByType":{"float":[-0.0944368839263916,0.07884403318166733,0.04861341044306755,0.01253932248800993,0.07099796831607819,-0.06391870975494385,0.016239842399954796,0.0544363409280777,0.027892548590898514,0.017718682065606117,-0.01724734529852867,0.06530170142650604,0.012446895241737366,-0.0947560966014862,-0.020621588453650475,-0.06218312680721283,-0.025729060173034668,-0.06211123615503311,0.08439737558364868,0.005627803970128298,-0.059602007269859314,0.029576780274510384,0.06017368659377098,-0.03541340306401253,-0.05041574686765671,-0.04588508978486061,-0.06186476722359657,-0.061127059161663055,0.015418266877532005,-0.09817847609519958,0.08339351415634155,-0.011714322492480278,-0.015609968453645706,-0.023935282602906227,0.027495453134179115,0.06756959110498428,0.03417761251330376,-0.038919657468795776,-0.021717024967074394,-0.02830333635210991,0.09334144741296768,-0.04973109811544418,-0.010735276155173779,0.03623155876994133,0.005819505546241999,0.06371331214904785,0.03853197395801544,0.05733753740787506,0.07452390342950821,-0.015651045367121696,-0.020662667229771614,0.04120209813117981,-0.077443927526474,0.05051330849528313,-0.012994613498449326,0.02341495081782341,-0.005353945307433605,0.08305118978023529,-0.01673278957605362,0.026016611605882645,0.033561430871486664,-0.013857269659638405,0.06689351052045822,0.0039264545775949955,9.448138880543411E-4,-0.06906726211309433,-0.05759256333112717,0.00979046244174242,-0.001293984125368297,0.010879051871597767,-0.03232307359576225,0.0158290546387434,-0.006490460596978664,-0.08732510358095169,-0.030170712620019913,0.015199178829789162,0.07484568655490875,-0.015883825719356537,-0.10873574763536453,0.13835960626602173,0.028467651456594467,0.009475523605942726,-0.07920004427433014,-0.0175954457372427,0.07230564206838608,-0.005668883211910725,0.0353689007461071,0.07751581817865372,-0.013857697136700153,-0.03776516765356064,-0.027214746922254562,0.0075242784805595875,0.041804589331150055,0.040791310369968414,0.07015242427587509,0.005559339188039303,-0.00955768208950758,-0.0806960016489029,-0.0681292936205864,-0.07720430195331573,-0.024089330807328224,0.0507383868098259,0.05882493034005165,-0.02149793691933155,0.06356269121170044,0.036258943378925323,-0.032822009176015854,0.021429473534226418,0.03721659630537033,0.014596688561141491,0.0075704921036958694,0.031083006411790848,0.029439851641654968,-0.06597265601158142,-0.005223862361162901,-0.07941228896379471,-0.00976992305368185,0.06317929178476334,0.08209268003702164,0.04050375893712044,-0.0167122520506382,0.04655604436993599,0.0015438805567100644,0.04732627421617508,-0.024109868332743645,-0.04781579598784447,-0.06521953642368317,-0.07123417407274246,-0.002923445776104927,0.05392970144748688,0.09652847796678543,-0.0856083482503891,-0.0450429730117321,-0.014281750656664371,0.03386438637971878,0.07605066895484924,-0.12987767159938812,-0.01839648373425007,-0.12495505064725876,0.0486784502863884,-0.02846422977745533,0.06712671369314194,-0.00516909034922719,-0.05452534556388855,0.15259428322315216,-0.055059369653463364,0.016075527295470238,-0.006682161241769791,0.0170579981058836,0.00505270017310977,-0.10305316746234894,0.03560167923569679,0.022292129695415497,0.09287931025028229,0.04682648181915283,0.04411185160279274,-0.0033265319652855396,0.024171488359570503,-0.060522858053445816,0.1258382499217987,0.0010808875085785985,2.678684249985963E-4,0.14235879480838776,-0.07270616292953491,0.0955905094742775,-0.03150748834013939,-0.04603571072220802,-0.020621588453650475,-0.03113093227148056,-0.018430715426802635,0.07123759388923645,-0.07002747803926468,-0.03310956433415413,0.033670973032712936,-0.07559879869222641,0.07635533064603806,0.0020351153798401356,-0.027064124122262,-0.13104157149791718,0.05052700266242027,0.03368809074163437,-0.00955768208950758,-0.029686324298381805,-0.08044610172510147,0.08161000907421112,-0.06940957903862,0.03427346423268318,-0.05576455220580101,-0.027320867404341698,-0.04107886180281639,-0.03577626496553421,0.0187593474984169,-8.489631582051516E-4,-0.098582424223423,0.014220133423805237,0.06881051510572433,-0.00477884104475379,-0.05229339376091957,0.14443498849868774,0.06601373106241226,0.010543574579060078,-0.06921788305044174,0.054853975772857666,-0.016787560656666756,-0.043132804334163666,0.0543336421251297,0.07504252344369888,0.034216124564409256,-0.01677386835217476,-0.018184242770075798,-0.0562780424952507,-0.026215162128210068,-0.05749671533703804,-0.05175936594605446,-0.06246725469827652,-0.015000632032752037,0.10397060215473175,-0.020662667229771614,-0.05688053369522095,0.03514981269836426,0.037655625492334366,0.014357062987983227,-0.025215575471520424,0.05266310274600983,0.045727621763944626,-0.014042124152183533,-0.0031493795104324818,-0.07477722316980362,0.086963951587677,0.02310001477599144,-0.10989109426736832,-0.047048989683389664,-0.0547170452773571,-0.02055654674768448,-0.031877197325229645,0.042823005467653275,-0.05081455036997795,-0.03278093412518501,0.008592328988015652,-0.009270130656659603,-0.022661838680505753,-0.08174693584442139,-0.05882493034005165,0.06775273382663727,0.04511828348040581,0.011508071795105934,-0.004227699711918831,0.05078716576099396,-0.07170315086841583,-0.492508202791214,0.029594752937555313,0.054237790405750275,0.0808979719877243,0.06886186450719833,0.005367638077586889,0.007051871623843908]},"inputTextTokenCount":2}' + headers: + Connection: + - keep-alive + Content-Length: + - '10718' + Content-Type: + - application/json + Date: + - Sun, 08 Nov 2026 22:16:21 GMT + X-Amzn-Bedrock-Input-Token-Count: + - '2' + X-Amzn-Bedrock-Invocation-Latency: + - '117' + x-amzn-RequestId: + - 110375ec-7c38-40d4-bae5-d51adfa6f8ba + status: + code: 200 + message: OK +version: 1 diff --git a/py/src/braintrust/integrations/bedrock_runtime/cassettes/latest/test_wrap_bedrock_invoke_model_cohere_embedding_summarizes_vectors.yaml b/py/src/braintrust/integrations/bedrock_runtime/cassettes/latest/test_wrap_bedrock_invoke_model_cohere_embedding_summarizes_vectors.yaml new file mode 100644 index 000000000..5d353d3f9 --- /dev/null +++ b/py/src/braintrust/integrations/bedrock_runtime/cassettes/latest/test_wrap_bedrock_invoke_model_cohere_embedding_summarizes_vectors.yaml @@ -0,0 +1,42 @@ +interactions: +- request: + body: '{"texts": ["hello", "hi"], "input_type": "search_document"}' + headers: + Accept: + - !!binary | + YXBwbGljYXRpb24vanNvbg== + Content-Length: + - '59' + Content-Type: + - !!binary | + YXBwbGljYXRpb24vanNvbg== + User-Agent: + - !!binary | + Qm90bzMvMS40My4xMjMgbWQvQm90b2NvcmUjMS40My4xMjMgdWEvMi4xIG9zL2xpbnV4IzYuMTgu + NTQuMS1taWNyb3NvZnQtc3RhbmRhcmQtV1NMMiBtZC9hcmNoI3g4Nl82NCBsYW5nL3B5dGhvbiMz + LjE1LjIgbWQvcHlpbXBsI0NQeXRob24gbS9aLEQsYiBjZmcvcmV0cnktbW9kZSNsZWdhY3kgQm90 + b2NvcmUvMS40My4xMjM= + method: POST + uri: https://bedrock-runtime.us-east-1.amazonaws.com/model/cohere.embed-english-v3/invoke + response: + body: + string: '{"id":"77187820-d4d9-497d-b523-f6fc5fc70c0c","texts":["hello","hi"],"embeddings":[[-0.001789093,0.017868042,-0.040283203,-0.06365967,0.01184082,-0.016616821,-0.027999878,0.0025405884,7.6675415E-4,0.052215576,-0.024353027,-0.027496338,0.030929565,-0.032104492,0.018585205,-4.272461E-4,0.036071777,0.03475952,0.0051956177,-0.012451172,-0.04901123,0.022842407,-0.021148682,0.021209717,0.036010742,0.027496338,-0.0034751892,-0.0022277832,-0.024963379,-0.03591919,0.00894928,0.0071105957,0.029418945,0.025039673,-0.0017528534,0.06793213,-0.019256592,-0.0051193237,0.007949829,0.0016860962,0.0262146,-0.026046753,-0.07287598,-0.028808594,-0.07507324,-0.025665283,-0.0032024384,0.003440857,0.02998352,-0.029968262,5.054474E-4,0.0035591125,-0.007888794,0.059143066,-0.01687622,0.008964539,-0.06100464,-0.018707275,-0.0015716553,0.034820557,0.029449463,-0.00881958,0.03894043,0.04437256,-0.03390503,-0.034423828,0.005558014,0.0019683838,0.013038635,-0.016311646,-0.009887695,0.0060157776,-0.014465332,-0.015029907,-0.0037574768,0.027282715,0.0018129349,0.009880066,0.0047340393,-0.0082092285,-0.07519531,-0.0055770874,-0.062805176,-0.057556152,0.026382446,0.014038086,-0.028717041,-0.01953125,-0.017105103,-0.03265381,-0.023132324,0.018539429,0.026901245,0.02722168,-0.028686523,-8.535385E-5,0.010795593,0.025726318,-0.013771057,0.0068359375,-0.047576904,-0.01373291,-0.030273438,-0.024291992,-0.004386902,0.022598267,-0.0076141357,-0.012870789,0.044189453,0.05886841,0.0013542175,0.060394287,-3.9672852E-4,0.022216797,-0.0043754578,-3.6621094E-4,-0.0026779175,-0.008514404,-0.042388916,0.03213501,0.03161621,0.036376953,-0.018173218,0.0027179718,-0.03451538,5.455017E-4,-0.014976501,-0.032470703,0.053375244,-0.027420044,-0.020843506,0.044067383,-0.12475586,-0.04751587,-0.01574707,0.006500244,-0.0073432922,-0.06097412,0.013046265,-0.00944519,0.049987793,-0.0027694702,0.0051498413,0.0184021,-0.044677734,0.014770508,-0.0071754456,6.918907E-4,0.007259369,-0.001461029,-0.061462402,-0.030181885,0.0026607513,0.04296875,-0.0032806396,0.0869751,-0.021209717,0.03463745,-0.017410278,0.059570312,0.012077332,-0.005367279,0.019744873,-0.050445557,-0.030029297,0.015975952,-0.014343262,0.0071868896,0.016143799,0.06512451,-0.0110321045,0.02267456,0.003320694,0.027557373,0.015609741,-0.009094238,-0.019134521,0.012451172,0.04660034,-0.009918213,0.027374268,-0.013671875,-0.02218628,0.091674805,-0.045684814,-0.06210327,0.02947998,-0.014785767,0.019165039,0.010322571,0.053344727,-0.0039901733,-0.015396118,-0.021697998,-0.003786087,-0.041748047,-0.0055885315,-0.004371643,-0.0034561157,0.034088135,0.0052261353,-0.017440796,0.021759033,-0.022247314,0.016052246,-0.034973145,0.010543823,0.007545471,0.013191223,0.026138306,0.0037193298,-0.014320374,0.013656616,-0.06689453,-0.031097412,-0.05053711,-0.07800293,-0.00881958,-0.029144287,0.048614502,0.016174316,-0.011062622,-0.0062942505,8.5544586E-4,-0.009963989,0.01727295,-0.045074463,-0.0029754639,-0.060333252,0.0042381287,0.011688232,0.012901306,-0.022613525,-0.027175903,-0.041748047,-0.014091492,0.0018310547,0.045166016,0.008453369,0.0056114197,5.054474E-5,0.01184845,-0.022216797,0.007751465,0.052093506,0.02458191,0.018417358,0.0072631836,0.018035889,0.008674622,0.009033203,-0.028366089,0.04510498,-0.006832123,0.0011615753,0.053649902,0.011375427,0.013923645,-0.03616333,0.06341553,-0.05166626,0.004219055,-0.0055160522,-0.016494751,-0.05883789,-0.01852417,-0.011039734,0.027038574,0.0020942688,-0.029525757,0.015014648,0.02243042,-0.03604126,0.0061149597,0.088256836,0.068359375,-0.06439209,-0.008590698,-0.013633728,0.021560669,-0.01309967,0.0069885254,0.0020561218,0.019088745,0.041381836,1.0108948E-4,-0.013549805,0.003967285,-0.0072517395,0.03579712,0.078063965,0.011688232,-0.0064353943,0.04055786,0.032073975,0.03567505,0.0059280396,0.013435364,0.009689331,-0.011993408,-0.026062012,0.03604126,0.02331543,-0.009429932,-0.024353027,0.06097412,0.009017944,0.013084412,0.0077667236,-0.034301758,0.04019165,0.0015487671,-0.00440979,0.022964478,-0.029205322,-0.06188965,0.018218994,-0.007572174,-0.04119873,-0.0076446533,0.019958496,0.02268982,-0.066589355,-0.053955078,0.0029087067,0.0076904297,-0.09210205,-0.036834717,-0.062072754,0.021377563,0.053131104,0.0023937225,-0.019042969,-0.033111572,0.013946533,-4.7302246E-4,0.018615723,-0.008979797,-0.0118255615,0.022369385,0.0725708,-0.011108398,0.023864746,-0.0020217896,0.0029754639,-0.028411865,-0.0284729,0.013916016,-0.018371582,-0.0066375732,0.042510986,-0.051452637,-0.030685425,-0.004371643,0.05203247,-0.04159546,-0.0017108917,0.01033783,0.06713867,-0.05419922,0.041015625,-0.0060653687,-0.024795532,-0.050567627,-0.007369995,-0.05038452,0.001411438,-0.039367676,-0.04373169,-0.0028743744,0.0066184998,-0.035491943,0.031341553,-0.02520752,-0.07147217,-0.012306213,-0.051330566,-0.06652832,0.0032081604,-0.022155762,0.029174805,0.03894043,0.029876709,0.016860962,0.029525757,0.022903442,-0.011489868,0.022476196,0.048309326,0.026992798,-0.015182495,0.0014228821,-0.042907715,-0.017242432,0.008529663,0.013626099,-0.033691406,0.008270264,-0.09075928,0.0070648193,-0.0077209473,-0.024658203,-0.04788208,-0.020004272,-0.075683594,0.017654419,-0.044799805,-0.03778076,0.02142334,0.066467285,0.015716553,0.041290283,0.032684326,-0.005580902,0.0010223389,0.014457703,-0.066467285,0.024505615,0.013977051,0.00655365,-0.020050049,-0.005115509,-0.03845215,0.010345459,-0.029510498,0.04611206,0.0063667297,0.04953003,0.039916992,-0.054534912,-0.023849487,-0.044921875,-0.0034980774,-0.010925293,-0.04425049,0.043670654,-0.034851074,0.04473877,-0.014579773,-0.021514893,-0.020889282,0.0077590942,0.0052261353,0.0076942444,1.7547607E-4,-0.010284424,0.023376465,-0.020385742,-0.06524658,0.010734558,-0.08258057,0.0057373047,-0.054901123,0.06021118,-0.009689331,0.046142578,0.033325195,0.025878906,0.0025348663,0.019561768,0.045959473,-0.010360718,-0.06970215,0.007663727,-0.032714844,0.034973145,0.016418457,-0.0020179749,-0.053222656,-0.009460449,-0.0018205643,-0.008544922,0.029769897,0.0064926147,6.5231323E-4,0.007205963,-0.019927979,-0.008911133,-0.0075302124,0.013450623,-0.0284729,0.009170532,-0.018341064,-0.07678223,-0.03829956,0.020812988,-0.05722046,0.004322052,-0.013015747,0.016647339,-0.013031006,0.004890442,0.0496521,-0.05142212,-0.036468506,-0.015808105,-0.021759033,-0.008735657,-0.003742218,-0.06976318,-0.081604004,0.011383057,0.0317688,-0.013191223,0.035736084,-0.060058594,-0.021133423,0.025741577,0.04876709,0.031097412,0.041748047,0.0078048706,-0.009735107,0.015792847,-0.016983032,0.04611206,0.02670288,0.007381439,0.009689331,-0.014076233,0.0016765594,-0.011734009,0.05441284,0.020935059,0.002571106,0.015617371,0.0024909973,0.023345947,-0.020309448,-0.058166504,0.027359009,0.02293396,0.030059814,0.012290955,-0.02279663,0.042938232,-0.026672363,0.019042969,0.034820557,-0.013999939,-0.0024719238,-4.3296814E-4,-0.041870117,-0.01209259,0.022262573,-0.016479492,0.03189087,0.0892334,-0.03387451,0.088134766,0.020217896,-0.033447266,0.055633545,0.010978699,-0.036621094,-0.049102783,-0.025665283,-0.010025024,-0.019561768,0.021896362,0.0073547363,-0.023590088,-0.038360596,0.014968872,-0.017807007,-0.0067710876,0.043029785,-0.004047394,-7.6293945E-5,0.0015296936,-0.016937256,-0.022598267,-0.0030117035,-0.02468872,-0.014228821,0.0132751465,0.0015945435,0.011009216,0.005569458,0.011497498,0.0036773682,0.0035133362,-0.043762207,0.012817383,0.004337311,0.006385803,0.0073242188,-0.026367188,0.008850098,0.01789856,0.017745972,-0.03656006,-0.009155273,-0.003753662,0.034240723,0.009864807,0.016082764,-0.06982422,-0.013412476,5.0354004E-4,-0.040924072,0.0010032654,0.02935791,-0.040283203,-0.011505127,0.031585693,-0.03579712,0.028274536,0.010604858,0.005622864,-9.57489E-4,-0.024139404,-0.012039185,0.032104492,-0.006580353,-0.0010643005,0.03857422,0.024124146,-2.975464E-4,-0.011070251,-0.004272461,-0.0026359558,0.034240723,-0.0031871796,0.028320312,-0.046966553,0.038879395,0.0078048706,0.0039596558,-0.0027828217,0.015670776,0.0107421875,-0.0038337708,-0.06896973,0.016601562,0.08557129,-0.02178955,0.0032291412,-0.07128906,0.017700195,0.0053596497,-0.019348145,-0.01473999,-0.01449585,-0.04510498,-0.05291748,-0.01864624,-0.011428833,-0.037902832,0.030303955,0.014694214,0.030731201,0.015823364,-0.012306213,0.0036735535,0.022140503,0.013038635,0.05407715,-0.012496948,-0.04724121,0.036499023,0.039398193,-0.013046265,-0.02798462,0.025009155,-0.015525818,0.05206299,0.050109863,-0.0034217834,-0.008865356,0.01486969,0.009109497,-0.011787415,-0.026000977,-0.015411377,0.015602112,0.039154053,0.01739502,0.039794922,-0.0074691772,-0.03677368,-0.04034424,0.007820129,0.017562866,-0.033050537,-0.0022277832,0.041503906,0.029022217,0.007129669,-0.0340271,-0.06689453,-0.009338379,-0.010101318,-0.039154053,0.0011587143,0.012771606,-0.034851074,-0.030456543,-0.0021629333,0.028182983,0.027755737,-0.04248047,0.065979004,-0.0524292,0.029693604,-0.0146865845,-0.050628662,-0.031143188,0.009399414,0.03111267,-0.0075645447,0.006816864,-0.024993896,-7.944107E-4,-0.002292633,-0.05682373,-0.034362793,-0.0053710938,-0.020965576,-0.0129470825,-0.023590088,-0.028274536,0.03955078,5.760193E-4,0.043426514,0.012741089,-0.04663086,0.0040626526,0.015579224,0.0036773682,0.007881165,0.029144287,-0.0065841675,-0.010261536,-0.010429382,7.7819824E-4,0.0015830994,0.0076522827,0.0090789795,0.021743774,-0.04776001,0.004005432,0.032836914,0.037384033,0.00233078,0.049835205,-0.0027503967,0.04156494,-0.036254883,0.0018033981,-0.012664795,0.019546509,0.018341064,-0.04751587,-0.036254883,-0.086242676,-0.04425049,0.014663696,0.035858154,-0.016693115,-0.023162842,-0.01777649,-0.003238678,0.037872314,0.021865845,0.056152344,0.013961792,0.012962341,0.012573242,7.4386597E-4,0.085876465,0.047424316,0.011833191,-0.04248047,-0.044067383,-7.247925E-4,0.012054443,-0.027496338,0.0019035339,-5.4359436E-4,-3.681183E-4,0.007671356,-0.0072898865,0.013763428,-0.016143799,-0.05429077,0.049316406,0.023223877,0.019744873,0.065979004,-0.0152282715,0.043640137,0.0038490295,0.051605225,0.050964355,-0.025909424,0.018035889,0.013900757,0.037322998,-0.022033691,-0.0056419373,0.009025574,-0.0093688965,0.0023784637,-0.020370483,-0.04135132,-0.014251709,0.046020508,0.0099487305,0.025619507,0.004753113,-0.019805908,-0.043273926,0.0060195923,-0.014511108,0.01838684,0.039001465,-0.020584106,0.02456665,-0.029190063,-0.054626465,0.03152466,0.019180298,-0.022094727,-0.028823853,0.031188965,0.033599854,7.4768066E-4,-8.916855E-4,0.07067871,0.060791016,0.01146698,-0.013671875,0.026779175,0.022064209,-0.025848389,-0.022506714,-0.02720642,0.027542114,-0.0087509155,0.020431519,0.0028762817,0.02355957,0.0030899048,-0.009941101,0.026031494,0.016159058,-0.0206604,0.025848389,0.013473511,0.046844482,0.04623413,0.004852295,-0.052612305,0.03753662,0.031311035,0.03112793,-0.056030273,1.9454956E-4,-0.01651001,-0.021530151,0.013793945,-0.058166504,-0.01260376,0.032470703,-0.005569458,-0.033233643,-0.0017166138,-0.020584106,0.003112793,0.008544922,0.025024414,0.022766113,-0.027435303,-0.017501831,-0.007457733,0.026031494,-0.06677246,0.029266357,0.034454346,0.011688232,0.011108398,0.017410278,0.008049011,-0.018844604,-0.023147583,-0.02809143,0.040985107,-0.012123108,-0.0070495605,0.045074463,-0.030807495,-4.863739E-4,0.02973938,-0.039489746,-0.0052337646,0.0016403198,0.014274597,-0.015449524,-0.0028381348,-0.0034103394,-0.034484863,0.0075683594,0.0076904297,-0.028427124,0.01979065,0.03527832,0.004219055,-0.016601562,-0.035064697,0.02607727,-0.004207611,-0.0068130493,0.026138306,-0.015960693,0.0069351196,-0.04901123,-0.027679443,1.7738342E-4,-0.07458496,-0.018859863,-0.011169434,0.008087158,-0.03778076,-0.053527832,0.02734375,-0.05557251,-0.032806396,-0.028778076,0.0050621033,-0.009979248,-0.028060913,-0.046447754,-3.8146973E-5,-0.0010728836,-0.044158936,-0.017303467,-0.032104492,-0.0014457703,-0.036956787,-0.03213501,0.004058838,3.6621094E-4,0.056671143,-0.057678223,0.034088135,-0.021377563,-0.03677368,-0.02217102,-0.02998352,0.027297974,-0.033569336,-0.02609253,0.0127334595,0.0016975403,0.0637207,-0.050964355,-0.054504395,-0.025772095,-0.020355225,-0.015274048,0.0637207,0.04647827,-9.012222E-4,-0.07775879,0.010307312,-0.045043945,0.020126343,0.033935547,-0.012924194,-0.0056991577,-0.0149383545,-0.021972656,-0.0065841675,0.006752014,-0.028305054,0.020507812,-0.0015258789,-0.036193848,0.03479004,-0.030700684,0.05593872,0.0060539246,0.043273926,-0.039886475,0.07171631,-0.042510986,-0.020599365,0.03768921,-0.0036735535,-0.019638062,0.021621704,-0.039276123,-0.055603027,0.053009033,-2.9182434E-4,0.016983032,-0.010147095,0.06427002,0.015853882,-0.028945923,0.009925842,0.026107788,0.020721436,-0.0017967224,-0.034362793,0.0065841675,-0.026733398,-0.009941101,-0.082214355,-0.04559326,0.04043579,-0.0040359497,-0.04095459,0.021713257,-0.02897644,-0.013214111,-0.023361206,-0.017837524,-0.05065918,-0.03930664,-0.0026550293,-0.0058059692,0.020721436],[0.0046539307,9.536743E-5,-0.023376465,-0.06713867,5.0735474E-4,-0.01210022,-0.03274536,0.004749298,0.010147095,0.06951904,-0.033447266,-0.020599365,0.025756836,-0.011550903,0.0049095154,0.00774765,0.01777649,0.05105591,0.013786316,-0.025878906,-0.04714966,0.0044555664,-0.040130615,-0.0044784546,0.04232788,0.046569824,-0.04446411,0.0022449493,-0.02734375,-0.037506104,0.0040664673,0.024658203,0.046569824,0.0038890839,-0.020751953,0.029312134,-0.012245178,-0.024658203,-0.011077881,0.0110321045,0.017105103,-0.010421753,-0.0814209,-0.014755249,-0.09301758,-0.02923584,-0.006958008,0.016311646,0.02558899,-0.0073127747,0.012359619,-0.004562378,-0.0042381287,0.03793335,-0.018356323,-0.008430481,-0.068359375,0.010772705,0.0057792664,0.0126953125,0.018096924,-0.015464783,0.053527832,0.06390381,-0.034423828,-0.032165527,-0.02355957,0.01828003,0.02168274,-0.03253174,-0.026046753,0.005050659,0.0057907104,-0.005466461,-0.015335083,0.018081665,0.04284668,0.041931152,-0.014129639,-0.021499634,-0.06463623,-5.3977966E-4,-0.041412354,-0.024353027,0.014419556,0.028045654,-0.021453857,-0.038848877,-0.0033817291,-0.035583496,-0.013511658,0.004043579,0.029205322,0.052764893,-0.026977539,0.011726379,-0.024795532,-0.008407593,-0.024154663,8.983612E-4,-0.016433716,-0.018936157,-0.034423828,-0.018829346,-0.018722534,-0.0016918182,-0.015045166,0.0012321472,0.038879395,0.08532715,-0.009979248,0.056732178,0.01184845,0.021743774,-0.00497818,0.019454956,0.02178955,-0.0038852692,-0.030319214,0.023468018,0.059265137,0.04248047,-0.0060272217,0.004722595,-0.039916992,0.009666443,-0.023010254,-0.044189453,0.04272461,-0.02659607,0.0019950867,0.046417236,-0.15258789,-0.066589355,-0.048980713,0.018035889,0.0032138824,-0.06298828,0.004989624,0.01361084,0.027618408,3.2424927E-5,0.028717041,-0.014083862,-0.051513672,0.025665283,0.0113220215,-0.017089844,-0.005722046,-0.001001358,-0.06286621,-0.03363037,0.026977539,0.039154053,-0.021316528,0.053466797,-0.051849365,0.020431519,-0.017959595,0.044433594,-0.0012588501,0.007858276,0.031677246,-0.026168823,-0.004798889,-0.0026550293,-0.003314972,0.017211914,0.015289307,0.04269409,-0.015716553,0.011917114,-0.011222839,0.01210022,0.016281128,0.0037555695,-0.0128479,0.032165527,0.051330566,-0.0024795532,0.009468079,-0.026168823,0.01033783,0.07086182,-0.051696777,-0.062072754,0.00982666,-0.030151367,0.031799316,0.008636475,0.022735596,-0.0143966675,-0.018554688,-0.033233643,-0.020858765,-0.06347656,0.029220581,-0.015426636,-0.014587402,0.042755127,0.006504059,-0.01991272,0.008850098,-0.026428223,-0.021316528,-0.028656006,-5.426407E-4,0.015159607,0.01638794,0.041625977,-0.003955841,-6.866455E-5,0.003917694,-0.031707764,-0.005142212,-0.030456543,-0.08654785,-0.028625488,-0.012794495,0.05496216,0.038513184,-0.009185791,-0.0040512085,0.0041007996,0.01663208,0.0023612976,-0.047698975,-0.016021729,-0.025817871,-0.0046310425,0.0112838745,0.028411865,0.0041885376,-0.012382507,-0.041625977,-0.015930176,-0.0074424744,0.033111572,0.01625061,0.02015686,-0.004142761,0.0036735535,-0.025665283,0.0029830933,0.025115967,-0.010559082,0.00856781,0.021209717,0.0033130646,-0.008621216,0.031555176,-0.011375427,0.04727173,-0.024383545,0.016708374,0.059509277,0.010772705,0.0072784424,-0.038391113,0.052856445,-0.037902832,0.007671356,-0.016357422,-0.01979065,-0.03479004,-0.020187378,0.0045661926,0.033111572,0.011909485,-0.029785156,0.0061035156,0.009307861,-0.032043457,-0.009017944,0.07281494,0.08001709,-0.03982544,-0.01625061,-0.011711121,0.010574341,-0.005584717,0.011245728,-0.0020637512,0.017608643,0.05368042,0.009216309,-0.014411926,-0.006210327,0.022521973,0.055358887,0.07885742,0.018585205,0.012084961,0.040527344,0.045562744,0.040008545,0.049865723,0.017044067,0.023284912,-0.018356323,-0.016616821,0.044891357,0.0010929108,-0.0013780594,-0.022979736,0.052215576,-0.004737854,0.034301758,0.01197052,-0.04345703,0.04336548,0.0141067505,0.015335083,-0.017669678,0.010284424,-0.04434204,0.016067505,0.0013885498,-0.05206299,-0.03201294,0.033599854,0.019363403,-0.07446289,-0.050598145,0.0073013306,-0.009315491,-0.08178711,-0.039215088,-0.06524658,0.022521973,0.051849365,-0.01739502,-0.025360107,-0.09283447,0.011177063,-0.011711121,0.021713257,-0.012191772,-0.015098572,0.0056648254,0.06726074,0.007583618,0.032196045,-0.0012283325,-0.022476196,-0.01928711,-0.022094727,0.025222778,-0.027954102,-0.019958496,0.06506348,-0.06530762,-0.04727173,0.006248474,0.06341553,-0.045318604,-0.002401352,0.012123108,0.07714844,-0.06072998,0.00819397,-0.0036792755,-0.035461426,-0.0234375,0.013946533,-0.062438965,0.002204895,-0.022583008,-0.017730713,0.015083313,-0.010223389,-0.03665161,0.02835083,-9.92775E-4,-0.04244995,0.017791748,-0.057739258,-0.055114746,-0.008590698,-0.027954102,0.05380249,0.031921387,0.041656494,-0.00655365,0.052856445,-0.0069618225,-0.014099121,0.039886475,0.05731201,0.037139893,-0.013839722,-0.01512146,-0.036254883,-0.0121536255,-0.005870819,0.008972168,-0.017913818,-0.01448822,-0.08483887,-0.0029201508,0.0017642975,-0.027862549,-0.04623413,-0.020935059,-0.069885254,0.025390625,-0.035003662,-0.028289795,0.030563354,0.05734253,0.0069618225,0.040893555,0.0048332214,-0.0035419464,-0.009689331,0.024398804,-0.021057129,0.030883789,0.015289307,-0.00680542,-0.0126953125,0.007850647,-0.029418945,0.0016784668,-0.04034424,0.048583984,-0.0067596436,0.06518555,0.049743652,-0.06896973,-0.046569824,-0.03717041,-0.004840851,-0.006778717,-0.03930664,0.04727173,-0.036834717,0.053527832,-0.012649536,-0.032958984,-0.05029297,0.019256592,0.004295349,-0.0025539398,0.001159668,-0.008712769,0.04727173,-0.050750732,-0.03942871,-0.005970001,-0.09063721,0.011245728,-0.030197144,0.04510498,-0.003829956,0.02468872,0.040008545,0.015457153,-0.0023841858,0.009613037,0.03314209,-0.016204834,-0.08166504,-0.009742737,-0.02456665,0.02494812,0.009140015,0.011558533,-0.035705566,-0.03729248,-0.004043579,0.008056641,0.016082764,-0.0014228821,0.022888184,-0.0010070801,-0.026168823,0.0023326874,8.020401E-4,0.02154541,-0.009262085,6.942749E-4,-0.0013694763,-0.07659912,-0.014137268,0.010887146,-0.036102295,0.029510498,-0.010696411,-0.011993408,-0.032928467,0.012260437,0.028549194,-0.04876709,-0.017318726,-0.039031982,-0.026184082,-0.01687622,0.009414673,-0.0579834,-0.07104492,0.03515625,0.011550903,-0.034301758,0.017730713,-0.056274414,-0.0181427,0.022277832,0.064575195,0.014472961,0.049957275,0.012924194,-0.006134033,0.0053253174,-0.02418518,0.072631836,-0.011436462,-0.008010864,0.005935669,-0.011505127,-0.010185242,0.02154541,0.029586792,0.02670288,0.0020980835,0.017105103,-0.0093688965,0.036102295,-0.015579224,-0.037963867,0.045288086,0.0209198,0.034240723,0.011253357,-0.034729004,0.050445557,-0.012329102,-0.010467529,0.028274536,-0.01109314,0.024108887,0.015213013,-0.04135132,-0.012649536,0.014160156,-0.019378662,0.03451538,0.08111572,-0.022979736,0.06573486,0.026779175,-0.014732361,0.028030396,0.006500244,-0.021743774,-0.032318115,-0.026657104,-0.018829346,-0.038116455,0.0463562,-0.0024757385,-0.009628296,-0.022277832,-0.0037155151,0.0059165955,0.008346558,0.034332275,0.0035591125,-0.0057640076,-0.012680054,-0.013580322,-0.024597168,0.027313232,-0.030548096,-0.015045166,5.083084E-4,0.029067993,0.009490967,0.0036678314,-0.005783081,0.009231567,0.012504578,-0.03918457,0.04940796,0.009353638,0.011734009,0.0010681152,-0.04989624,-0.0030574799,0.02909851,0.030670166,-0.02142334,-0.011405945,-0.0041656494,0.028778076,0.0057258606,0.04107666,-0.04159546,-0.006549835,0.003189087,-0.023361206,0.003025055,0.019973755,-0.028793335,-0.02960205,0.021957397,0.011413574,0.031585693,-0.012397766,-0.018997192,0.01171875,0.022338867,0.00182724,0.0068740845,-0.009689331,-0.018096924,0.0184021,0.035339355,8.583069E-5,-0.019699097,-0.017440796,-0.016937256,0.026229858,-0.00466156,0.033447266,-0.046447754,0.03036499,0.03262329,0.004585266,-0.003967285,0.012199402,-6.942749E-4,3.3569336E-4,-0.0579834,0.01965332,0.06488037,-0.021255493,-0.011383057,-0.0637207,0.06427002,0.008094788,-0.037353516,-0.0060920715,-0.0055389404,-0.011428833,-0.046203613,0.014419556,0.008583069,-0.036102295,0.03250122,-0.009902954,0.034729004,-9.784698E-4,0.015487671,0.012306213,0.028015137,-0.017852783,0.06689453,-0.019454956,-0.041137695,0.019607544,0.06124878,-0.0047302246,-0.0104599,0.05029297,-0.005065918,0.050476074,0.047912598,0.011421204,0.0024261475,-0.0021400452,-0.00843811,-0.02128601,-0.0109939575,-0.037841797,0.035736084,0.04711914,0.016113281,0.025177002,0.0066337585,-0.042053223,-0.05831909,0.028060913,0.027267456,-0.033843994,-0.0012779236,0.041168213,0.013320923,0.00541687,-0.021881104,-0.059020996,-0.010971069,0.004634857,-0.01979065,-0.007904053,0.019042969,-0.01689148,-0.021850586,0.0031719208,0.0015525818,0.043762207,-0.030670166,0.03704834,-0.04119873,0.01953125,-0.013763428,-0.037017822,-0.033569336,-0.013023376,0.021209717,-0.015289307,0.023010254,-0.027832031,-0.0076522827,-0.015426636,-0.042114258,-0.022109985,0.011062622,0.005088806,-0.0317688,-0.019546509,-0.014274597,0.017059326,0.012252808,0.044403076,0.02330017,-0.07788086,0.023971558,0.0047683716,-0.020355225,-0.012397766,0.040252686,-0.023483276,-0.020996094,-0.002506256,-0.016784668,-0.024536133,0.025924683,0.0014820099,0.01473999,-0.057434082,-0.005794525,0.028900146,0.039245605,-0.008651733,0.061401367,0.007095337,0.048431396,-0.050476074,-0.0043563843,-0.023635864,0.0069885254,-0.01210022,-0.03567505,-0.027435303,-0.05493164,-0.040039062,-3.7765503E-4,0.019836426,-0.0064430237,-0.029190063,-0.015991211,-0.005947113,0.03656006,0.012435913,0.035705566,-0.03756714,0.016220093,0.041168213,-0.013710022,0.0769043,0.04611206,0.024429321,-0.028945923,-0.050476074,0.0033721924,-7.381439E-4,-0.013916016,0.007030487,-0.0138168335,0.0012969971,0.020065308,0.010749817,0.02178955,-0.008087158,-0.06665039,0.02961731,0.014221191,-0.016616821,0.019485474,-0.00995636,0.08300781,-0.0015029907,0.040496826,0.064575195,0.0068206787,0.022903442,0.0028915405,0.066345215,-0.008590698,-0.01007843,-0.031707764,0.009681702,0.017440796,-0.0077285767,-0.019622803,-0.03894043,0.064575195,0.008224487,0.010322571,0.01676941,0.013694763,-0.027160645,0.028869629,-0.0446167,0.04083252,0.04385376,-0.022247314,0.040985107,-0.0074806213,-0.060150146,0.02748108,0.014823914,-0.01953125,-0.056274414,0.04849243,0.04107666,-0.016113281,-0.018005371,0.059143066,0.06719971,-0.008506775,0.011795044,0.044311523,0.045898438,-0.010383606,-0.007785797,-0.04333496,0.036224365,-0.003414154,0.03982544,-0.004398346,0.04559326,0.021148682,-0.013366699,0.045532227,0.01852417,-0.027954102,0.022735596,0.03640747,0.059570312,0.0446167,0.016036987,-0.06222534,0.029296875,0.019104004,0.046020508,-0.056488037,0.008834839,-0.0035037994,-0.006401062,0.01991272,-0.06964111,-0.036590576,0.038024902,0.008773804,-0.025054932,0.0029277802,-0.012794495,0.015045166,0.021224976,0.02407837,0.015823364,-0.011062622,-0.016860962,-0.011451721,0.021881104,-0.06677246,0.03488159,0.029022217,0.012626648,0.0038261414,0.021697998,0.014770508,-0.02609253,-0.0345459,-0.028747559,0.028564453,7.185936E-4,-0.015182495,0.031311035,-0.005355835,-0.0038604736,0.033081055,-0.03250122,0.0101623535,-0.03555298,0.03048706,-0.014953613,-0.0069885254,-0.006996155,-0.039611816,-0.011627197,0.0073776245,0.0044937134,0.016647339,0.03753662,0.011634827,-0.010971069,-0.025787354,0.03866577,0.012611389,0.0039138794,0.012321472,-0.017608643,0.0067596436,-0.053649902,-0.03643799,0.0042037964,-0.034484863,-0.02911377,-0.01309967,0.012954712,-0.034942627,-0.045562744,0.025146484,-0.042633057,-0.022354126,-0.006313324,-0.0030937195,-0.009979248,-0.022521973,-0.02708435,0.033172607,0.010139465,-0.032409668,0.008415222,-0.016357422,-5.0354004E-4,-0.0035266876,-0.019104004,0.016662598,-4.119873E-4,0.016326904,-0.041809082,0.04586792,-0.017501831,-0.020645142,-0.042144775,-0.027191162,0.018249512,-0.016937256,-0.029403687,0.01763916,0.0013036728,0.042114258,-0.066833496,-0.032592773,-0.012710571,0.011581421,-0.0053138733,0.047943115,0.011474609,-0.010932922,-0.054718018,0.032440186,-0.029891968,0.009651184,0.012588501,0.0033683777,-0.015045166,-0.01638794,-0.011703491,3.8146973E-6,0.018356323,-0.05392456,0.020843506,-0.0061950684,-0.037597656,0.024475098,-0.021499634,0.0602417,0.025619507,0.05105591,-0.027832031,0.05404663,-0.026824951,0.0019664764,0.008605957,0.010040283,-0.029281616,-7.305145E-4,-0.036315918,-0.0569458,0.03677368,0.0017166138,0.014175415,-0.029144287,0.039093018,0.0082092285,-0.008453369,-0.0068206787,0.033050537,-0.0026283264,0.011116028,-0.0637207,-0.015716553,-0.017166138,-0.0090408325,-0.06506348,-0.043151855,0.039215088,-0.010803223,-0.039916992,0.012924194,-0.030380249,6.9379807E-4,-0.042541504,0.023071289,-0.04360962,-0.031707764,0.019973755,-0.015022278,0.030288696]],"response_type":"embeddings_floats"}' + headers: + Connection: + - keep-alive + Content-Length: + - '25598' + Content-Type: + - application/json + Date: + - Sun, 08 Nov 2026 22:14:22 GMT + X-Amzn-Bedrock-Input-Token-Count: + - '2' + X-Amzn-Bedrock-Invocation-Latency: + - '157' + x-amzn-RequestId: + - 77187820-d4d9-497d-b523-f6fc5fc70c0c + status: + code: 200 + message: OK +version: 1 diff --git a/py/src/braintrust/integrations/bedrock_runtime/cassettes/latest/test_wrap_bedrock_invoke_model_titan_embedding_logs_token_metrics.yaml b/py/src/braintrust/integrations/bedrock_runtime/cassettes/latest/test_wrap_bedrock_invoke_model_titan_embedding_logs_token_metrics.yaml new file mode 100644 index 000000000..3e995ffb6 --- /dev/null +++ b/py/src/braintrust/integrations/bedrock_runtime/cassettes/latest/test_wrap_bedrock_invoke_model_titan_embedding_logs_token_metrics.yaml @@ -0,0 +1,42 @@ +interactions: +- request: + body: '{"inputText": "hello", "dimensions": 256}' + headers: + Accept: + - !!binary | + YXBwbGljYXRpb24vanNvbg== + Content-Length: + - '41' + Content-Type: + - !!binary | + YXBwbGljYXRpb24vanNvbg== + User-Agent: + - !!binary | + Qm90bzMvMS40My4xMjMgbWQvQm90b2NvcmUjMS40My4xMjMgdWEvMi4xIG9zL2xpbnV4IzYuMTgu + NTQuMS1taWNyb3NvZnQtc3RhbmRhcmQtV1NMMiBtZC9hcmNoI3g4Nl82NCBsYW5nL3B5dGhvbiMz + LjE1LjIgbWQvcHlpbXBsI0NQeXRob24gbS9aLEQsbixiIGNmZy9yZXRyeS1tb2RlI2xlZ2FjeSBC + b3RvY29yZS8xLjQzLjEyMw== + method: POST + uri: https://bedrock-runtime.us-east-1.amazonaws.com/model/amazon.titan-embed-text-v2%3A0/invoke + response: + body: + string: '{"embedding":[-0.0944368839263916,0.07884403318166733,0.04861341044306755,0.01253932248800993,0.07099796831607819,-0.06391870975494385,0.016239842399954796,0.0544363409280777,0.027892548590898514,0.017718682065606117,-0.01724734529852867,0.06530170142650604,0.012446895241737366,-0.0947560966014862,-0.020621588453650475,-0.06218312680721283,-0.025729060173034668,-0.06211123615503311,0.08439737558364868,0.005627803970128298,-0.059602007269859314,0.029576780274510384,0.06017368659377098,-0.03541340306401253,-0.05041574686765671,-0.04588508978486061,-0.06186476722359657,-0.061127059161663055,0.015418266877532005,-0.09817847609519958,0.08339351415634155,-0.011714322492480278,-0.015609968453645706,-0.023935282602906227,0.027495453134179115,0.06756959110498428,0.03417761251330376,-0.038919657468795776,-0.021717024967074394,-0.02830333635210991,0.09334144741296768,-0.04973109811544418,-0.010735276155173779,0.03623155876994133,0.005819505546241999,0.06371331214904785,0.03853197395801544,0.05733753740787506,0.07452390342950821,-0.015651045367121696,-0.020662667229771614,0.04120209813117981,-0.077443927526474,0.05051330849528313,-0.012994613498449326,0.02341495081782341,-0.005353945307433605,0.08305118978023529,-0.01673278957605362,0.026016611605882645,0.033561430871486664,-0.013857269659638405,0.06689351052045822,0.0039264545775949955,9.448138880543411E-4,-0.06906726211309433,-0.05759256333112717,0.00979046244174242,-0.001293984125368297,0.010879051871597767,-0.03232307359576225,0.0158290546387434,-0.006490460596978664,-0.08732510358095169,-0.030170712620019913,0.015199178829789162,0.07484568655490875,-0.015883825719356537,-0.10873574763536453,0.13835960626602173,0.028467651456594467,0.009475523605942726,-0.07920004427433014,-0.0175954457372427,0.07230564206838608,-0.005668883211910725,0.0353689007461071,0.07751581817865372,-0.013857697136700153,-0.03776516765356064,-0.027214746922254562,0.0075242784805595875,0.041804589331150055,0.040791310369968414,0.07015242427587509,0.005559339188039303,-0.00955768208950758,-0.0806960016489029,-0.0681292936205864,-0.07720430195331573,-0.024089330807328224,0.0507383868098259,0.05882493034005165,-0.02149793691933155,0.06356269121170044,0.036258943378925323,-0.032822009176015854,0.021429473534226418,0.03721659630537033,0.014596688561141491,0.0075704921036958694,0.031083006411790848,0.029439851641654968,-0.06597265601158142,-0.005223862361162901,-0.07941228896379471,-0.00976992305368185,0.06317929178476334,0.08209268003702164,0.04050375893712044,-0.0167122520506382,0.04655604436993599,0.0015438805567100644,0.04732627421617508,-0.024109868332743645,-0.04781579598784447,-0.06521953642368317,-0.07123417407274246,-0.002923445776104927,0.05392970144748688,0.09652847796678543,-0.0856083482503891,-0.0450429730117321,-0.014281750656664371,0.03386438637971878,0.07605066895484924,-0.12987767159938812,-0.01839648373425007,-0.12495505064725876,0.0486784502863884,-0.02846422977745533,0.06712671369314194,-0.00516909034922719,-0.05452534556388855,0.15259428322315216,-0.055059369653463364,0.016075527295470238,-0.006682161241769791,0.0170579981058836,0.00505270017310977,-0.10305316746234894,0.03560167923569679,0.022292129695415497,0.09287931025028229,0.04682648181915283,0.04411185160279274,-0.0033265319652855396,0.024171488359570503,-0.060522858053445816,0.1258382499217987,0.0010808875085785985,2.678684249985963E-4,0.14235879480838776,-0.07270616292953491,0.0955905094742775,-0.03150748834013939,-0.04603571072220802,-0.020621588453650475,-0.03113093227148056,-0.018430715426802635,0.07123759388923645,-0.07002747803926468,-0.03310956433415413,0.033670973032712936,-0.07559879869222641,0.07635533064603806,0.0020351153798401356,-0.027064124122262,-0.13104157149791718,0.05052700266242027,0.03368809074163437,-0.00955768208950758,-0.029686324298381805,-0.08044610172510147,0.08161000907421112,-0.06940957903862,0.03427346423268318,-0.05576455220580101,-0.027320867404341698,-0.04107886180281639,-0.03577626496553421,0.0187593474984169,-8.489631582051516E-4,-0.098582424223423,0.014220133423805237,0.06881051510572433,-0.00477884104475379,-0.05229339376091957,0.14443498849868774,0.06601373106241226,0.010543574579060078,-0.06921788305044174,0.054853975772857666,-0.016787560656666756,-0.043132804334163666,0.0543336421251297,0.07504252344369888,0.034216124564409256,-0.01677386835217476,-0.018184242770075798,-0.0562780424952507,-0.026215162128210068,-0.05749671533703804,-0.05175936594605446,-0.06246725469827652,-0.015000632032752037,0.10397060215473175,-0.020662667229771614,-0.05688053369522095,0.03514981269836426,0.037655625492334366,0.014357062987983227,-0.025215575471520424,0.05266310274600983,0.045727621763944626,-0.014042124152183533,-0.0031493795104324818,-0.07477722316980362,0.086963951587677,0.02310001477599144,-0.10989109426736832,-0.047048989683389664,-0.0547170452773571,-0.02055654674768448,-0.031877197325229645,0.042823005467653275,-0.05081455036997795,-0.03278093412518501,0.008592328988015652,-0.009270130656659603,-0.022661838680505753,-0.08174693584442139,-0.05882493034005165,0.06775273382663727,0.04511828348040581,0.011508071795105934,-0.004227699711918831,0.05078716576099396,-0.07170315086841583,-0.492508202791214,0.029594752937555313,0.054237790405750275,0.0808979719877243,0.06886186450719833,0.005367638077586889,0.007051871623843908],"embeddingsByType":{"float":[-0.0944368839263916,0.07884403318166733,0.04861341044306755,0.01253932248800993,0.07099796831607819,-0.06391870975494385,0.016239842399954796,0.0544363409280777,0.027892548590898514,0.017718682065606117,-0.01724734529852867,0.06530170142650604,0.012446895241737366,-0.0947560966014862,-0.020621588453650475,-0.06218312680721283,-0.025729060173034668,-0.06211123615503311,0.08439737558364868,0.005627803970128298,-0.059602007269859314,0.029576780274510384,0.06017368659377098,-0.03541340306401253,-0.05041574686765671,-0.04588508978486061,-0.06186476722359657,-0.061127059161663055,0.015418266877532005,-0.09817847609519958,0.08339351415634155,-0.011714322492480278,-0.015609968453645706,-0.023935282602906227,0.027495453134179115,0.06756959110498428,0.03417761251330376,-0.038919657468795776,-0.021717024967074394,-0.02830333635210991,0.09334144741296768,-0.04973109811544418,-0.010735276155173779,0.03623155876994133,0.005819505546241999,0.06371331214904785,0.03853197395801544,0.05733753740787506,0.07452390342950821,-0.015651045367121696,-0.020662667229771614,0.04120209813117981,-0.077443927526474,0.05051330849528313,-0.012994613498449326,0.02341495081782341,-0.005353945307433605,0.08305118978023529,-0.01673278957605362,0.026016611605882645,0.033561430871486664,-0.013857269659638405,0.06689351052045822,0.0039264545775949955,9.448138880543411E-4,-0.06906726211309433,-0.05759256333112717,0.00979046244174242,-0.001293984125368297,0.010879051871597767,-0.03232307359576225,0.0158290546387434,-0.006490460596978664,-0.08732510358095169,-0.030170712620019913,0.015199178829789162,0.07484568655490875,-0.015883825719356537,-0.10873574763536453,0.13835960626602173,0.028467651456594467,0.009475523605942726,-0.07920004427433014,-0.0175954457372427,0.07230564206838608,-0.005668883211910725,0.0353689007461071,0.07751581817865372,-0.013857697136700153,-0.03776516765356064,-0.027214746922254562,0.0075242784805595875,0.041804589331150055,0.040791310369968414,0.07015242427587509,0.005559339188039303,-0.00955768208950758,-0.0806960016489029,-0.0681292936205864,-0.07720430195331573,-0.024089330807328224,0.0507383868098259,0.05882493034005165,-0.02149793691933155,0.06356269121170044,0.036258943378925323,-0.032822009176015854,0.021429473534226418,0.03721659630537033,0.014596688561141491,0.0075704921036958694,0.031083006411790848,0.029439851641654968,-0.06597265601158142,-0.005223862361162901,-0.07941228896379471,-0.00976992305368185,0.06317929178476334,0.08209268003702164,0.04050375893712044,-0.0167122520506382,0.04655604436993599,0.0015438805567100644,0.04732627421617508,-0.024109868332743645,-0.04781579598784447,-0.06521953642368317,-0.07123417407274246,-0.002923445776104927,0.05392970144748688,0.09652847796678543,-0.0856083482503891,-0.0450429730117321,-0.014281750656664371,0.03386438637971878,0.07605066895484924,-0.12987767159938812,-0.01839648373425007,-0.12495505064725876,0.0486784502863884,-0.02846422977745533,0.06712671369314194,-0.00516909034922719,-0.05452534556388855,0.15259428322315216,-0.055059369653463364,0.016075527295470238,-0.006682161241769791,0.0170579981058836,0.00505270017310977,-0.10305316746234894,0.03560167923569679,0.022292129695415497,0.09287931025028229,0.04682648181915283,0.04411185160279274,-0.0033265319652855396,0.024171488359570503,-0.060522858053445816,0.1258382499217987,0.0010808875085785985,2.678684249985963E-4,0.14235879480838776,-0.07270616292953491,0.0955905094742775,-0.03150748834013939,-0.04603571072220802,-0.020621588453650475,-0.03113093227148056,-0.018430715426802635,0.07123759388923645,-0.07002747803926468,-0.03310956433415413,0.033670973032712936,-0.07559879869222641,0.07635533064603806,0.0020351153798401356,-0.027064124122262,-0.13104157149791718,0.05052700266242027,0.03368809074163437,-0.00955768208950758,-0.029686324298381805,-0.08044610172510147,0.08161000907421112,-0.06940957903862,0.03427346423268318,-0.05576455220580101,-0.027320867404341698,-0.04107886180281639,-0.03577626496553421,0.0187593474984169,-8.489631582051516E-4,-0.098582424223423,0.014220133423805237,0.06881051510572433,-0.00477884104475379,-0.05229339376091957,0.14443498849868774,0.06601373106241226,0.010543574579060078,-0.06921788305044174,0.054853975772857666,-0.016787560656666756,-0.043132804334163666,0.0543336421251297,0.07504252344369888,0.034216124564409256,-0.01677386835217476,-0.018184242770075798,-0.0562780424952507,-0.026215162128210068,-0.05749671533703804,-0.05175936594605446,-0.06246725469827652,-0.015000632032752037,0.10397060215473175,-0.020662667229771614,-0.05688053369522095,0.03514981269836426,0.037655625492334366,0.014357062987983227,-0.025215575471520424,0.05266310274600983,0.045727621763944626,-0.014042124152183533,-0.0031493795104324818,-0.07477722316980362,0.086963951587677,0.02310001477599144,-0.10989109426736832,-0.047048989683389664,-0.0547170452773571,-0.02055654674768448,-0.031877197325229645,0.042823005467653275,-0.05081455036997795,-0.03278093412518501,0.008592328988015652,-0.009270130656659603,-0.022661838680505753,-0.08174693584442139,-0.05882493034005165,0.06775273382663727,0.04511828348040581,0.011508071795105934,-0.004227699711918831,0.05078716576099396,-0.07170315086841583,-0.492508202791214,0.029594752937555313,0.054237790405750275,0.0808979719877243,0.06886186450719833,0.005367638077586889,0.007051871623843908]},"inputTextTokenCount":2}' + headers: + Connection: + - keep-alive + Content-Length: + - '10718' + Content-Type: + - application/json + Date: + - Sun, 08 Nov 2026 22:14:21 GMT + X-Amzn-Bedrock-Input-Token-Count: + - '2' + X-Amzn-Bedrock-Invocation-Latency: + - '102' + x-amzn-RequestId: + - 83200696-0372-4391-a3c7-4d86cb86f9a5 + status: + code: 200 + message: OK +version: 1 diff --git a/py/src/braintrust/integrations/bedrock_runtime/test_bedrock_runtime.py b/py/src/braintrust/integrations/bedrock_runtime/test_bedrock_runtime.py index cfa227f2c..8e0e43713 100644 --- a/py/src/braintrust/integrations/bedrock_runtime/test_bedrock_runtime.py +++ b/py/src/braintrust/integrations/bedrock_runtime/test_bedrock_runtime.py @@ -244,6 +244,52 @@ def test_wrap_bedrock_invoke_model_preserves_response_body_and_logs_json(memory_ assert_metrics_are_valid(span["metrics"], start, end) +@pytest.mark.vcr +def test_wrap_bedrock_invoke_model_titan_embedding_logs_token_metrics(memory_logger): + assert not memory_logger.pop() + client = wrap_bedrock(_bedrock_client()) + + response = client.invoke_model( + modelId="amazon.titan-embed-text-v2:0", + body=json.dumps({"inputText": "hello", "dimensions": 256}), + contentType="application/json", + accept="application/json", + ) + response_body = json.loads(response["body"].read()) + assert len(response_body["embedding"]) == 256 + + spans = memory_logger.pop() + assert len(spans) == 1 + span = spans[0] + assert span["metrics"]["prompt_tokens"] == 2 + assert span["metrics"]["tokens"] == 2 + # The embedding vector is summarized instead of logged in full. + assert span["output"] == {"embedding_length": 256, "inputTextTokenCount": 2} + + +@pytest.mark.vcr +def test_wrap_bedrock_invoke_model_cohere_embedding_summarizes_vectors(memory_logger): + assert not memory_logger.pop() + client = wrap_bedrock(_bedrock_client()) + + response = client.invoke_model( + modelId="cohere.embed-english-v3", + body=json.dumps({"texts": ["hello", "hi"], "input_type": "search_document"}), + contentType="application/json", + accept="application/json", + ) + assert len(json.loads(response["body"].read())["embeddings"]) == 2 + + spans = memory_logger.pop() + assert len(spans) == 1 + span = spans[0] + # Cohere reports no token counts in the body; Bedrock sends them in response headers. + assert span["metrics"]["prompt_tokens"] == 2 + assert span["output"]["embedding_count"] == 2 + assert span["output"]["embedding_length"] == 1024 + assert "embeddings" not in span["output"] + + # A 1x1 transparent PNG for image tests. _TINY_PNG_BYTES = base64.b64decode( "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=" @@ -413,3 +459,23 @@ def test_wrap_bedrock_converse_with_document_input_materializes_attachment(memor @pytest.mark.vcr def test_auto_instrument_bedrock_runtime_subprocess(): verify_autoinstrument_script("test_auto_bedrock_runtime.py", timeout=60) + + +@pytest.mark.parametrize( + "output, expected", + [ + ({"embeddings": {"float": [[0.1, 0.2], [0.3, 0.4]]}}, {"embedding_count": 2, "embedding_length": 2}), + ( + {"embeddingsByType": {"binary": [1, 0, 1]}, "inputTextTokenCount": 3}, + {"embedding_length": 3, "inputTextTokenCount": 3}, + ), + ({"embedding": [0.1, 0.2]}, {"embedding_length": 2}), + ({"embeddings": [[0.1, 0.2]]}, {"embedding_count": 1, "embedding_length": 2}), + ({"embeddings": {}}, {"embeddings": {}}), + ({"message": "text"}, {"message": "text"}), + ], +) +def test_summarize_embeddings(output, expected): + from braintrust.integrations.bedrock_runtime.tracing import _summarize_embeddings + + assert _summarize_embeddings(output) == expected diff --git a/py/src/braintrust/integrations/bedrock_runtime/tracing.py b/py/src/braintrust/integrations/bedrock_runtime/tracing.py index c778e359e..15da3f9aa 100644 --- a/py/src/braintrust/integrations/bedrock_runtime/tracing.py +++ b/py/src/braintrust/integrations/bedrock_runtime/tracing.py @@ -113,10 +113,11 @@ def _invoke_model_wrapper(wrapped, instance, args, kwargs): # noqa: ARG001 output_usage = output.get("usage") if isinstance(output, dict) else None metrics = { **_timing_metrics(start_time, time.time()), + **_invoke_header_usage_metrics(result), **_converse_usage_metrics(output_usage), **_anthropic_invoke_usage_metrics(model_id, output), } - _log_and_end_span(span, output=output, metrics=metrics) + _log_and_end_span(span, output=_summarize_embeddings(output), metrics=metrics) return result @@ -535,6 +536,65 @@ def _replacement_streaming_body(data: bytes) -> Any: return StreamingBody(io.BytesIO(data), len(data)) +def _invoke_header_usage_metrics(result: Any) -> dict[str, Any]: + """Token counts Bedrock reports in the response headers for every InvokeModel call.""" + metadata = result.get("ResponseMetadata") if isinstance(result, dict) else None + headers = metadata.get("HTTPHeaders") if isinstance(metadata, dict) else None + if not isinstance(headers, dict): + return {} + metrics: dict[str, Any] = {} + for header, key in ( + ("x-amzn-bedrock-input-token-count", "prompt_tokens"), + ("x-amzn-bedrock-output-token-count", "completion_tokens"), + ): + try: + metrics[key] = int(headers[header]) + except (KeyError, TypeError, ValueError): + pass + if "prompt_tokens" in metrics and "completion_tokens" in metrics: + metrics["tokens"] = metrics["prompt_tokens"] + metrics["completion_tokens"] + elif "prompt_tokens" in metrics: + metrics["tokens"] = metrics["prompt_tokens"] + return metrics + + +def _is_vector(value: Any) -> bool: + return isinstance(value, list) and bool(value) and all(is_numeric(v) for v in value) + + +def _summarize_embeddings(output: Any) -> Any: + """Replace embedding vectors in an InvokeModel body with their length/count.""" + if not isinstance(output, dict): + return output + embedding = output.get("embedding") + if not _is_vector(embedding): + typed_embeddings = output.get("embeddingsByType") + if isinstance(typed_embeddings, dict): + embedding = next((value for value in typed_embeddings.values() if _is_vector(value)), None) + embeddings = output.get("embeddings") + if isinstance(embeddings, dict): + embeddings = next( + ( + value + for value in embeddings.values() + if isinstance(value, list) and value and all(_is_vector(e) for e in value) + ), + None, + ) + if not _is_vector(embedding) and not ( + isinstance(embeddings, list) and embeddings and all(_is_vector(e) for e in embeddings) + ): + return output + # Titan v2 repeats the vector under embeddingsByType. + summary = {k: v for k, v in output.items() if k not in ("embedding", "embeddings", "embeddingsByType")} + if _is_vector(embedding): + summary["embedding_length"] = len(embedding) + else: + summary["embedding_count"] = len(embeddings) + summary["embedding_length"] = len(embeddings[0]) + return summary + + def _anthropic_invoke_usage_metrics(model_id: Any, output: Any) -> dict[str, Any]: if not isinstance(model_id, str) or "anthropic.claude" not in model_id.lower(): return {}