12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601(* generated by: awso-codegen generate-all --botocore-data vendor/botocore/botocore/data -o aws --runtime-dir lib/runtime/awso --cli-dir awso-cli *)openAwsoopen!Import[@@@warning"-32"]letservice=Service.bedrock_runtimeletapiVersion="2023-09-30"letendpointPrefix="bedrock-runtime"letserviceFullName="Amazon Bedrock Runtime"letsignatureVersion="v4"letprotocol="rest_json"letglobalEndpoint=endpointPrefix^".amazonaws.com"letsimple_to_jsonto_valuex=Botodata.Json.value_to_json_scalar(to_valuex)letcomposed_to_jsonto_valuex=Botodata.Json.value_to_json(to_valuex)letto_queryto_valuex=Client.Query.of_value(to_valuex)letstructure_to_value_auxst~f=letfilter=function|(k,Somev)->Some(k,v)|_->Noneinletpairkv=(k,v)inletdefer_value(k,dv)=pairkdvin((List.filter_mapst~f:filter)|>(List.map~f:defer_value))|>(funx->`Structure(fx))letstructure_to_value=structure_to_value_aux~f:Fn.idletstructure_to_wrapped_value~wrapper~response=structure_to_value_aux~f:(funx->[(wrapper,(`Structurex));(response,(`Structure[]))])moduleGuardrailAutomatedReasoningStatementNaturalLanguageContent=structtypenonrect=stringletcontext_="GuardrailAutomatedReasoningStatementNaturalLanguageContent"letmakei=letopenResultinok_or_failwith((check_string_maxi~max:1000)>>=(fun()->check_string_mini~min:0));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"GuardrailAutomatedReasoningStatementNaturalLanguageContent"jletto_json=simple_to_jsonto_valueendmoduleGuardrailAutomatedReasoningStatementLogicContent=structtypenonrect=stringletcontext_="GuardrailAutomatedReasoningStatementLogicContent"letmakei=letopenResultinok_or_failwith((check_string_maxi~max:1000)>>=(fun()->check_string_mini~min:0));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"GuardrailAutomatedReasoningStatementLogicContent"jletto_json=simple_to_jsonto_valueendmoduleGuardrailAutomatedReasoningInputTextReference=structtypenonrect={text:GuardrailAutomatedReasoningStatementNaturalLanguageContent.toption[@ocaml.doc"The specific text from the original input that this reference points to."]}letmake?text=fun()->{text}letto_valuex=structure_to_value[("text",(Option.mapx.text~f:GuardrailAutomatedReasoningStatementNaturalLanguageContent.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lettext=(Option.map~f:GuardrailAutomatedReasoningStatementNaturalLanguageContent.of_xml)(Xml.childxml_arg0"text")inmake?text()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lettext=field_mapjson__"text"GuardrailAutomatedReasoningStatementNaturalLanguageContent.of_jsoninmake?text()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"References a portion of the original input text that corresponds to logical elements."]moduleGuardrailAutomatedReasoningStatement=structtypenonrect={logic:GuardrailAutomatedReasoningStatementLogicContent.toption[@ocaml.doc"The formal logical representation of the statement."];naturalLanguage:GuardrailAutomatedReasoningStatementNaturalLanguageContent.toption[@ocaml.doc"The natural language explanation of the logical statement."]}letmake?logic=fun?naturalLanguage->fun()->{logic;naturalLanguage}letto_valuex=structure_to_value[("logic",(Option.mapx.logic~f:GuardrailAutomatedReasoningStatementLogicContent.to_value));("naturalLanguage",(Option.mapx.naturalLanguage~f:GuardrailAutomatedReasoningStatementNaturalLanguageContent.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letnaturalLanguage=(Option.map~f:GuardrailAutomatedReasoningStatementNaturalLanguageContent.of_xml)(Xml.childxml_arg0"naturalLanguage")inletlogic=(Option.map~f:GuardrailAutomatedReasoningStatementLogicContent.of_xml)(Xml.childxml_arg0"logic")inmake?naturalLanguage?logic()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letnaturalLanguage=field_mapjson__"naturalLanguage"GuardrailAutomatedReasoningStatementNaturalLanguageContent.of_jsoninletlogic=field_mapjson__"logic"GuardrailAutomatedReasoningStatementLogicContent.of_jsoninmake?naturalLanguage?logic()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A logical statement that includes both formal logic representation and natural language explanation."]moduleGuardrailAutomatedReasoningInputTextReferenceList=structtypenonrect=GuardrailAutomatedReasoningInputTextReference.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:GuardrailAutomatedReasoningInputTextReference.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:GuardrailAutomatedReasoningInputTextReference.of_xml)letof_jsonj=list_of_json~kind:"GuardrailAutomatedReasoningInputTextReferenceList"~of_json:GuardrailAutomatedReasoningInputTextReference.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleGuardrailAutomatedReasoningStatementList=structtypenonrect=GuardrailAutomatedReasoningStatement.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:GuardrailAutomatedReasoningStatement.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:GuardrailAutomatedReasoningStatement.of_xml)letof_jsonj=list_of_json~kind:"GuardrailAutomatedReasoningStatementList"~of_json:GuardrailAutomatedReasoningStatement.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleGuardrailAutomatedReasoningTranslationConfidence=structtypenonrect=floatletmakei=letopenResultinok_or_failwith((check_float_mini~min:1.)>>=(fun()->check_float_mini~min:0.));iletof_string=Float.of_stringletto_valuex=`Doublexletto_queryv=to_queryto_valuevletto_headerx=Stdlib.Float.to_stringxletof_xmlxml_arg0=Float.of_string(string_of_xml~kind:"a double"xml_arg0)letof_jsonj=float_of_json~kind:"a double"jletto_json=simple_to_jsonto_valueendmoduleGuardrailAutomatedReasoningTranslation=structtypenonrect={premises:GuardrailAutomatedReasoningStatementList.toption[@ocaml.doc"The logical statements that serve as the foundation or assumptions for the claims."];claims:GuardrailAutomatedReasoningStatementList.toption[@ocaml.doc"The logical statements that are being validated against the premises and policy rules."];untranslatedPremises:GuardrailAutomatedReasoningInputTextReferenceList.toption[@ocaml.doc"References to portions of the original input text that correspond to the premises but could not be fully translated."];untranslatedClaims:GuardrailAutomatedReasoningInputTextReferenceList.toption[@ocaml.doc"References to portions of the original input text that correspond to the claims but could not be fully translated."];confidence:GuardrailAutomatedReasoningTranslationConfidence.toption[@ocaml.doc"A confidence score between 0 and 1 indicating how certain the system is about the logical translation."]}letmake?premises=fun?claims->fun?untranslatedPremises->fun?untranslatedClaims->fun?confidence->fun()->{premises;claims;untranslatedPremises;untranslatedClaims;confidence}letto_valuex=structure_to_value[("premises",(Option.mapx.premises~f:GuardrailAutomatedReasoningStatementList.to_value));("claims",(Option.mapx.claims~f:GuardrailAutomatedReasoningStatementList.to_value));("untranslatedPremises",(Option.mapx.untranslatedPremises~f:GuardrailAutomatedReasoningInputTextReferenceList.to_value));("untranslatedClaims",(Option.mapx.untranslatedClaims~f:GuardrailAutomatedReasoningInputTextReferenceList.to_value));("confidence",(Option.mapx.confidence~f:GuardrailAutomatedReasoningTranslationConfidence.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letconfidence=(Option.map~f:GuardrailAutomatedReasoningTranslationConfidence.of_xml)(Xml.childxml_arg0"confidence")inletuntranslatedClaims=(Option.map~f:GuardrailAutomatedReasoningInputTextReferenceList.of_xml)(Xml.childxml_arg0"untranslatedClaims")inletuntranslatedPremises=(Option.map~f:GuardrailAutomatedReasoningInputTextReferenceList.of_xml)(Xml.childxml_arg0"untranslatedPremises")inletclaims=(Option.map~f:GuardrailAutomatedReasoningStatementList.of_xml)(Xml.childxml_arg0"claims")inletpremises=(Option.map~f:GuardrailAutomatedReasoningStatementList.of_xml)(Xml.childxml_arg0"premises")inmake?confidence?untranslatedClaims?untranslatedPremises?claims?premises()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letconfidence=field_mapjson__"confidence"GuardrailAutomatedReasoningTranslationConfidence.of_jsoninletuntranslatedClaims=field_mapjson__"untranslatedClaims"GuardrailAutomatedReasoningInputTextReferenceList.of_jsoninletuntranslatedPremises=field_mapjson__"untranslatedPremises"GuardrailAutomatedReasoningInputTextReferenceList.of_jsoninletclaims=field_mapjson__"claims"GuardrailAutomatedReasoningStatementList.of_jsoninletpremises=field_mapjson__"premises"GuardrailAutomatedReasoningStatementList.of_jsoninmake?confidence?untranslatedClaims?untranslatedPremises?claims?premises()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Contains the logical translation of natural language input into formal logical statements, including premises, claims, and confidence scores."]moduleString_=structtypenonrect=stringletcontext_="String"letmakei=iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"String"jletto_json=simple_to_jsonto_valueendmoduleAutomatedReasoningRuleIdentifier=structtypenonrect=stringletcontext_="AutomatedReasoningRuleIdentifier"letmakei=letopenResultinok_or_failwith((check_string_mini~min:0)>>=(fun()->(check_string_maxi~max:12)>>=(fun()->check_patterni~pattern:"[a-z0-9]{12}")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"AutomatedReasoningRuleIdentifier"jletto_json=simple_to_jsonto_valueendmoduleGuardrailAutomatedReasoningPolicyVersionArn=structtypenonrect=stringletcontext_="GuardrailAutomatedReasoningPolicyVersionArn"letmakei=letopenResultinok_or_failwith((check_string_mini~min:0)>>=(fun()->(check_string_maxi~max:2048)>>=(fun()->check_patterni~pattern:"arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:automated-reasoning-policy/[a-z0-9]{12}(:([1-9][0-9]{0,11}))?")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"GuardrailAutomatedReasoningPolicyVersionArn"jletto_json=simple_to_jsonto_valueendmoduleGuardrailAutomatedReasoningTranslationList=structtypenonrect=GuardrailAutomatedReasoningTranslation.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:GuardrailAutomatedReasoningTranslation.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:GuardrailAutomatedReasoningTranslation.of_xml)letof_jsonj=list_of_json~kind:"GuardrailAutomatedReasoningTranslationList"~of_json:GuardrailAutomatedReasoningTranslation.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleDocumentContentBlock=structtypenonrect={text:String_.toption[@ocaml.doc"The text content of the document."]}letmake?text=fun()->{text}letto_valuex=structure_to_value[("text",(Option.mapx.text~f:String_.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lettext=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"text")inmake?text()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lettext=field_mapjson__"text"String_.of_jsoninmake?text()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Contains the actual content of a document that can be processed by the model and potentially cited in the response."]moduleAccountId=structtypenonrect=stringletcontext_="AccountId"letmakei=letopenResultinok_or_failwith(check_patterni~pattern:"[0-9]{12}");iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"AccountId"jletto_json=simple_to_jsonto_valueendmoduleS3Uri=structtypenonrect=stringletcontext_="S3Uri"letmakei=letopenResultinok_or_failwith((check_string_mini~min:1)>>=(fun()->(check_string_maxi~max:1024)>>=(fun()->check_patterni~pattern:"s3://[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9](/.*)?")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"S3Uri"jletto_json=simple_to_jsonto_valueendmoduleGuardrailAutomatedReasoningLogicWarningType=structtypenonrect=|ALWAYS_FALSE|ALWAYS_TRUE|Non_static_idofstringletmakei=iletto_string=function|ALWAYS_FALSE->"ALWAYS_FALSE"|ALWAYS_TRUE->"ALWAYS_TRUE"|Non_static_ids->sletof_string=function|"ALWAYS_FALSE"->ALWAYS_FALSE|"ALWAYS_TRUE"->ALWAYS_TRUE|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration GuardrailAutomatedReasoningLogicWarningType"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"GuardrailAutomatedReasoningLogicWarningType"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailAutomatedReasoningRule=structtypenonrect={identifier:AutomatedReasoningRuleIdentifier.toption[@ocaml.doc"The unique identifier of the automated reasoning rule."];policyVersionArn:GuardrailAutomatedReasoningPolicyVersionArn.toption[@ocaml.doc"The ARN of the automated reasoning policy version that contains this rule."]}letmake?identifier=fun?policyVersionArn->fun()->{identifier;policyVersionArn}letto_valuex=structure_to_value[("identifier",(Option.mapx.identifier~f:AutomatedReasoningRuleIdentifier.to_value));("policyVersionArn",(Option.mapx.policyVersionArn~f:GuardrailAutomatedReasoningPolicyVersionArn.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letpolicyVersionArn=(Option.map~f:GuardrailAutomatedReasoningPolicyVersionArn.of_xml)(Xml.childxml_arg0"policyVersionArn")inletidentifier=(Option.map~f:AutomatedReasoningRuleIdentifier.of_xml)(Xml.childxml_arg0"identifier")inmake?policyVersionArn?identifier()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letpolicyVersionArn=field_mapjson__"policyVersionArn"GuardrailAutomatedReasoningPolicyVersionArn.of_jsoninletidentifier=field_mapjson__"identifier"AutomatedReasoningRuleIdentifier.of_jsoninmake?policyVersionArn?identifier()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"References a specific automated reasoning policy rule that was applied during evaluation."]moduleGuardrailAutomatedReasoningScenario=structtypenonrect={statements:GuardrailAutomatedReasoningStatementList.toption[@ocaml.doc"List of logical assignments and statements that define this scenario."]}letmake?statements=fun()->{statements}letto_valuex=structure_to_value[("statements",(Option.mapx.statements~f:GuardrailAutomatedReasoningStatementList.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letstatements=(Option.map~f:GuardrailAutomatedReasoningStatementList.of_xml)(Xml.childxml_arg0"statements")inmake?statements()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letstatements=field_mapjson__"statements"GuardrailAutomatedReasoningStatementList.of_jsoninmake?statements()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Represents a logical scenario where claims can be evaluated as true or false, containing specific logical assignments."]moduleGuardrailAutomatedReasoningTranslationOption=structtypenonrect={translations:GuardrailAutomatedReasoningTranslationList.toption[@ocaml.doc"Example translations that provide this possible interpretation of the input."]}letmake?translations=fun()->{translations}letto_valuex=structure_to_value[("translations",(Option.mapx.translations~f:GuardrailAutomatedReasoningTranslationList.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lettranslations=(Option.map~f:GuardrailAutomatedReasoningTranslationList.of_xml)(Xml.childxml_arg0"translations")inmake?translations()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lettranslations=field_mapjson__"translations"GuardrailAutomatedReasoningTranslationList.of_jsoninmake?translations()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Represents one possible logical interpretation of ambiguous input content."]moduleDocumentCharLocationDocumentIndexInteger=structtypenonrect=intletmakei=letopenResultinok_or_failwith(check_int_mini~min:0);iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for DocumentCharLocationDocumentIndexInteger"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleDocumentCharLocationEndInteger=structtypenonrect=intletmakei=letopenResultinok_or_failwith(check_int_mini~min:0);iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for DocumentCharLocationEndInteger"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleDocumentCharLocationStartInteger=structtypenonrect=intletmakei=letopenResultinok_or_failwith(check_int_mini~min:0);iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for DocumentCharLocationStartInteger"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleDocumentChunkLocationDocumentIndexInteger=structtypenonrect=intletmakei=letopenResultinok_or_failwith(check_int_mini~min:0);iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for DocumentChunkLocationDocumentIndexInteger"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleDocumentChunkLocationEndInteger=structtypenonrect=intletmakei=letopenResultinok_or_failwith(check_int_mini~min:0);iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for DocumentChunkLocationEndInteger"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleDocumentChunkLocationStartInteger=structtypenonrect=intletmakei=letopenResultinok_or_failwith(check_int_mini~min:0);iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for DocumentChunkLocationStartInteger"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleDocumentPageLocationDocumentIndexInteger=structtypenonrect=intletmakei=letopenResultinok_or_failwith(check_int_mini~min:0);iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for DocumentPageLocationDocumentIndexInteger"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleDocumentPageLocationEndInteger=structtypenonrect=intletmakei=letopenResultinok_or_failwith(check_int_mini~min:0);iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for DocumentPageLocationEndInteger"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleDocumentPageLocationStartInteger=structtypenonrect=intletmakei=letopenResultinok_or_failwith(check_int_mini~min:0);iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for DocumentPageLocationStartInteger"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleSearchResultLocationEndInteger=structtypenonrect=intletmakei=letopenResultinok_or_failwith(check_int_mini~min:0);iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for SearchResultLocationEndInteger"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleSearchResultLocationSearchResultIndexInteger=structtypenonrect=intletmakei=letopenResultinok_or_failwith(check_int_mini~min:0);iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for SearchResultLocationSearchResultIndexInteger"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleSearchResultLocationStartInteger=structtypenonrect=intletmakei=letopenResultinok_or_failwith(check_int_mini~min:0);iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for SearchResultLocationStartInteger"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleBoolean=structtypenonrect=boolletmakei=iletof_string=Bool.of_stringletto_valuex=`Booleanxletto_queryv=to_queryto_valuevletto_headerx=Bool.to_stringxletof_xmlxml_arg0=Bool.of_string(string_of_xml~kind:"a boolean"xml_arg0)letof_json=bool_of_jsonletto_json=simple_to_jsonto_valueendmoduleDocumentContentBlocks=structtypenonrect=DocumentContentBlock.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:DocumentContentBlock.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:DocumentContentBlock.of_xml)letof_jsonj=list_of_json~kind:"DocumentContentBlocks"~of_json:DocumentContentBlock.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleDocumentSourceBytesBlob=structtypenonrect=stringletmakei=iletof_stringx=xletto_valuex=`Blobxletto_queryv=to_queryto_valuevletto_headerx=xletof_xmlxml_arg0=string_of_xml~kind:"a blob"xml_arg0letof_jsonj=string_of_json~kind:"a blob"jletto_json=simple_to_jsonto_valueendmoduleS3Location=structtypenonrect={uri:S3Uri.t[@ocaml.doc"An object URI starting with s3://."];bucketOwner:AccountId.toption[@ocaml.doc"If the bucket belongs to another AWS account, specify that account's ID."]}letcontext_="S3Location"letmake?bucketOwner=fun~uri->fun()->{bucketOwner;uri}letto_valuex=structure_to_value[("uri",(Some(S3Uri.to_valuex.uri)));("bucketOwner",(Option.mapx.bucketOwner~f:AccountId.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letbucketOwner=(Option.map~f:AccountId.of_xml)(Xml.childxml_arg0"bucketOwner")inleturi=S3Uri.of_xml(Xml.child_exn~context:context_xml_arg0"uri")inmake?bucketOwner~uri()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letbucketOwner=field_mapjson__"bucketOwner"AccountId.of_jsoninleturi=field_map_exnjson__"uri"S3Uri.of_jsoninmake?bucketOwner~uri()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A storage location in an Amazon S3 bucket."]moduleImageSourceBytesBlob=structtypenonrect=stringletmakei=iletof_stringx=xletto_valuex=`Blobxletto_queryv=to_queryto_valuevletto_headerx=xletof_xmlxml_arg0=string_of_xml~kind:"a blob"xml_arg0letof_jsonj=string_of_json~kind:"a blob"jletto_json=simple_to_jsonto_valueendmoduleSearchResultContentBlock=structtypenonrect={text:String_.t[@ocaml.doc"The actual text content"]}letcontext_="SearchResultContentBlock"letmake~text=fun()->{text}letto_valuex=structure_to_value[("text",(Some(String_.to_valuex.text)))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lettext=String_.of_xml(Xml.child_exn~context:context_xml_arg0"text")inmake~text()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lettext=field_map_exnjson__"text"String_.of_jsoninmake~text()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A block within a search result that contains the content."]moduleVideoSourceBytesBlob=structtypenonrect=stringletmakei=iletof_stringx=xletto_valuex=`Blobxletto_queryv=to_queryto_valuevletto_headerx=xletof_xmlxml_arg0=string_of_xml~kind:"a blob"xml_arg0letof_jsonj=string_of_json~kind:"a blob"jletto_json=simple_to_jsonto_valueendmoduleGuardrailAutomatedReasoningLogicWarning=structtypenonrect={type_:GuardrailAutomatedReasoningLogicWarningType.toption[@ocaml.doc"The category of the detected logical issue, such as statements that are always true or always false."];premises:GuardrailAutomatedReasoningStatementList.toption[@ocaml.doc"The logical statements that serve as premises under which the claims are validated."];claims:GuardrailAutomatedReasoningStatementList.toption[@ocaml.doc"The logical statements that are validated while assuming the policy and premises."]}letmake?type_=fun?premises->fun?claims->fun()->{type_;premises;claims}letto_valuex=structure_to_value[("type",(Option.mapx.type_~f:GuardrailAutomatedReasoningLogicWarningType.to_value));("premises",(Option.mapx.premises~f:GuardrailAutomatedReasoningStatementList.to_value));("claims",(Option.mapx.claims~f:GuardrailAutomatedReasoningStatementList.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letclaims=(Option.map~f:GuardrailAutomatedReasoningStatementList.of_xml)(Xml.childxml_arg0"claims")inletpremises=(Option.map~f:GuardrailAutomatedReasoningStatementList.of_xml)(Xml.childxml_arg0"premises")inlettype_=(Option.map~f:GuardrailAutomatedReasoningLogicWarningType.of_xml)(Xml.childxml_arg0"type")inmake?claims?premises?type_()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letclaims=field_mapjson__"claims"GuardrailAutomatedReasoningStatementList.of_jsoninletpremises=field_mapjson__"premises"GuardrailAutomatedReasoningStatementList.of_jsoninlettype_=field_mapjson__"type"GuardrailAutomatedReasoningLogicWarningType.of_jsoninmake?claims?premises?type_()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Identifies logical issues in the translated statements that exist independent of any policy rules, such as statements that are always true or always false."]moduleGuardrailAutomatedReasoningRuleList=structtypenonrect=GuardrailAutomatedReasoningRule.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:GuardrailAutomatedReasoningRule.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:GuardrailAutomatedReasoningRule.of_xml)letof_jsonj=list_of_json~kind:"GuardrailAutomatedReasoningRuleList"~of_json:GuardrailAutomatedReasoningRule.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleGuardrailAutomatedReasoningDifferenceScenarioList=structtypenonrect=GuardrailAutomatedReasoningScenario.tlistletmakei=letopenResultinok_or_failwith((check_list_maxi~max:2)>>=(fun()->check_list_mini~min:0));iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:GuardrailAutomatedReasoningScenario.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:GuardrailAutomatedReasoningScenario.of_xml)letof_jsonj=list_of_json~kind:"GuardrailAutomatedReasoningDifferenceScenarioList"~of_json:GuardrailAutomatedReasoningScenario.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleGuardrailAutomatedReasoningTranslationOptionList=structtypenonrect=GuardrailAutomatedReasoningTranslationOption.tlistletmakei=letopenResultinok_or_failwith((check_list_maxi~max:2)>>=(fun()->check_list_mini~min:0));iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:GuardrailAutomatedReasoningTranslationOption.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:GuardrailAutomatedReasoningTranslationOption.of_xml)letof_jsonj=list_of_json~kind:"GuardrailAutomatedReasoningTranslationOptionList"~of_json:GuardrailAutomatedReasoningTranslationOption.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleDocumentCharLocation=structtypenonrect={documentIndex:DocumentCharLocationDocumentIndexInteger.toption[@ocaml.doc"The index of the document within the array of documents provided in the request."];start:DocumentCharLocationStartInteger.toption[@ocaml.doc"The starting character position of the cited content within the document."];end_:DocumentCharLocationEndInteger.toption[@ocaml.doc"The ending character position of the cited content within the document."]}letmake?documentIndex=fun?start->fun?end_->fun()->{documentIndex;start;end_}letto_valuex=structure_to_value[("documentIndex",(Option.mapx.documentIndex~f:DocumentCharLocationDocumentIndexInteger.to_value));("start",(Option.mapx.start~f:DocumentCharLocationStartInteger.to_value));("end",(Option.mapx.end_~f:DocumentCharLocationEndInteger.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letend_=(Option.map~f:DocumentCharLocationEndInteger.of_xml)(Xml.childxml_arg0"end")inletstart=(Option.map~f:DocumentCharLocationStartInteger.of_xml)(Xml.childxml_arg0"start")inletdocumentIndex=(Option.map~f:DocumentCharLocationDocumentIndexInteger.of_xml)(Xml.childxml_arg0"documentIndex")inmake?end_?start?documentIndex()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letend_=field_mapjson__"end"DocumentCharLocationEndInteger.of_jsoninletstart=field_mapjson__"start"DocumentCharLocationStartInteger.of_jsoninletdocumentIndex=field_mapjson__"documentIndex"DocumentCharLocationDocumentIndexInteger.of_jsoninmake?end_?start?documentIndex()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Specifies a character-level location within a document, providing precise positioning information for cited content using start and end character indices."]moduleDocumentChunkLocation=structtypenonrect={documentIndex:DocumentChunkLocationDocumentIndexInteger.toption[@ocaml.doc"The index of the document within the array of documents provided in the request."];start:DocumentChunkLocationStartInteger.toption[@ocaml.doc"The starting chunk identifier or index of the cited content within the document."];end_:DocumentChunkLocationEndInteger.toption[@ocaml.doc"The ending chunk identifier or index of the cited content within the document."]}letmake?documentIndex=fun?start->fun?end_->fun()->{documentIndex;start;end_}letto_valuex=structure_to_value[("documentIndex",(Option.mapx.documentIndex~f:DocumentChunkLocationDocumentIndexInteger.to_value));("start",(Option.mapx.start~f:DocumentChunkLocationStartInteger.to_value));("end",(Option.mapx.end_~f:DocumentChunkLocationEndInteger.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letend_=(Option.map~f:DocumentChunkLocationEndInteger.of_xml)(Xml.childxml_arg0"end")inletstart=(Option.map~f:DocumentChunkLocationStartInteger.of_xml)(Xml.childxml_arg0"start")inletdocumentIndex=(Option.map~f:DocumentChunkLocationDocumentIndexInteger.of_xml)(Xml.childxml_arg0"documentIndex")inmake?end_?start?documentIndex()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letend_=field_mapjson__"end"DocumentChunkLocationEndInteger.of_jsoninletstart=field_mapjson__"start"DocumentChunkLocationStartInteger.of_jsoninletdocumentIndex=field_mapjson__"documentIndex"DocumentChunkLocationDocumentIndexInteger.of_jsoninmake?end_?start?documentIndex()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Specifies a chunk-level location within a document, providing positioning information for cited content using logical document segments or chunks."]moduleDocumentPageLocation=structtypenonrect={documentIndex:DocumentPageLocationDocumentIndexInteger.toption[@ocaml.doc"The index of the document within the array of documents provided in the request."];start:DocumentPageLocationStartInteger.toption[@ocaml.doc"The starting page number of the cited content within the document."];end_:DocumentPageLocationEndInteger.toption[@ocaml.doc"The ending page number of the cited content within the document."]}letmake?documentIndex=fun?start->fun?end_->fun()->{documentIndex;start;end_}letto_valuex=structure_to_value[("documentIndex",(Option.mapx.documentIndex~f:DocumentPageLocationDocumentIndexInteger.to_value));("start",(Option.mapx.start~f:DocumentPageLocationStartInteger.to_value));("end",(Option.mapx.end_~f:DocumentPageLocationEndInteger.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letend_=(Option.map~f:DocumentPageLocationEndInteger.of_xml)(Xml.childxml_arg0"end")inletstart=(Option.map~f:DocumentPageLocationStartInteger.of_xml)(Xml.childxml_arg0"start")inletdocumentIndex=(Option.map~f:DocumentPageLocationDocumentIndexInteger.of_xml)(Xml.childxml_arg0"documentIndex")inmake?end_?start?documentIndex()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letend_=field_mapjson__"end"DocumentPageLocationEndInteger.of_jsoninletstart=field_mapjson__"start"DocumentPageLocationStartInteger.of_jsoninletdocumentIndex=field_mapjson__"documentIndex"DocumentPageLocationDocumentIndexInteger.of_jsoninmake?end_?start?documentIndex()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Specifies a page-level location within a document, providing positioning information for cited content using page numbers."]moduleSearchResultLocation=structtypenonrect={searchResultIndex:SearchResultLocationSearchResultIndexInteger.toption[@ocaml.doc"The index of the search result content block where the cited content is found."];start:SearchResultLocationStartInteger.toption[@ocaml.doc"The starting position in the content array where the cited content begins."];end_:SearchResultLocationEndInteger.toption[@ocaml.doc"The ending position in the content array where the cited content ends."]}letmake?searchResultIndex=fun?start->fun?end_->fun()->{searchResultIndex;start;end_}letto_valuex=structure_to_value[("searchResultIndex",(Option.mapx.searchResultIndex~f:SearchResultLocationSearchResultIndexInteger.to_value));("start",(Option.mapx.start~f:SearchResultLocationStartInteger.to_value));("end",(Option.mapx.end_~f:SearchResultLocationEndInteger.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letend_=(Option.map~f:SearchResultLocationEndInteger.of_xml)(Xml.childxml_arg0"end")inletstart=(Option.map~f:SearchResultLocationStartInteger.of_xml)(Xml.childxml_arg0"start")inletsearchResultIndex=(Option.map~f:SearchResultLocationSearchResultIndexInteger.of_xml)(Xml.childxml_arg0"searchResultIndex")inmake?end_?start?searchResultIndex()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letend_=field_mapjson__"end"SearchResultLocationEndInteger.of_jsoninletstart=field_mapjson__"start"SearchResultLocationStartInteger.of_jsoninletsearchResultIndex=field_mapjson__"searchResultIndex"SearchResultLocationSearchResultIndexInteger.of_jsoninmake?end_?start?searchResultIndex()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Specifies a search result location within the content array, providing positioning information for cited content using search result index and block positions."]moduleWebLocation=structtypenonrect={url:String_.toption[@ocaml.doc"The URL that was cited when performing a web search."];domain:String_.toption[@ocaml.doc"The domain that was cited when performing a web search."]}letmake?url=fun?domain->fun()->{url;domain}letto_valuex=structure_to_value[("url",(Option.mapx.url~f:String_.to_value));("domain",(Option.mapx.domain~f:String_.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letdomain=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"domain")inleturl=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"url")inmake?domain?url()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letdomain=field_mapjson__"domain"String_.of_jsoninleturl=field_mapjson__"url"String_.of_jsoninmake?domain?url()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Provides the URL and domain information for the website that was cited when performing a web search."]moduleCitationSourceContent=structtypenonrect={text:String_.toption[@ocaml.doc"The text content from the source document that is being cited."]}letmake?text=fun()->{text}letto_valuex=structure_to_value[("text",(Option.mapx.text~f:String_.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lettext=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"text")inmake?text()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lettext=field_mapjson__"text"String_.of_jsoninmake?text()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Contains the actual text content from a source document that is being cited or referenced in the model's response."]moduleCitationsConfig=structtypenonrect={enabled:Boolean.t[@ocaml.doc"Specifies whether citations from the selected document should be used in the model's response. When set to true, the model can generate citations that reference the source documents used to inform the response."]}letcontext_="CitationsConfig"letmake~enabled=fun()->{enabled}letto_valuex=structure_to_value[("enabled",(Some(Boolean.to_valuex.enabled)))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letenabled=Boolean.of_xml(Xml.child_exn~context:context_xml_arg0"enabled")inmake~enabled()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letenabled=field_map_exnjson__"enabled"Boolean.of_jsoninmake~enabled()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Configuration settings for enabling and controlling document citations in Converse API responses. When enabled, the model can include citation information that links generated content back to specific source documents."]moduleDocumentBlockNameString=structtypenonrect=stringletcontext_="DocumentBlockNameString"letmakei=letopenResultinok_or_failwith((check_string_maxi~max:200)>>=(fun()->check_string_mini~min:1));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"DocumentBlockNameString"jletto_json=simple_to_jsonto_valueendmoduleDocumentFormat=structtypenonrect=|Pdf|Csv|Doc|Docx|Xls|Xlsx|Html|Txt|Md|Non_static_idofstringletmakei=iletto_string=function|Pdf->"pdf"|Csv->"csv"|Doc->"doc"|Docx->"docx"|Xls->"xls"|Xlsx->"xlsx"|Html->"html"|Txt->"txt"|Md->"md"|Non_static_ids->sletof_string=function|"pdf"->Pdf|"csv"->Csv|"doc"->Doc|"docx"->Docx|"xls"->Xls|"xlsx"->Xlsx|"html"->Html|"txt"->Txt|"md"->Md|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration DocumentFormat"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"DocumentFormat"j)letto_json=simple_to_jsonto_valueendmoduleDocumentSource=structtypenonrect={bytes:DocumentSourceBytesBlob.toption[@ocaml.doc"The raw bytes for the document. If you use an Amazon Web Services SDK, you don't need to encode the bytes in base64."];s3Location:S3Location.toption[@ocaml.doc"The location of a document object in an Amazon S3 bucket. To see which models support S3 uploads, see Supported models and features for Converse."];text:String_.toption[@ocaml.doc"The text content of the document source."];content:DocumentContentBlocks.toption[@ocaml.doc"The structured content of the document source, which may include various content blocks such as text, images, or other document elements."]}letmake?bytes=fun?s3Location->fun?text->fun?content->fun()->{bytes;s3Location;text;content}letto_valuex=structure_to_value[("bytes",(Option.mapx.bytes~f:DocumentSourceBytesBlob.to_value));("s3Location",(Option.mapx.s3Location~f:S3Location.to_value));("text",(Option.mapx.text~f:String_.to_value));("content",(Option.mapx.content~f:DocumentContentBlocks.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letcontent=(Option.map~f:DocumentContentBlocks.of_xml)(Xml.childxml_arg0"content")inlettext=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"text")inlets3Location=(Option.map~f:S3Location.of_xml)(Xml.childxml_arg0"s3Location")inletbytes=(Option.map~f:DocumentSourceBytesBlob.of_xml)(Xml.childxml_arg0"bytes")inmake?content?text?s3Location?bytes()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letcontent=field_mapjson__"content"DocumentContentBlocks.of_jsoninlettext=field_mapjson__"text"String_.of_jsoninlets3Location=field_mapjson__"s3Location"S3Location.of_jsoninletbytes=field_mapjson__"bytes"DocumentSourceBytesBlob.of_jsoninmake?content?text?s3Location?bytes()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Contains the content of a document."]moduleErrorBlock=structtypenonrect={message:String_.toption[@ocaml.doc"A human-readable error message describing what went wrong during content processing."]}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:String_.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"String_.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A block containing error information when content processing fails."]moduleImageFormat=structtypenonrect=|Png|Jpeg|Gif|Webp|Non_static_idofstringletmakei=iletto_string=function|Png->"png"|Jpeg->"jpeg"|Gif->"gif"|Webp->"webp"|Non_static_ids->sletof_string=function|"png"->Png|"jpeg"->Jpeg|"gif"->Gif|"webp"->Webp|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration ImageFormat"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"ImageFormat"j)letto_json=simple_to_jsonto_valueendmoduleImageSource=structtypenonrect={bytes:ImageSourceBytesBlob.toption[@ocaml.doc"The raw image bytes for the image. If you use an AWS SDK, you don't need to encode the image bytes in base64."];s3Location:S3Location.toption[@ocaml.doc"The location of an image object in an Amazon S3 bucket. To see which models support S3 uploads, see Supported models and features for Converse."]}letmake?bytes=fun?s3Location->fun()->{bytes;s3Location}letto_valuex=structure_to_value[("bytes",(Option.mapx.bytes~f:ImageSourceBytesBlob.to_value));("s3Location",(Option.mapx.s3Location~f:S3Location.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lets3Location=(Option.map~f:S3Location.of_xml)(Xml.childxml_arg0"s3Location")inletbytes=(Option.map~f:ImageSourceBytesBlob.of_xml)(Xml.childxml_arg0"bytes")inmake?s3Location?bytes()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lets3Location=field_mapjson__"s3Location"S3Location.of_jsoninletbytes=field_mapjson__"bytes"ImageSourceBytesBlob.of_jsoninmake?s3Location?bytes()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The source for an image."]moduleSearchResultContentBlocks=structtypenonrect=SearchResultContentBlock.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:SearchResultContentBlock.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:SearchResultContentBlock.of_xml)letof_jsonj=list_of_json~kind:"SearchResultContentBlocks"~of_json:SearchResultContentBlock.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleVideoFormat=structtypenonrect=|Mkv|Mov|Mp4|Webm|Flv|Mpeg|Mpg|Wmv|Three_gp|Non_static_idofstringletmakei=iletto_string=function|Mkv->"mkv"|Mov->"mov"|Mp4->"mp4"|Webm->"webm"|Flv->"flv"|Mpeg->"mpeg"|Mpg->"mpg"|Wmv->"wmv"|Three_gp->"three_gp"|Non_static_ids->sletof_string=function|"mkv"->Mkv|"mov"->Mov|"mp4"->Mp4|"webm"->Webm|"flv"->Flv|"mpeg"->Mpeg|"mpg"->Mpg|"wmv"->Wmv|"three_gp"->Three_gp|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration VideoFormat"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"VideoFormat"j)letto_json=simple_to_jsonto_valueendmoduleVideoSource=structtypenonrect={bytes:VideoSourceBytesBlob.toption[@ocaml.doc"Video content encoded in base64."];s3Location:S3Location.toption[@ocaml.doc"The location of a video object in an Amazon S3 bucket. To see which models support S3 uploads, see Supported models and features for Converse."]}letmake?bytes=fun?s3Location->fun()->{bytes;s3Location}letto_valuex=structure_to_value[("bytes",(Option.mapx.bytes~f:VideoSourceBytesBlob.to_value));("s3Location",(Option.mapx.s3Location~f:S3Location.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lets3Location=(Option.map~f:S3Location.of_xml)(Xml.childxml_arg0"s3Location")inletbytes=(Option.map~f:VideoSourceBytesBlob.of_xml)(Xml.childxml_arg0"bytes")inmake?s3Location?bytes()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lets3Location=field_mapjson__"s3Location"S3Location.of_jsoninletbytes=field_mapjson__"bytes"VideoSourceBytesBlob.of_jsoninmake?s3Location?bytes()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A video source. You can upload a smaller video as a base64-encoded string as long as the encoded file is less than 25MB. You can also transfer videos up to 1GB in size from an S3 bucket."]moduleGuardrailAutomatedReasoningImpossibleFinding=structtypenonrect={translation:GuardrailAutomatedReasoningTranslation.toption[@ocaml.doc"The logical translation of the input that this finding evaluates."];contradictingRules:GuardrailAutomatedReasoningRuleList.toption[@ocaml.doc"The automated reasoning policy rules that contradict the claims and/or premises in the input."];logicWarning:GuardrailAutomatedReasoningLogicWarning.toption[@ocaml.doc"Indication of a logic issue with the translation without needing to consider the automated reasoning policy rules."]}letmake?translation=fun?contradictingRules->fun?logicWarning->fun()->{translation;contradictingRules;logicWarning}letto_valuex=structure_to_value[("translation",(Option.mapx.translation~f:GuardrailAutomatedReasoningTranslation.to_value));("contradictingRules",(Option.mapx.contradictingRules~f:GuardrailAutomatedReasoningRuleList.to_value));("logicWarning",(Option.mapx.logicWarning~f:GuardrailAutomatedReasoningLogicWarning.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letlogicWarning=(Option.map~f:GuardrailAutomatedReasoningLogicWarning.of_xml)(Xml.childxml_arg0"logicWarning")inletcontradictingRules=(Option.map~f:GuardrailAutomatedReasoningRuleList.of_xml)(Xml.childxml_arg0"contradictingRules")inlettranslation=(Option.map~f:GuardrailAutomatedReasoningTranslation.of_xml)(Xml.childxml_arg0"translation")inmake?logicWarning?contradictingRules?translation()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letlogicWarning=field_mapjson__"logicWarning"GuardrailAutomatedReasoningLogicWarning.of_jsoninletcontradictingRules=field_mapjson__"contradictingRules"GuardrailAutomatedReasoningRuleList.of_jsoninlettranslation=field_mapjson__"translation"GuardrailAutomatedReasoningTranslation.of_jsoninmake?logicWarning?contradictingRules?translation()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Indicates that no valid claims can be made due to logical contradictions in the premises or rules."]moduleGuardrailAutomatedReasoningInvalidFinding=structtypenonrect={translation:GuardrailAutomatedReasoningTranslation.toption[@ocaml.doc"The logical translation of the input that this finding invalidates."];contradictingRules:GuardrailAutomatedReasoningRuleList.toption[@ocaml.doc"The automated reasoning policy rules that contradict the claims in the input."];logicWarning:GuardrailAutomatedReasoningLogicWarning.toption[@ocaml.doc"Indication of a logic issue with the translation without needing to consider the automated reasoning policy rules."]}letmake?translation=fun?contradictingRules->fun?logicWarning->fun()->{translation;contradictingRules;logicWarning}letto_valuex=structure_to_value[("translation",(Option.mapx.translation~f:GuardrailAutomatedReasoningTranslation.to_value));("contradictingRules",(Option.mapx.contradictingRules~f:GuardrailAutomatedReasoningRuleList.to_value));("logicWarning",(Option.mapx.logicWarning~f:GuardrailAutomatedReasoningLogicWarning.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letlogicWarning=(Option.map~f:GuardrailAutomatedReasoningLogicWarning.of_xml)(Xml.childxml_arg0"logicWarning")inletcontradictingRules=(Option.map~f:GuardrailAutomatedReasoningRuleList.of_xml)(Xml.childxml_arg0"contradictingRules")inlettranslation=(Option.map~f:GuardrailAutomatedReasoningTranslation.of_xml)(Xml.childxml_arg0"translation")inmake?logicWarning?contradictingRules?translation()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letlogicWarning=field_mapjson__"logicWarning"GuardrailAutomatedReasoningLogicWarning.of_jsoninletcontradictingRules=field_mapjson__"contradictingRules"GuardrailAutomatedReasoningRuleList.of_jsoninlettranslation=field_mapjson__"translation"GuardrailAutomatedReasoningTranslation.of_jsoninmake?logicWarning?contradictingRules?translation()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Indicates that the claims are logically false and contradictory to the established rules or premises."]moduleGuardrailAutomatedReasoningNoTranslationsFinding=structtypenonrect=unitletmake()=()letof_header_and_body=((fun(xs,pipe)->make())[@warning"-27"])letto_value_=`Structure[]letto_queryv=to_queryto_valuevletof_xml_=make()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_json_=make()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Indicates that no relevant logical information could be extracted from the input for validation."]moduleGuardrailAutomatedReasoningSatisfiableFinding=structtypenonrect={translation:GuardrailAutomatedReasoningTranslation.toption[@ocaml.doc"The logical translation of the input that this finding evaluates."];claimsTrueScenario:GuardrailAutomatedReasoningScenario.toption[@ocaml.doc"An example scenario demonstrating how the claims could be logically true."];claimsFalseScenario:GuardrailAutomatedReasoningScenario.toption[@ocaml.doc"An example scenario demonstrating how the claims could be logically false."];logicWarning:GuardrailAutomatedReasoningLogicWarning.toption[@ocaml.doc"Indication of a logic issue with the translation without needing to consider the automated reasoning policy rules."]}letmake?translation=fun?claimsTrueScenario->fun?claimsFalseScenario->fun?logicWarning->fun()->{translation;claimsTrueScenario;claimsFalseScenario;logicWarning}letto_valuex=structure_to_value[("translation",(Option.mapx.translation~f:GuardrailAutomatedReasoningTranslation.to_value));("claimsTrueScenario",(Option.mapx.claimsTrueScenario~f:GuardrailAutomatedReasoningScenario.to_value));("claimsFalseScenario",(Option.mapx.claimsFalseScenario~f:GuardrailAutomatedReasoningScenario.to_value));("logicWarning",(Option.mapx.logicWarning~f:GuardrailAutomatedReasoningLogicWarning.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letlogicWarning=(Option.map~f:GuardrailAutomatedReasoningLogicWarning.of_xml)(Xml.childxml_arg0"logicWarning")inletclaimsFalseScenario=(Option.map~f:GuardrailAutomatedReasoningScenario.of_xml)(Xml.childxml_arg0"claimsFalseScenario")inletclaimsTrueScenario=(Option.map~f:GuardrailAutomatedReasoningScenario.of_xml)(Xml.childxml_arg0"claimsTrueScenario")inlettranslation=(Option.map~f:GuardrailAutomatedReasoningTranslation.of_xml)(Xml.childxml_arg0"translation")inmake?logicWarning?claimsFalseScenario?claimsTrueScenario?translation()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letlogicWarning=field_mapjson__"logicWarning"GuardrailAutomatedReasoningLogicWarning.of_jsoninletclaimsFalseScenario=field_mapjson__"claimsFalseScenario"GuardrailAutomatedReasoningScenario.of_jsoninletclaimsTrueScenario=field_mapjson__"claimsTrueScenario"GuardrailAutomatedReasoningScenario.of_jsoninlettranslation=field_mapjson__"translation"GuardrailAutomatedReasoningTranslation.of_jsoninmake?logicWarning?claimsFalseScenario?claimsTrueScenario?translation()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Indicates that the claims could be either true or false depending on additional assumptions not provided in the input."]moduleGuardrailAutomatedReasoningTooComplexFinding=structtypenonrect=unitletmake()=()letof_header_and_body=((fun(xs,pipe)->make())[@warning"-27"])letto_value_=`Structure[]letto_queryv=to_queryto_valuevletof_xml_=make()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_json_=make()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Indicates that the input exceeds the processing capacity due to the volume or complexity of the logical information."]moduleGuardrailAutomatedReasoningTranslationAmbiguousFinding=structtypenonrect={options:GuardrailAutomatedReasoningTranslationOptionList.toption[@ocaml.doc"Different logical interpretations that were detected during translation of the input."];differenceScenarios:GuardrailAutomatedReasoningDifferenceScenarioList.toption[@ocaml.doc"Scenarios showing how the different translation options differ in meaning."]}letmake?options=fun?differenceScenarios->fun()->{options;differenceScenarios}letto_valuex=structure_to_value[("options",(Option.mapx.options~f:GuardrailAutomatedReasoningTranslationOptionList.to_value));("differenceScenarios",(Option.mapx.differenceScenarios~f:GuardrailAutomatedReasoningDifferenceScenarioList.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letdifferenceScenarios=(Option.map~f:GuardrailAutomatedReasoningDifferenceScenarioList.of_xml)(Xml.childxml_arg0"differenceScenarios")inletoptions=(Option.map~f:GuardrailAutomatedReasoningTranslationOptionList.of_xml)(Xml.childxml_arg0"options")inmake?differenceScenarios?options()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letdifferenceScenarios=field_mapjson__"differenceScenarios"GuardrailAutomatedReasoningDifferenceScenarioList.of_jsoninletoptions=field_mapjson__"options"GuardrailAutomatedReasoningTranslationOptionList.of_jsoninmake?differenceScenarios?options()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Indicates that the input has multiple valid logical interpretations, requiring additional context or clarification."]moduleGuardrailAutomatedReasoningValidFinding=structtypenonrect={translation:GuardrailAutomatedReasoningTranslation.toption[@ocaml.doc"The logical translation of the input that this finding validates."];claimsTrueScenario:GuardrailAutomatedReasoningScenario.toption[@ocaml.doc"An example scenario demonstrating how the claims are logically true."];supportingRules:GuardrailAutomatedReasoningRuleList.toption[@ocaml.doc"The automated reasoning policy rules that support why this result is considered valid."];logicWarning:GuardrailAutomatedReasoningLogicWarning.toption[@ocaml.doc"Indication of a logic issue with the translation without needing to consider the automated reasoning policy rules."]}letmake?translation=fun?claimsTrueScenario->fun?supportingRules->fun?logicWarning->fun()->{translation;claimsTrueScenario;supportingRules;logicWarning}letto_valuex=structure_to_value[("translation",(Option.mapx.translation~f:GuardrailAutomatedReasoningTranslation.to_value));("claimsTrueScenario",(Option.mapx.claimsTrueScenario~f:GuardrailAutomatedReasoningScenario.to_value));("supportingRules",(Option.mapx.supportingRules~f:GuardrailAutomatedReasoningRuleList.to_value));("logicWarning",(Option.mapx.logicWarning~f:GuardrailAutomatedReasoningLogicWarning.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letlogicWarning=(Option.map~f:GuardrailAutomatedReasoningLogicWarning.of_xml)(Xml.childxml_arg0"logicWarning")inletsupportingRules=(Option.map~f:GuardrailAutomatedReasoningRuleList.of_xml)(Xml.childxml_arg0"supportingRules")inletclaimsTrueScenario=(Option.map~f:GuardrailAutomatedReasoningScenario.of_xml)(Xml.childxml_arg0"claimsTrueScenario")inlettranslation=(Option.map~f:GuardrailAutomatedReasoningTranslation.of_xml)(Xml.childxml_arg0"translation")inmake?logicWarning?supportingRules?claimsTrueScenario?translation()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letlogicWarning=field_mapjson__"logicWarning"GuardrailAutomatedReasoningLogicWarning.of_jsoninletsupportingRules=field_mapjson__"supportingRules"GuardrailAutomatedReasoningRuleList.of_jsoninletclaimsTrueScenario=field_mapjson__"claimsTrueScenario"GuardrailAutomatedReasoningScenario.of_jsoninlettranslation=field_mapjson__"translation"GuardrailAutomatedReasoningTranslation.of_jsoninmake?logicWarning?supportingRules?claimsTrueScenario?translation()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Indicates that the claims are definitively true and logically implied by the premises, with no possible alternative interpretations."]moduleGuardrailContentFilterConfidence=structtypenonrect=|NONE|LOW|MEDIUM|HIGH|Non_static_idofstringletmakei=iletto_string=function|NONE->"NONE"|LOW->"LOW"|MEDIUM->"MEDIUM"|HIGH->"HIGH"|Non_static_ids->sletof_string=function|"NONE"->NONE|"LOW"->LOW|"MEDIUM"->MEDIUM|"HIGH"->HIGH|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration GuardrailContentFilterConfidence"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"GuardrailContentFilterConfidence"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailContentFilterStrength=structtypenonrect=|NONE|LOW|MEDIUM|HIGH|Non_static_idofstringletmakei=iletto_string=function|NONE->"NONE"|LOW->"LOW"|MEDIUM->"MEDIUM"|HIGH->"HIGH"|Non_static_ids->sletof_string=function|"NONE"->NONE|"LOW"->LOW|"MEDIUM"->MEDIUM|"HIGH"->HIGH|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration GuardrailContentFilterStrength"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"GuardrailContentFilterStrength"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailContentFilterType=structtypenonrect=|INSULTS|HATE|SEXUAL|VIOLENCE|MISCONDUCT|PROMPT_ATTACK|Non_static_idofstringletmakei=iletto_string=function|INSULTS->"INSULTS"|HATE->"HATE"|SEXUAL->"SEXUAL"|VIOLENCE->"VIOLENCE"|MISCONDUCT->"MISCONDUCT"|PROMPT_ATTACK->"PROMPT_ATTACK"|Non_static_ids->sletof_string=function|"INSULTS"->INSULTS|"HATE"->HATE|"SEXUAL"->SEXUAL|"VIOLENCE"->VIOLENCE|"MISCONDUCT"->MISCONDUCT|"PROMPT_ATTACK"->PROMPT_ATTACK|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration GuardrailContentFilterType"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"GuardrailContentFilterType"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailContentPolicyAction=structtypenonrect=|BLOCKED|NONE|Non_static_idofstringletmakei=iletto_string=function|BLOCKED->"BLOCKED"|NONE->"NONE"|Non_static_ids->sletof_string=function|"BLOCKED"->BLOCKED|"NONE"->NONE|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration GuardrailContentPolicyAction"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"GuardrailContentPolicyAction"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailContextualGroundingFilterScoreDouble=structtypenonrect=floatletmakei=letopenResultinok_or_failwith((check_float_mini~min:1.)>>=(fun()->check_float_mini~min:0.));iletof_string=Float.of_stringletto_valuex=`Doublexletto_queryv=to_queryto_valuevletto_headerx=Stdlib.Float.to_stringxletof_xmlxml_arg0=Float.of_string(string_of_xml~kind:"a double"xml_arg0)letof_jsonj=float_of_json~kind:"a double"jletto_json=simple_to_jsonto_valueendmoduleGuardrailContextualGroundingFilterThresholdDouble=structtypenonrect=floatletmakei=letopenResultinok_or_failwith((check_float_mini~min:1.)>>=(fun()->check_float_mini~min:0.));iletof_string=Float.of_stringletto_valuex=`Doublexletto_queryv=to_queryto_valuevletto_headerx=Stdlib.Float.to_stringxletof_xmlxml_arg0=Float.of_string(string_of_xml~kind:"a double"xml_arg0)letof_jsonj=float_of_json~kind:"a double"jletto_json=simple_to_jsonto_valueendmoduleGuardrailContextualGroundingFilterType=structtypenonrect=|GROUNDING|RELEVANCE|Non_static_idofstringletmakei=iletto_string=function|GROUNDING->"GROUNDING"|RELEVANCE->"RELEVANCE"|Non_static_ids->sletof_string=function|"GROUNDING"->GROUNDING|"RELEVANCE"->RELEVANCE|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration GuardrailContextualGroundingFilterType"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"GuardrailContextualGroundingFilterType"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailContextualGroundingPolicyAction=structtypenonrect=|BLOCKED|NONE|Non_static_idofstringletmakei=iletto_string=function|BLOCKED->"BLOCKED"|NONE->"NONE"|Non_static_ids->sletof_string=function|"BLOCKED"->BLOCKED|"NONE"->NONE|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration GuardrailContextualGroundingPolicyAction"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"GuardrailContextualGroundingPolicyAction"j)letto_json=simple_to_jsonto_valueendmoduleImagesGuarded=structtypenonrect=intletmakei=iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for ImagesGuarded"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleImagesTotal=structtypenonrect=intletmakei=iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for ImagesTotal"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleTextCharactersGuarded=structtypenonrect=intletmakei=iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for TextCharactersGuarded"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleTextCharactersTotal=structtypenonrect=intletmakei=iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for TextCharactersTotal"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailPiiEntityType=structtypenonrect=|ADDRESS|AGE|AWS_ACCESS_KEY|AWS_SECRET_KEY|CA_HEALTH_NUMBER|CA_SOCIAL_INSURANCE_NUMBER|CREDIT_DEBIT_CARD_CVV|CREDIT_DEBIT_CARD_EXPIRY|CREDIT_DEBIT_CARD_NUMBER|DRIVER_ID|EMAIL|INTERNATIONAL_BANK_ACCOUNT_NUMBER|IP_ADDRESS|LICENSE_PLATE|MAC_ADDRESS|NAME|PASSWORD|PHONE|PIN|SWIFT_CODE|UK_NATIONAL_HEALTH_SERVICE_NUMBER|UK_NATIONAL_INSURANCE_NUMBER|UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER|URL|USERNAME|US_BANK_ACCOUNT_NUMBER|US_BANK_ROUTING_NUMBER|US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER|US_PASSPORT_NUMBER|US_SOCIAL_SECURITY_NUMBER|VEHICLE_IDENTIFICATION_NUMBER|Non_static_idofstringletmakei=iletto_string=function|ADDRESS->"ADDRESS"|AGE->"AGE"|AWS_ACCESS_KEY->"AWS_ACCESS_KEY"|AWS_SECRET_KEY->"AWS_SECRET_KEY"|CA_HEALTH_NUMBER->"CA_HEALTH_NUMBER"|CA_SOCIAL_INSURANCE_NUMBER->"CA_SOCIAL_INSURANCE_NUMBER"|CREDIT_DEBIT_CARD_CVV->"CREDIT_DEBIT_CARD_CVV"|CREDIT_DEBIT_CARD_EXPIRY->"CREDIT_DEBIT_CARD_EXPIRY"|CREDIT_DEBIT_CARD_NUMBER->"CREDIT_DEBIT_CARD_NUMBER"|DRIVER_ID->"DRIVER_ID"|EMAIL->"EMAIL"|INTERNATIONAL_BANK_ACCOUNT_NUMBER->"INTERNATIONAL_BANK_ACCOUNT_NUMBER"|IP_ADDRESS->"IP_ADDRESS"|LICENSE_PLATE->"LICENSE_PLATE"|MAC_ADDRESS->"MAC_ADDRESS"|NAME->"NAME"|PASSWORD->"PASSWORD"|PHONE->"PHONE"|PIN->"PIN"|SWIFT_CODE->"SWIFT_CODE"|UK_NATIONAL_HEALTH_SERVICE_NUMBER->"UK_NATIONAL_HEALTH_SERVICE_NUMBER"|UK_NATIONAL_INSURANCE_NUMBER->"UK_NATIONAL_INSURANCE_NUMBER"|UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER->"UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER"|URL->"URL"|USERNAME->"USERNAME"|US_BANK_ACCOUNT_NUMBER->"US_BANK_ACCOUNT_NUMBER"|US_BANK_ROUTING_NUMBER->"US_BANK_ROUTING_NUMBER"|US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER->"US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER"|US_PASSPORT_NUMBER->"US_PASSPORT_NUMBER"|US_SOCIAL_SECURITY_NUMBER->"US_SOCIAL_SECURITY_NUMBER"|VEHICLE_IDENTIFICATION_NUMBER->"VEHICLE_IDENTIFICATION_NUMBER"|Non_static_ids->sletof_string=function|"ADDRESS"->ADDRESS|"AGE"->AGE|"AWS_ACCESS_KEY"->AWS_ACCESS_KEY|"AWS_SECRET_KEY"->AWS_SECRET_KEY|"CA_HEALTH_NUMBER"->CA_HEALTH_NUMBER|"CA_SOCIAL_INSURANCE_NUMBER"->CA_SOCIAL_INSURANCE_NUMBER|"CREDIT_DEBIT_CARD_CVV"->CREDIT_DEBIT_CARD_CVV|"CREDIT_DEBIT_CARD_EXPIRY"->CREDIT_DEBIT_CARD_EXPIRY|"CREDIT_DEBIT_CARD_NUMBER"->CREDIT_DEBIT_CARD_NUMBER|"DRIVER_ID"->DRIVER_ID|"EMAIL"->EMAIL|"INTERNATIONAL_BANK_ACCOUNT_NUMBER"->INTERNATIONAL_BANK_ACCOUNT_NUMBER|"IP_ADDRESS"->IP_ADDRESS|"LICENSE_PLATE"->LICENSE_PLATE|"MAC_ADDRESS"->MAC_ADDRESS|"NAME"->NAME|"PASSWORD"->PASSWORD|"PHONE"->PHONE|"PIN"->PIN|"SWIFT_CODE"->SWIFT_CODE|"UK_NATIONAL_HEALTH_SERVICE_NUMBER"->UK_NATIONAL_HEALTH_SERVICE_NUMBER|"UK_NATIONAL_INSURANCE_NUMBER"->UK_NATIONAL_INSURANCE_NUMBER|"UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER"->UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER|"URL"->URL|"USERNAME"->USERNAME|"US_BANK_ACCOUNT_NUMBER"->US_BANK_ACCOUNT_NUMBER|"US_BANK_ROUTING_NUMBER"->US_BANK_ROUTING_NUMBER|"US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER"->US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER|"US_PASSPORT_NUMBER"->US_PASSPORT_NUMBER|"US_SOCIAL_SECURITY_NUMBER"->US_SOCIAL_SECURITY_NUMBER|"VEHICLE_IDENTIFICATION_NUMBER"->VEHICLE_IDENTIFICATION_NUMBER|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration GuardrailPiiEntityType"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"GuardrailPiiEntityType"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailSensitiveInformationPolicyAction=structtypenonrect=|ANONYMIZED|BLOCKED|NONE|Non_static_idofstringletmakei=iletto_string=function|ANONYMIZED->"ANONYMIZED"|BLOCKED->"BLOCKED"|NONE->"NONE"|Non_static_ids->sletof_string=function|"ANONYMIZED"->ANONYMIZED|"BLOCKED"->BLOCKED|"NONE"->NONE|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration GuardrailSensitiveInformationPolicyAction"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"GuardrailSensitiveInformationPolicyAction"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailTopicPolicyAction=structtypenonrect=|BLOCKED|NONE|Non_static_idofstringletmakei=iletto_string=function|BLOCKED->"BLOCKED"|NONE->"NONE"|Non_static_ids->sletof_string=function|"BLOCKED"->BLOCKED|"NONE"->NONE|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration GuardrailTopicPolicyAction"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"GuardrailTopicPolicyAction"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailTopicType=structtypenonrect=|DENY|Non_static_idofstringletmakei=iletto_string=function|DENY->"DENY"|Non_static_ids->sletof_string=function|"DENY"->DENY|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration GuardrailTopicType"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"GuardrailTopicType"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailWordPolicyAction=structtypenonrect=|BLOCKED|NONE|Non_static_idofstringletmakei=iletto_string=function|BLOCKED->"BLOCKED"|NONE->"NONE"|Non_static_ids->sletof_string=function|"BLOCKED"->BLOCKED|"NONE"->NONE|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration GuardrailWordPolicyAction"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"GuardrailWordPolicyAction"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailManagedWordType=structtypenonrect=|PROFANITY|Non_static_idofstringletmakei=iletto_string=function|PROFANITY->"PROFANITY"|Non_static_ids->sletof_string=function|"PROFANITY"->PROFANITY|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration GuardrailManagedWordType"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"GuardrailManagedWordType"j)letto_json=simple_to_jsonto_valueendmoduleCitationLocation=structtypenonrect={web:WebLocation.toption[@ocaml.doc"The web URL that was cited for this reference."];documentChar:DocumentCharLocation.toption[@ocaml.doc"The character-level location within the document where the cited content is found."];documentPage:DocumentPageLocation.toption[@ocaml.doc"The page-level location within the document where the cited content is found."];documentChunk:DocumentChunkLocation.toption[@ocaml.doc"The chunk-level location within the document where the cited content is found, typically used for documents that have been segmented into logical chunks."];searchResultLocation:SearchResultLocation.toption[@ocaml.doc"The search result location where the cited content is found, including the search result index and block positions within the content array."]}letmake?web=fun?documentChar->fun?documentPage->fun?documentChunk->fun?searchResultLocation->fun()->{web;documentChar;documentPage;documentChunk;searchResultLocation}letto_valuex=structure_to_value[("web",(Option.mapx.web~f:WebLocation.to_value));("documentChar",(Option.mapx.documentChar~f:DocumentCharLocation.to_value));("documentPage",(Option.mapx.documentPage~f:DocumentPageLocation.to_value));("documentChunk",(Option.mapx.documentChunk~f:DocumentChunkLocation.to_value));("searchResultLocation",(Option.mapx.searchResultLocation~f:SearchResultLocation.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letsearchResultLocation=(Option.map~f:SearchResultLocation.of_xml)(Xml.childxml_arg0"searchResultLocation")inletdocumentChunk=(Option.map~f:DocumentChunkLocation.of_xml)(Xml.childxml_arg0"documentChunk")inletdocumentPage=(Option.map~f:DocumentPageLocation.of_xml)(Xml.childxml_arg0"documentPage")inletdocumentChar=(Option.map~f:DocumentCharLocation.of_xml)(Xml.childxml_arg0"documentChar")inletweb=(Option.map~f:WebLocation.of_xml)(Xml.childxml_arg0"web")inmake?searchResultLocation?documentChunk?documentPage?documentChar?web()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letsearchResultLocation=field_mapjson__"searchResultLocation"SearchResultLocation.of_jsoninletdocumentChunk=field_mapjson__"documentChunk"DocumentChunkLocation.of_jsoninletdocumentPage=field_mapjson__"documentPage"DocumentPageLocation.of_jsoninletdocumentChar=field_mapjson__"documentChar"DocumentCharLocation.of_jsoninletweb=field_mapjson__"web"WebLocation.of_jsoninmake?searchResultLocation?documentChunk?documentPage?documentChar?web()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Specifies the precise location within a source document where cited content can be found. This can include character-level positions, page numbers, or document chunks depending on the document type and indexing method."]moduleCitationSourceContentList=structtypenonrect=CitationSourceContent.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:CitationSourceContent.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:CitationSourceContent.of_xml)letof_jsonj=list_of_json~kind:"CitationSourceContentList"~of_json:CitationSourceContent.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleGuardrailConverseImageSourceBytesBlob=structtypenonrect=stringletmakei=iletof_stringx=xletto_valuex=`Blobxletto_queryv=to_queryto_valuevletto_headerx=xletof_xmlxml_arg0=string_of_xml~kind:"a blob"xml_arg0letof_jsonj=string_of_json~kind:"a blob"jletto_json=simple_to_jsonto_valueendmoduleGuardrailConverseContentQualifier=structtypenonrect=|Grounding_source|Query|Guard_content|Non_static_idofstringletmakei=iletto_string=function|Grounding_source->"grounding_source"|Query->"query"|Guard_content->"guard_content"|Non_static_ids->sletof_string=function|"grounding_source"->Grounding_source|"query"->Query|"guard_content"->Guard_content|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration GuardrailConverseContentQualifier"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"GuardrailConverseContentQualifier"j)letto_json=simple_to_jsonto_valueendmoduleDocument=structtypenonrect=unitletmake()=()letof_header_and_body=((fun(xs,pipe)->make())[@warning"-27"])letto_value_=`Structure[]letto_queryv=to_queryto_valuevletof_xml_=make()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_json_=make()letto_jsonv=composed_to_jsonto_valuevendmoduleDocumentBlock=structtypenonrect={format:DocumentFormat.toption[@ocaml.doc"The format of a document, or its extension."];name:DocumentBlockNameString.t[@ocaml.doc"A name for the document. The name can only contain the following characters: Alphanumeric characters Whitespace characters (no more than one in a row) Hyphens Parentheses Square brackets This field is vulnerable to prompt injections, because the model might inadvertently interpret it as instructions. Therefore, we recommend that you specify a neutral name."];source:DocumentSource.t[@ocaml.doc"Contains the content of the document."];context:String_.toption[@ocaml.doc"Contextual information about how the document should be processed or interpreted by the model when generating citations."];citations:CitationsConfig.toption[@ocaml.doc"Configuration settings that control how citations should be generated for this specific document."]}letcontext_="DocumentBlock"letmake?format=fun?context->fun?citations->fun~name->fun~source->fun()->{format;context;citations;name;source}letto_valuex=structure_to_value[("format",(Option.mapx.format~f:DocumentFormat.to_value));("name",(Some(DocumentBlockNameString.to_valuex.name)));("source",(Some(DocumentSource.to_valuex.source)));("context",(Option.mapx.context~f:String_.to_value));("citations",(Option.mapx.citations~f:CitationsConfig.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letcitations=(Option.map~f:CitationsConfig.of_xml)(Xml.childxml_arg0"citations")inletcontext=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"context")inletsource=DocumentSource.of_xml(Xml.child_exn~context:context_xml_arg0"source")inletname=DocumentBlockNameString.of_xml(Xml.child_exn~context:context_xml_arg0"name")inletformat=(Option.map~f:DocumentFormat.of_xml)(Xml.childxml_arg0"format")inmake?citations?context~source~name?format()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letcitations=field_mapjson__"citations"CitationsConfig.of_jsoninletcontext=field_mapjson__"context"String_.of_jsoninletsource=field_map_exnjson__"source"DocumentSource.of_jsoninletname=field_map_exnjson__"name"DocumentBlockNameString.of_jsoninletformat=field_mapjson__"format"DocumentFormat.of_jsoninmake?citations?context~source~name?format()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A document to include in a message."]moduleImageBlock=structtypenonrect={format:ImageFormat.t[@ocaml.doc"The format of the image."];source:ImageSource.t[@ocaml.doc"The source for the image."];error:ErrorBlock.toption[@ocaml.doc"Error information if the image block could not be processed or contains invalid data."]}letcontext_="ImageBlock"letmake?error=fun~format->fun~source->fun()->{error;format;source}letto_valuex=structure_to_value[("format",(Some(ImageFormat.to_valuex.format)));("source",(Some(ImageSource.to_valuex.source)));("error",(Option.mapx.error~f:ErrorBlock.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=leterror=(Option.map~f:ErrorBlock.of_xml)(Xml.childxml_arg0"error")inletsource=ImageSource.of_xml(Xml.child_exn~context:context_xml_arg0"source")inletformat=ImageFormat.of_xml(Xml.child_exn~context:context_xml_arg0"format")inmake?error~source~format()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=leterror=field_mapjson__"error"ErrorBlock.of_jsoninletsource=field_map_exnjson__"source"ImageSource.of_jsoninletformat=field_map_exnjson__"format"ImageFormat.of_jsoninmake?error~source~format()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Image content for a message."]moduleSearchResultBlock=structtypenonrect={source:String_.t[@ocaml.doc"The source URL or identifier for the content."];title:String_.t[@ocaml.doc"A descriptive title for the search result."];content:SearchResultContentBlocks.t[@ocaml.doc"An array of search result content block."];citations:CitationsConfig.toption[@ocaml.doc"Configuration setting for citations"]}letcontext_="SearchResultBlock"letmake?citations=fun~source->fun~title->fun~content->fun()->{citations;source;title;content}letto_valuex=structure_to_value[("source",(Some(String_.to_valuex.source)));("title",(Some(String_.to_valuex.title)));("content",(Some(SearchResultContentBlocks.to_valuex.content)));("citations",(Option.mapx.citations~f:CitationsConfig.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letcitations=(Option.map~f:CitationsConfig.of_xml)(Xml.childxml_arg0"citations")inletcontent=SearchResultContentBlocks.of_xml(Xml.child_exn~context:context_xml_arg0"content")inlettitle=String_.of_xml(Xml.child_exn~context:context_xml_arg0"title")inletsource=String_.of_xml(Xml.child_exn~context:context_xml_arg0"source")inmake?citations~content~title~source()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letcitations=field_mapjson__"citations"CitationsConfig.of_jsoninletcontent=field_map_exnjson__"content"SearchResultContentBlocks.of_jsoninlettitle=field_map_exnjson__"title"String_.of_jsoninletsource=field_map_exnjson__"source"String_.of_jsoninmake?citations~content~title~source()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A search result block that enables natural citations with proper source attribution for retrieved content. This field is only supported by Anthropic Claude Opus 4.1, Opus 4, Sonnet 4.5, Sonnet 4, Sonnet 3.7, and 3.5 Haiku models."]moduleVideoBlock=structtypenonrect={format:VideoFormat.t[@ocaml.doc"The block's format."];source:VideoSource.t[@ocaml.doc"The block's source."]}letcontext_="VideoBlock"letmake~format=fun~source->fun()->{format;source}letto_valuex=structure_to_value[("format",(Some(VideoFormat.to_valuex.format)));("source",(Some(VideoSource.to_valuex.source)))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letsource=VideoSource.of_xml(Xml.child_exn~context:context_xml_arg0"source")inletformat=VideoFormat.of_xml(Xml.child_exn~context:context_xml_arg0"format")inmake~source~format()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letsource=field_map_exnjson__"source"VideoSource.of_jsoninletformat=field_map_exnjson__"format"VideoFormat.of_jsoninmake~source~format()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A video block."]moduleGuardrailOrigin=structtypenonrect=|REQUEST|ACCOUNT_ENFORCED|ORGANIZATION_ENFORCED|Non_static_idofstringletmakei=iletto_string=function|REQUEST->"REQUEST"|ACCOUNT_ENFORCED->"ACCOUNT_ENFORCED"|ORGANIZATION_ENFORCED->"ORGANIZATION_ENFORCED"|Non_static_ids->sletof_string=function|"REQUEST"->REQUEST|"ACCOUNT_ENFORCED"->ACCOUNT_ENFORCED|"ORGANIZATION_ENFORCED"->ORGANIZATION_ENFORCED|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration GuardrailOrigin"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"GuardrailOrigin"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailAutomatedReasoningFinding=structtypenonrect={valid:GuardrailAutomatedReasoningValidFinding.toption[@ocaml.doc"Contains the result when the automated reasoning evaluation determines that the claims in the input are logically valid and definitively true based on the provided premises and policy rules."];invalid:GuardrailAutomatedReasoningInvalidFinding.toption[@ocaml.doc"Contains the result when the automated reasoning evaluation determines that the claims in the input are logically invalid and contradict the established premises or policy rules."];satisfiable:GuardrailAutomatedReasoningSatisfiableFinding.toption[@ocaml.doc"Contains the result when the automated reasoning evaluation determines that the claims in the input could be either true or false depending on additional assumptions not provided in the input context."];impossible:GuardrailAutomatedReasoningImpossibleFinding.toption[@ocaml.doc"Contains the result when the automated reasoning evaluation determines that no valid logical conclusions can be drawn due to contradictions in the premises or policy rules themselves."];translationAmbiguous:GuardrailAutomatedReasoningTranslationAmbiguousFinding.toption[@ocaml.doc"Contains the result when the automated reasoning evaluation detects that the input has multiple valid logical interpretations, requiring additional context or clarification to proceed with validation."];tooComplex:GuardrailAutomatedReasoningTooComplexFinding.toption[@ocaml.doc"Contains the result when the automated reasoning evaluation cannot process the input due to its complexity or volume exceeding the system's processing capacity for logical analysis."];noTranslations:GuardrailAutomatedReasoningNoTranslationsFinding.toption[@ocaml.doc"Contains the result when the automated reasoning evaluation cannot extract any relevant logical information from the input that can be validated against the policy rules."]}letmake?valid=fun?invalid->fun?satisfiable->fun?impossible->fun?translationAmbiguous->fun?tooComplex->fun?noTranslations->fun()->{valid;invalid;satisfiable;impossible;translationAmbiguous;tooComplex;noTranslations}letto_valuex=structure_to_value[("valid",(Option.mapx.valid~f:GuardrailAutomatedReasoningValidFinding.to_value));("invalid",(Option.mapx.invalid~f:GuardrailAutomatedReasoningInvalidFinding.to_value));("satisfiable",(Option.mapx.satisfiable~f:GuardrailAutomatedReasoningSatisfiableFinding.to_value));("impossible",(Option.mapx.impossible~f:GuardrailAutomatedReasoningImpossibleFinding.to_value));("translationAmbiguous",(Option.mapx.translationAmbiguous~f:GuardrailAutomatedReasoningTranslationAmbiguousFinding.to_value));("tooComplex",(Option.mapx.tooComplex~f:GuardrailAutomatedReasoningTooComplexFinding.to_value));("noTranslations",(Option.mapx.noTranslations~f:GuardrailAutomatedReasoningNoTranslationsFinding.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letnoTranslations=(Option.map~f:GuardrailAutomatedReasoningNoTranslationsFinding.of_xml)(Xml.childxml_arg0"noTranslations")inlettooComplex=(Option.map~f:GuardrailAutomatedReasoningTooComplexFinding.of_xml)(Xml.childxml_arg0"tooComplex")inlettranslationAmbiguous=(Option.map~f:GuardrailAutomatedReasoningTranslationAmbiguousFinding.of_xml)(Xml.childxml_arg0"translationAmbiguous")inletimpossible=(Option.map~f:GuardrailAutomatedReasoningImpossibleFinding.of_xml)(Xml.childxml_arg0"impossible")inletsatisfiable=(Option.map~f:GuardrailAutomatedReasoningSatisfiableFinding.of_xml)(Xml.childxml_arg0"satisfiable")inletinvalid=(Option.map~f:GuardrailAutomatedReasoningInvalidFinding.of_xml)(Xml.childxml_arg0"invalid")inletvalid=(Option.map~f:GuardrailAutomatedReasoningValidFinding.of_xml)(Xml.childxml_arg0"valid")inmake?noTranslations?tooComplex?translationAmbiguous?impossible?satisfiable?invalid?valid()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letnoTranslations=field_mapjson__"noTranslations"GuardrailAutomatedReasoningNoTranslationsFinding.of_jsoninlettooComplex=field_mapjson__"tooComplex"GuardrailAutomatedReasoningTooComplexFinding.of_jsoninlettranslationAmbiguous=field_mapjson__"translationAmbiguous"GuardrailAutomatedReasoningTranslationAmbiguousFinding.of_jsoninletimpossible=field_mapjson__"impossible"GuardrailAutomatedReasoningImpossibleFinding.of_jsoninletsatisfiable=field_mapjson__"satisfiable"GuardrailAutomatedReasoningSatisfiableFinding.of_jsoninletinvalid=field_mapjson__"invalid"GuardrailAutomatedReasoningInvalidFinding.of_jsoninletvalid=field_mapjson__"valid"GuardrailAutomatedReasoningValidFinding.of_jsoninmake?noTranslations?tooComplex?translationAmbiguous?impossible?satisfiable?invalid?valid()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Represents a logical validation result from automated reasoning policy evaluation. The finding indicates whether claims in the input are logically valid, invalid, satisfiable, impossible, or have other logical issues."]moduleGuardrailContentFilter=structtypenonrect={type_:GuardrailContentFilterType.toption[@ocaml.doc"The guardrail type."];confidence:GuardrailContentFilterConfidence.toption[@ocaml.doc"The guardrail confidence."];filterStrength:GuardrailContentFilterStrength.toption[@ocaml.doc"The filter strength setting for the guardrail content filter."];action:GuardrailContentPolicyAction.toption[@ocaml.doc"The guardrail action."];detected:Boolean.toption[@ocaml.doc"Indicates whether content that breaches the guardrail configuration is detected."]}letmake?type_=fun?confidence->fun?filterStrength->fun?action->fun?detected->fun()->{type_;confidence;filterStrength;action;detected}letto_valuex=structure_to_value[("type",(Option.mapx.type_~f:GuardrailContentFilterType.to_value));("confidence",(Option.mapx.confidence~f:GuardrailContentFilterConfidence.to_value));("filterStrength",(Option.mapx.filterStrength~f:GuardrailContentFilterStrength.to_value));("action",(Option.mapx.action~f:GuardrailContentPolicyAction.to_value));("detected",(Option.mapx.detected~f:Boolean.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letdetected=(Option.map~f:Boolean.of_xml)(Xml.childxml_arg0"detected")inletaction=(Option.map~f:GuardrailContentPolicyAction.of_xml)(Xml.childxml_arg0"action")inletfilterStrength=(Option.map~f:GuardrailContentFilterStrength.of_xml)(Xml.childxml_arg0"filterStrength")inletconfidence=(Option.map~f:GuardrailContentFilterConfidence.of_xml)(Xml.childxml_arg0"confidence")inlettype_=(Option.map~f:GuardrailContentFilterType.of_xml)(Xml.childxml_arg0"type")inmake?detected?action?filterStrength?confidence?type_()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letdetected=field_mapjson__"detected"Boolean.of_jsoninletaction=field_mapjson__"action"GuardrailContentPolicyAction.of_jsoninletfilterStrength=field_mapjson__"filterStrength"GuardrailContentFilterStrength.of_jsoninletconfidence=field_mapjson__"confidence"GuardrailContentFilterConfidence.of_jsoninlettype_=field_mapjson__"type"GuardrailContentFilterType.of_jsoninmake?detected?action?filterStrength?confidence?type_()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The content filter for a guardrail."]moduleGuardrailContextualGroundingFilter=structtypenonrect={type_:GuardrailContextualGroundingFilterType.toption[@ocaml.doc"The contextual grounding filter type."];threshold:GuardrailContextualGroundingFilterThresholdDouble.toption[@ocaml.doc"The threshold used by contextual grounding filter to determine whether the content is grounded or not."];score:GuardrailContextualGroundingFilterScoreDouble.toption[@ocaml.doc"The score generated by contextual grounding filter."];action:GuardrailContextualGroundingPolicyAction.toption[@ocaml.doc"The action performed by the guardrails contextual grounding filter."];detected:Boolean.toption[@ocaml.doc"Indicates whether content that fails the contextual grounding evaluation (grounding or relevance score less than the corresponding threshold) was detected."]}letmake?type_=fun?threshold->fun?score->fun?action->fun?detected->fun()->{type_;threshold;score;action;detected}letto_valuex=structure_to_value[("type",(Option.mapx.type_~f:GuardrailContextualGroundingFilterType.to_value));("threshold",(Option.mapx.threshold~f:GuardrailContextualGroundingFilterThresholdDouble.to_value));("score",(Option.mapx.score~f:GuardrailContextualGroundingFilterScoreDouble.to_value));("action",(Option.mapx.action~f:GuardrailContextualGroundingPolicyAction.to_value));("detected",(Option.mapx.detected~f:Boolean.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letdetected=(Option.map~f:Boolean.of_xml)(Xml.childxml_arg0"detected")inletaction=(Option.map~f:GuardrailContextualGroundingPolicyAction.of_xml)(Xml.childxml_arg0"action")inletscore=(Option.map~f:GuardrailContextualGroundingFilterScoreDouble.of_xml)(Xml.childxml_arg0"score")inletthreshold=(Option.map~f:GuardrailContextualGroundingFilterThresholdDouble.of_xml)(Xml.childxml_arg0"threshold")inlettype_=(Option.map~f:GuardrailContextualGroundingFilterType.of_xml)(Xml.childxml_arg0"type")inmake?detected?action?score?threshold?type_()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letdetected=field_mapjson__"detected"Boolean.of_jsoninletaction=field_mapjson__"action"GuardrailContextualGroundingPolicyAction.of_jsoninletscore=field_mapjson__"score"GuardrailContextualGroundingFilterScoreDouble.of_jsoninletthreshold=field_mapjson__"threshold"GuardrailContextualGroundingFilterThresholdDouble.of_jsoninlettype_=field_mapjson__"type"GuardrailContextualGroundingFilterType.of_jsoninmake?detected?action?score?threshold?type_()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The details for the guardrails contextual grounding filter."]moduleGuardrailImageCoverage=structtypenonrect={guarded:ImagesGuarded.toption[@ocaml.doc"The count (integer) of images guardrails guarded."];total:ImagesTotal.toption[@ocaml.doc"Represents the total number of images (integer) that were in the request (guarded and unguarded)."]}letmake?guarded=fun?total->fun()->{guarded;total}letto_valuex=structure_to_value[("guarded",(Option.mapx.guarded~f:ImagesGuarded.to_value));("total",(Option.mapx.total~f:ImagesTotal.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lettotal=(Option.map~f:ImagesTotal.of_xml)(Xml.childxml_arg0"total")inletguarded=(Option.map~f:ImagesGuarded.of_xml)(Xml.childxml_arg0"guarded")inmake?total?guarded()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lettotal=field_mapjson__"total"ImagesTotal.of_jsoninletguarded=field_mapjson__"guarded"ImagesGuarded.of_jsoninmake?total?guarded()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The details of the guardrail image coverage."]moduleGuardrailTextCharactersCoverage=structtypenonrect={guarded:TextCharactersGuarded.toption[@ocaml.doc"The text characters that were guarded by the guardrail coverage."];total:TextCharactersTotal.toption[@ocaml.doc"The total text characters by the guardrail coverage."]}letmake?guarded=fun?total->fun()->{guarded;total}letto_valuex=structure_to_value[("guarded",(Option.mapx.guarded~f:TextCharactersGuarded.to_value));("total",(Option.mapx.total~f:TextCharactersTotal.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lettotal=(Option.map~f:TextCharactersTotal.of_xml)(Xml.childxml_arg0"total")inletguarded=(Option.map~f:TextCharactersGuarded.of_xml)(Xml.childxml_arg0"guarded")inmake?total?guarded()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lettotal=field_mapjson__"total"TextCharactersTotal.of_jsoninletguarded=field_mapjson__"guarded"TextCharactersGuarded.of_jsoninmake?total?guarded()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The guardrail coverage for the text characters."]moduleGuardrailAutomatedReasoningPoliciesProcessed=structtypenonrect=intletmakei=iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for GuardrailAutomatedReasoningPoliciesProcessed"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailAutomatedReasoningPolicyUnitsProcessed=structtypenonrect=intletmakei=iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for GuardrailAutomatedReasoningPolicyUnitsProcessed"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailContentPolicyImageUnitsProcessed=structtypenonrect=intletmakei=iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for GuardrailContentPolicyImageUnitsProcessed"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailContentPolicyUnitsProcessed=structtypenonrect=intletmakei=iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for GuardrailContentPolicyUnitsProcessed"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailContextualGroundingPolicyUnitsProcessed=structtypenonrect=intletmakei=iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for GuardrailContextualGroundingPolicyUnitsProcessed"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailSensitiveInformationPolicyFreeUnitsProcessed=structtypenonrect=intletmakei=iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for GuardrailSensitiveInformationPolicyFreeUnitsProcessed"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailSensitiveInformationPolicyUnitsProcessed=structtypenonrect=intletmakei=iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for GuardrailSensitiveInformationPolicyUnitsProcessed"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailTopicPolicyUnitsProcessed=structtypenonrect=intletmakei=iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for GuardrailTopicPolicyUnitsProcessed"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailWordPolicyUnitsProcessed=structtypenonrect=intletmakei=iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for GuardrailWordPolicyUnitsProcessed"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailPiiEntityFilter=structtypenonrect={match_:String_.toption[@ocaml.doc"The PII entity filter match."];type_:GuardrailPiiEntityType.toption[@ocaml.doc"The PII entity filter type."];action:GuardrailSensitiveInformationPolicyAction.toption[@ocaml.doc"The PII entity filter action."];detected:Boolean.toption[@ocaml.doc"Indicates whether personally identifiable information (PII) that breaches the guardrail configuration is detected."]}letmake?match_=fun?type_->fun?action->fun?detected->fun()->{match_;type_;action;detected}letto_valuex=structure_to_value[("match",(Option.mapx.match_~f:String_.to_value));("type",(Option.mapx.type_~f:GuardrailPiiEntityType.to_value));("action",(Option.mapx.action~f:GuardrailSensitiveInformationPolicyAction.to_value));("detected",(Option.mapx.detected~f:Boolean.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letdetected=(Option.map~f:Boolean.of_xml)(Xml.childxml_arg0"detected")inletaction=(Option.map~f:GuardrailSensitiveInformationPolicyAction.of_xml)(Xml.childxml_arg0"action")inlettype_=(Option.map~f:GuardrailPiiEntityType.of_xml)(Xml.childxml_arg0"type")inletmatch_=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"match")inmake?detected?action?type_?match_()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letdetected=field_mapjson__"detected"Boolean.of_jsoninletaction=field_mapjson__"action"GuardrailSensitiveInformationPolicyAction.of_jsoninlettype_=field_mapjson__"type"GuardrailPiiEntityType.of_jsoninletmatch_=field_mapjson__"match"String_.of_jsoninmake?detected?action?type_?match_()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A Personally Identifiable Information (PII) entity configured in a guardrail."]moduleGuardrailRegexFilter=structtypenonrect={name:String_.toption[@ocaml.doc"The regex filter name."];match_:String_.toption[@ocaml.doc"The regesx filter match."];regex:String_.toption[@ocaml.doc"The regex query."];action:GuardrailSensitiveInformationPolicyAction.toption[@ocaml.doc"The region filter action."];detected:Boolean.toption[@ocaml.doc"Indicates whether custom regex entities that breach the guardrail configuration are detected."]}letmake?name=fun?match_->fun?regex->fun?action->fun?detected->fun()->{name;match_;regex;action;detected}letto_valuex=structure_to_value[("name",(Option.mapx.name~f:String_.to_value));("match",(Option.mapx.match_~f:String_.to_value));("regex",(Option.mapx.regex~f:String_.to_value));("action",(Option.mapx.action~f:GuardrailSensitiveInformationPolicyAction.to_value));("detected",(Option.mapx.detected~f:Boolean.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letdetected=(Option.map~f:Boolean.of_xml)(Xml.childxml_arg0"detected")inletaction=(Option.map~f:GuardrailSensitiveInformationPolicyAction.of_xml)(Xml.childxml_arg0"action")inletregex=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"regex")inletmatch_=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"match")inletname=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"name")inmake?detected?action?regex?match_?name()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letdetected=field_mapjson__"detected"Boolean.of_jsoninletaction=field_mapjson__"action"GuardrailSensitiveInformationPolicyAction.of_jsoninletregex=field_mapjson__"regex"String_.of_jsoninletmatch_=field_mapjson__"match"String_.of_jsoninletname=field_mapjson__"name"String_.of_jsoninmake?detected?action?regex?match_?name()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A Regex filter configured in a guardrail."]moduleGuardrailTopic=structtypenonrect={name:String_.toption[@ocaml.doc"The name for the guardrail."];type_:GuardrailTopicType.toption[@ocaml.doc"The type behavior that the guardrail should perform when the model detects the topic."];action:GuardrailTopicPolicyAction.toption[@ocaml.doc"The action the guardrail should take when it intervenes on a topic."];detected:Boolean.toption[@ocaml.doc"Indicates whether topic content that breaches the guardrail configuration is detected."]}letmake?name=fun?type_->fun?action->fun?detected->fun()->{name;type_;action;detected}letto_valuex=structure_to_value[("name",(Option.mapx.name~f:String_.to_value));("type",(Option.mapx.type_~f:GuardrailTopicType.to_value));("action",(Option.mapx.action~f:GuardrailTopicPolicyAction.to_value));("detected",(Option.mapx.detected~f:Boolean.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letdetected=(Option.map~f:Boolean.of_xml)(Xml.childxml_arg0"detected")inletaction=(Option.map~f:GuardrailTopicPolicyAction.of_xml)(Xml.childxml_arg0"action")inlettype_=(Option.map~f:GuardrailTopicType.of_xml)(Xml.childxml_arg0"type")inletname=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"name")inmake?detected?action?type_?name()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letdetected=field_mapjson__"detected"Boolean.of_jsoninletaction=field_mapjson__"action"GuardrailTopicPolicyAction.of_jsoninlettype_=field_mapjson__"type"GuardrailTopicType.of_jsoninletname=field_mapjson__"name"String_.of_jsoninmake?detected?action?type_?name()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Information about a topic guardrail."]moduleGuardrailCustomWord=structtypenonrect={match_:String_.toption[@ocaml.doc"The match for the custom word."];action:GuardrailWordPolicyAction.toption[@ocaml.doc"The action for the custom word."];detected:Boolean.toption[@ocaml.doc"Indicates whether custom word content that breaches the guardrail configuration is detected."]}letmake?match_=fun?action->fun?detected->fun()->{match_;action;detected}letto_valuex=structure_to_value[("match",(Option.mapx.match_~f:String_.to_value));("action",(Option.mapx.action~f:GuardrailWordPolicyAction.to_value));("detected",(Option.mapx.detected~f:Boolean.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letdetected=(Option.map~f:Boolean.of_xml)(Xml.childxml_arg0"detected")inletaction=(Option.map~f:GuardrailWordPolicyAction.of_xml)(Xml.childxml_arg0"action")inletmatch_=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"match")inmake?detected?action?match_()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letdetected=field_mapjson__"detected"Boolean.of_jsoninletaction=field_mapjson__"action"GuardrailWordPolicyAction.of_jsoninletmatch_=field_mapjson__"match"String_.of_jsoninmake?detected?action?match_()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A custom word configured in a guardrail."]moduleGuardrailManagedWord=structtypenonrect={match_:String_.toption[@ocaml.doc"The match for the managed word."];type_:GuardrailManagedWordType.toption[@ocaml.doc"The type for the managed word."];action:GuardrailWordPolicyAction.toption[@ocaml.doc"The action for the managed word."];detected:Boolean.toption[@ocaml.doc"Indicates whether managed word content that breaches the guardrail configuration is detected."]}letmake?match_=fun?type_->fun?action->fun?detected->fun()->{match_;type_;action;detected}letto_valuex=structure_to_value[("match",(Option.mapx.match_~f:String_.to_value));("type",(Option.mapx.type_~f:GuardrailManagedWordType.to_value));("action",(Option.mapx.action~f:GuardrailWordPolicyAction.to_value));("detected",(Option.mapx.detected~f:Boolean.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letdetected=(Option.map~f:Boolean.of_xml)(Xml.childxml_arg0"detected")inletaction=(Option.map~f:GuardrailWordPolicyAction.of_xml)(Xml.childxml_arg0"action")inlettype_=(Option.map~f:GuardrailManagedWordType.of_xml)(Xml.childxml_arg0"type")inletmatch_=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"match")inmake?detected?action?type_?match_()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letdetected=field_mapjson__"detected"Boolean.of_jsoninletaction=field_mapjson__"action"GuardrailWordPolicyAction.of_jsoninlettype_=field_mapjson__"type"GuardrailManagedWordType.of_jsoninletmatch_=field_mapjson__"match"String_.of_jsoninmake?detected?action?type_?match_()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A managed word configured in a guardrail."]moduleAudioSourceBytesBlob=structtypenonrect=stringletmakei=iletof_stringx=xletto_valuex=`Blobxletto_queryv=to_queryto_valuevletto_headerx=xletof_xmlxml_arg0=string_of_xml~kind:"a blob"xml_arg0letof_jsonj=string_of_json~kind:"a blob"jletto_json=simple_to_jsonto_valueendmoduleCitationGeneratedContent=structtypenonrect={text:String_.toption[@ocaml.doc"The text content that was generated by the model and is supported by the associated citation."]}letmake?text=fun()->{text}letto_valuex=structure_to_value[("text",(Option.mapx.text~f:String_.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lettext=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"text")inmake?text()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lettext=field_mapjson__"text"String_.of_jsoninmake?text()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Contains the generated text content that corresponds to or is supported by a citation from a source document."]moduleCitation=structtypenonrect={title:String_.toption[@ocaml.doc"The title or identifier of the source document being cited."];source:String_.toption[@ocaml.doc"The source from the original search result that provided the cited content."];sourceContent:CitationSourceContentList.toption[@ocaml.doc"The specific content from the source document that was referenced or cited in the generated response."];location:CitationLocation.toption[@ocaml.doc"The precise location within the source document where the cited content can be found, including character positions, page numbers, or chunk identifiers."]}letmake?title=fun?source->fun?sourceContent->fun?location->fun()->{title;source;sourceContent;location}letto_valuex=structure_to_value[("title",(Option.mapx.title~f:String_.to_value));("source",(Option.mapx.source~f:String_.to_value));("sourceContent",(Option.mapx.sourceContent~f:CitationSourceContentList.to_value));("location",(Option.mapx.location~f:CitationLocation.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letlocation=(Option.map~f:CitationLocation.of_xml)(Xml.childxml_arg0"location")inletsourceContent=(Option.map~f:CitationSourceContentList.of_xml)(Xml.childxml_arg0"sourceContent")inletsource=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"source")inlettitle=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"title")inmake?location?sourceContent?source?title()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letlocation=field_mapjson__"location"CitationLocation.of_jsoninletsourceContent=field_mapjson__"sourceContent"CitationSourceContentList.of_jsoninletsource=field_mapjson__"source"String_.of_jsoninlettitle=field_mapjson__"title"String_.of_jsoninmake?location?sourceContent?source?title()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Contains information about a citation that references a specific source document. Citations provide traceability between the model's generated response and the source documents that informed that response."]moduleGuardrailConverseImageFormat=structtypenonrect=|Png|Jpeg|Non_static_idofstringletmakei=iletto_string=function|Png->"png"|Jpeg->"jpeg"|Non_static_ids->sletof_string=function|"png"->Png|"jpeg"->Jpeg|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration GuardrailConverseImageFormat"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"GuardrailConverseImageFormat"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailConverseImageSource=structtypenonrect={bytes:GuardrailConverseImageSourceBytesBlob.toption[@ocaml.doc"The raw image bytes for the image."]}letmake?bytes=fun()->{bytes}letof_header_and_body=((fun(xs,pipe)->make?bytes:(Somepipe)())[@warning"-27"])letto_valuex=structure_to_value[("bytes",(Option.mapx.bytes~f:GuardrailConverseImageSourceBytesBlob.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letbytes=(Option.map~f:GuardrailConverseImageSourceBytesBlob.of_xml)(Xml.childxml_arg0"bytes")inmake?bytes()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letbytes=field_mapjson__"bytes"GuardrailConverseImageSourceBytesBlob.of_jsoninmake?bytes()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The image source (image bytes) of the guardrail converse image source."]moduleGuardrailConverseContentQualifierList=structtypenonrect=GuardrailConverseContentQualifier.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:GuardrailConverseContentQualifier.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:GuardrailConverseContentQualifier.of_xml)letof_jsonj=list_of_json~kind:"GuardrailConverseContentQualifierList"~of_json:GuardrailConverseContentQualifier.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleToolResultContentBlock=structtypenonrect={json:Document.toption[@ocaml.doc"A tool result that is JSON format data."];text:String_.toption[@ocaml.doc"A tool result that is text."];image:ImageBlock.toption[@ocaml.doc"A tool result that is an image. This field is only supported by Amazon Nova and Anthropic Claude 3 and 4 models."];document:DocumentBlock.toption[@ocaml.doc"A tool result that is a document."];video:VideoBlock.toption[@ocaml.doc"A tool result that is video."];searchResult:SearchResultBlock.toption[@ocaml.doc"A tool result that is a search result."]}letmake?json=fun?text->fun?image->fun?document->fun?video->fun?searchResult->fun()->{json;text;image;document;video;searchResult}letto_valuex=structure_to_value[("json",(Option.mapx.json~f:Document.to_value));("text",(Option.mapx.text~f:String_.to_value));("image",(Option.mapx.image~f:ImageBlock.to_value));("document",(Option.mapx.document~f:DocumentBlock.to_value));("video",(Option.mapx.video~f:VideoBlock.to_value));("searchResult",(Option.mapx.searchResult~f:SearchResultBlock.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letsearchResult=(Option.map~f:SearchResultBlock.of_xml)(Xml.childxml_arg0"searchResult")inletvideo=(Option.map~f:VideoBlock.of_xml)(Xml.childxml_arg0"video")inletdocument=(Option.map~f:DocumentBlock.of_xml)(Xml.childxml_arg0"document")inletimage=(Option.map~f:ImageBlock.of_xml)(Xml.childxml_arg0"image")inlettext=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"text")inletjson=(Option.map~f:Document.of_xml)(Xml.childxml_arg0"json")inmake?searchResult?video?document?image?text?json()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letsearchResult=field_mapjson__"searchResult"SearchResultBlock.of_jsoninletvideo=field_mapjson__"video"VideoBlock.of_jsoninletdocument=field_mapjson__"document"DocumentBlock.of_jsoninletimage=field_mapjson__"image"ImageBlock.of_jsoninlettext=field_mapjson__"text"String_.of_jsoninletjson=field_mapjson__"json"Document.of_jsoninmake?searchResult?video?document?image?text?json()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The tool result content block. For more information, see Call a tool with the Converse API in the Amazon Bedrock User Guide."]moduleGuardrailArn=structtypenonrect=stringletcontext_="GuardrailArn"letmakei=letopenResultinok_or_failwith((check_string_mini~min:0)>>=(fun()->(check_string_maxi~max:2048)>>=(fun()->check_patterni~pattern:"(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:guardrail/[a-z0-9]+)")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"GuardrailArn"jletto_json=simple_to_jsonto_valueendmoduleGuardrailId=structtypenonrect=stringletcontext_="GuardrailId"letmakei=letopenResultinok_or_failwith((check_string_mini~min:0)>>=(fun()->(check_string_maxi~max:2048)>>=(fun()->check_patterni~pattern:"([a-z0-9]+)")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"GuardrailId"jletto_json=simple_to_jsonto_valueendmoduleGuardrailOriginList=structtypenonrect=GuardrailOrigin.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:GuardrailOrigin.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:GuardrailOrigin.of_xml)letof_jsonj=list_of_json~kind:"GuardrailOriginList"~of_json:GuardrailOrigin.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleGuardrailOwnership=structtypenonrect=|SELF|CROSS_ACCOUNT|Non_static_idofstringletmakei=iletto_string=function|SELF->"SELF"|CROSS_ACCOUNT->"CROSS_ACCOUNT"|Non_static_ids->sletof_string=function|"SELF"->SELF|"CROSS_ACCOUNT"->CROSS_ACCOUNT|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration GuardrailOwnership"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"GuardrailOwnership"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailVersion=structtypenonrect=stringletcontext_="GuardrailVersion"letmakei=letopenResultinok_or_failwith(check_patterni~pattern:"(|([1-9][0-9]{0,7})|(DRAFT))");iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"GuardrailVersion"jletto_json=simple_to_jsonto_valueendmoduleGuardrailAutomatedReasoningFindingList=structtypenonrect=GuardrailAutomatedReasoningFinding.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:GuardrailAutomatedReasoningFinding.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:GuardrailAutomatedReasoningFinding.of_xml)letof_jsonj=list_of_json~kind:"GuardrailAutomatedReasoningFindingList"~of_json:GuardrailAutomatedReasoningFinding.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleGuardrailContentFilterList=structtypenonrect=GuardrailContentFilter.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:GuardrailContentFilter.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:GuardrailContentFilter.of_xml)letof_jsonj=list_of_json~kind:"GuardrailContentFilterList"~of_json:GuardrailContentFilter.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleGuardrailContextualGroundingFilters=structtypenonrect=GuardrailContextualGroundingFilter.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:GuardrailContextualGroundingFilter.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:GuardrailContextualGroundingFilter.of_xml)letof_jsonj=list_of_json~kind:"GuardrailContextualGroundingFilters"~of_json:GuardrailContextualGroundingFilter.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleGuardrailCoverage=structtypenonrect={textCharacters:GuardrailTextCharactersCoverage.toption[@ocaml.doc"The text characters of the guardrail coverage details."];images:GuardrailImageCoverage.toption[@ocaml.doc"The guardrail coverage for images (the number of images that guardrails guarded)."]}letmake?textCharacters=fun?images->fun()->{textCharacters;images}letto_valuex=structure_to_value[("textCharacters",(Option.mapx.textCharacters~f:GuardrailTextCharactersCoverage.to_value));("images",(Option.mapx.images~f:GuardrailImageCoverage.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letimages=(Option.map~f:GuardrailImageCoverage.of_xml)(Xml.childxml_arg0"images")inlettextCharacters=(Option.map~f:GuardrailTextCharactersCoverage.of_xml)(Xml.childxml_arg0"textCharacters")inmake?images?textCharacters()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letimages=field_mapjson__"images"GuardrailImageCoverage.of_jsoninlettextCharacters=field_mapjson__"textCharacters"GuardrailTextCharactersCoverage.of_jsoninmake?images?textCharacters()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The action of the guardrail coverage details."]moduleGuardrailProcessingLatency=structtypenonrect=Int64.tletmakei=iletof_string=Int64.of_stringletto_valuex=`Longxletto_queryv=to_queryto_valuevletto_headerx=Int64.to_stringxletof_xmlxml_arg0=Int64.of_string(string_of_xml~kind:"a long"xml_arg0)letof_jsonj=Int64.of_float(float_of_json~kind:"a long"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailUsage=structtypenonrect={topicPolicyUnits:GuardrailTopicPolicyUnitsProcessed.toption[@ocaml.doc"The topic policy units processed by the guardrail."];contentPolicyUnits:GuardrailContentPolicyUnitsProcessed.toption[@ocaml.doc"The content policy units processed by the guardrail."];wordPolicyUnits:GuardrailWordPolicyUnitsProcessed.toption[@ocaml.doc"The word policy units processed by the guardrail."];sensitiveInformationPolicyUnits:GuardrailSensitiveInformationPolicyUnitsProcessed.toption[@ocaml.doc"The sensitive information policy units processed by the guardrail."];sensitiveInformationPolicyFreeUnits:GuardrailSensitiveInformationPolicyFreeUnitsProcessed.toption[@ocaml.doc"The sensitive information policy free units processed by the guardrail."];contextualGroundingPolicyUnits:GuardrailContextualGroundingPolicyUnitsProcessed.toption[@ocaml.doc"The contextual grounding policy units processed by the guardrail."];contentPolicyImageUnits:GuardrailContentPolicyImageUnitsProcessed.toption[@ocaml.doc"The content policy image units processed by the guardrail."];automatedReasoningPolicyUnits:GuardrailAutomatedReasoningPolicyUnitsProcessed.toption[@ocaml.doc"The number of text units processed by the automated reasoning policy."];automatedReasoningPolicies:GuardrailAutomatedReasoningPoliciesProcessed.toption[@ocaml.doc"The number of automated reasoning policies that were processed during the guardrail evaluation."]}letmake?topicPolicyUnits=fun?contentPolicyUnits->fun?wordPolicyUnits->fun?sensitiveInformationPolicyUnits->fun?sensitiveInformationPolicyFreeUnits->fun?contextualGroundingPolicyUnits->fun?contentPolicyImageUnits->fun?automatedReasoningPolicyUnits->fun?automatedReasoningPolicies->fun()->{topicPolicyUnits;contentPolicyUnits;wordPolicyUnits;sensitiveInformationPolicyUnits;sensitiveInformationPolicyFreeUnits;contextualGroundingPolicyUnits;contentPolicyImageUnits;automatedReasoningPolicyUnits;automatedReasoningPolicies}letto_valuex=structure_to_value[("topicPolicyUnits",(Option.mapx.topicPolicyUnits~f:GuardrailTopicPolicyUnitsProcessed.to_value));("contentPolicyUnits",(Option.mapx.contentPolicyUnits~f:GuardrailContentPolicyUnitsProcessed.to_value));("wordPolicyUnits",(Option.mapx.wordPolicyUnits~f:GuardrailWordPolicyUnitsProcessed.to_value));("sensitiveInformationPolicyUnits",(Option.mapx.sensitiveInformationPolicyUnits~f:GuardrailSensitiveInformationPolicyUnitsProcessed.to_value));("sensitiveInformationPolicyFreeUnits",(Option.mapx.sensitiveInformationPolicyFreeUnits~f:GuardrailSensitiveInformationPolicyFreeUnitsProcessed.to_value));("contextualGroundingPolicyUnits",(Option.mapx.contextualGroundingPolicyUnits~f:GuardrailContextualGroundingPolicyUnitsProcessed.to_value));("contentPolicyImageUnits",(Option.mapx.contentPolicyImageUnits~f:GuardrailContentPolicyImageUnitsProcessed.to_value));("automatedReasoningPolicyUnits",(Option.mapx.automatedReasoningPolicyUnits~f:GuardrailAutomatedReasoningPolicyUnitsProcessed.to_value));("automatedReasoningPolicies",(Option.mapx.automatedReasoningPolicies~f:GuardrailAutomatedReasoningPoliciesProcessed.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letautomatedReasoningPolicies=(Option.map~f:GuardrailAutomatedReasoningPoliciesProcessed.of_xml)(Xml.childxml_arg0"automatedReasoningPolicies")inletautomatedReasoningPolicyUnits=(Option.map~f:GuardrailAutomatedReasoningPolicyUnitsProcessed.of_xml)(Xml.childxml_arg0"automatedReasoningPolicyUnits")inletcontentPolicyImageUnits=(Option.map~f:GuardrailContentPolicyImageUnitsProcessed.of_xml)(Xml.childxml_arg0"contentPolicyImageUnits")inletcontextualGroundingPolicyUnits=(Option.map~f:GuardrailContextualGroundingPolicyUnitsProcessed.of_xml)(Xml.childxml_arg0"contextualGroundingPolicyUnits")inletsensitiveInformationPolicyFreeUnits=(Option.map~f:GuardrailSensitiveInformationPolicyFreeUnitsProcessed.of_xml)(Xml.childxml_arg0"sensitiveInformationPolicyFreeUnits")inletsensitiveInformationPolicyUnits=(Option.map~f:GuardrailSensitiveInformationPolicyUnitsProcessed.of_xml)(Xml.childxml_arg0"sensitiveInformationPolicyUnits")inletwordPolicyUnits=(Option.map~f:GuardrailWordPolicyUnitsProcessed.of_xml)(Xml.childxml_arg0"wordPolicyUnits")inletcontentPolicyUnits=(Option.map~f:GuardrailContentPolicyUnitsProcessed.of_xml)(Xml.childxml_arg0"contentPolicyUnits")inlettopicPolicyUnits=(Option.map~f:GuardrailTopicPolicyUnitsProcessed.of_xml)(Xml.childxml_arg0"topicPolicyUnits")inmake?automatedReasoningPolicies?automatedReasoningPolicyUnits?contentPolicyImageUnits?contextualGroundingPolicyUnits?sensitiveInformationPolicyFreeUnits?sensitiveInformationPolicyUnits?wordPolicyUnits?contentPolicyUnits?topicPolicyUnits()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letautomatedReasoningPolicies=field_mapjson__"automatedReasoningPolicies"GuardrailAutomatedReasoningPoliciesProcessed.of_jsoninletautomatedReasoningPolicyUnits=field_mapjson__"automatedReasoningPolicyUnits"GuardrailAutomatedReasoningPolicyUnitsProcessed.of_jsoninletcontentPolicyImageUnits=field_mapjson__"contentPolicyImageUnits"GuardrailContentPolicyImageUnitsProcessed.of_jsoninletcontextualGroundingPolicyUnits=field_mapjson__"contextualGroundingPolicyUnits"GuardrailContextualGroundingPolicyUnitsProcessed.of_jsoninletsensitiveInformationPolicyFreeUnits=field_mapjson__"sensitiveInformationPolicyFreeUnits"GuardrailSensitiveInformationPolicyFreeUnitsProcessed.of_jsoninletsensitiveInformationPolicyUnits=field_mapjson__"sensitiveInformationPolicyUnits"GuardrailSensitiveInformationPolicyUnitsProcessed.of_jsoninletwordPolicyUnits=field_mapjson__"wordPolicyUnits"GuardrailWordPolicyUnitsProcessed.of_jsoninletcontentPolicyUnits=field_mapjson__"contentPolicyUnits"GuardrailContentPolicyUnitsProcessed.of_jsoninlettopicPolicyUnits=field_mapjson__"topicPolicyUnits"GuardrailTopicPolicyUnitsProcessed.of_jsoninmake?automatedReasoningPolicies?automatedReasoningPolicyUnits?contentPolicyImageUnits?contextualGroundingPolicyUnits?sensitiveInformationPolicyFreeUnits?sensitiveInformationPolicyUnits?wordPolicyUnits?contentPolicyUnits?topicPolicyUnits()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The details on the use of the guardrail."]moduleGuardrailPiiEntityFilterList=structtypenonrect=GuardrailPiiEntityFilter.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:GuardrailPiiEntityFilter.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:GuardrailPiiEntityFilter.of_xml)letof_jsonj=list_of_json~kind:"GuardrailPiiEntityFilterList"~of_json:GuardrailPiiEntityFilter.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleGuardrailRegexFilterList=structtypenonrect=GuardrailRegexFilter.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:GuardrailRegexFilter.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:GuardrailRegexFilter.of_xml)letof_jsonj=list_of_json~kind:"GuardrailRegexFilterList"~of_json:GuardrailRegexFilter.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleGuardrailTopicList=structtypenonrect=GuardrailTopic.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:GuardrailTopic.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:GuardrailTopic.of_xml)letof_jsonj=list_of_json~kind:"GuardrailTopicList"~of_json:GuardrailTopic.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleGuardrailCustomWordList=structtypenonrect=GuardrailCustomWord.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:GuardrailCustomWord.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:GuardrailCustomWord.of_xml)letof_jsonj=list_of_json~kind:"GuardrailCustomWordList"~of_json:GuardrailCustomWord.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleGuardrailManagedWordList=structtypenonrect=GuardrailManagedWord.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:GuardrailManagedWord.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:GuardrailManagedWord.of_xml)letof_jsonj=list_of_json~kind:"GuardrailManagedWordList"~of_json:GuardrailManagedWord.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleAudioFormat=structtypenonrect=|Mp3|Opus|Wav|Aac|Flac|Mp4|Ogg|Mkv|Mka|X_aac|M4a|Mpeg|Mpga|Pcm|Webm|Non_static_idofstringletmakei=iletto_string=function|Mp3->"mp3"|Opus->"opus"|Wav->"wav"|Aac->"aac"|Flac->"flac"|Mp4->"mp4"|Ogg->"ogg"|Mkv->"mkv"|Mka->"mka"|X_aac->"x-aac"|M4a->"m4a"|Mpeg->"mpeg"|Mpga->"mpga"|Pcm->"pcm"|Webm->"webm"|Non_static_ids->sletof_string=function|"mp3"->Mp3|"opus"->Opus|"wav"->Wav|"aac"->Aac|"flac"->Flac|"mp4"->Mp4|"ogg"->Ogg|"mkv"->Mkv|"mka"->Mka|"x-aac"->X_aac|"m4a"->M4a|"mpeg"->Mpeg|"mpga"->Mpga|"pcm"->Pcm|"webm"->Webm|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration AudioFormat"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"AudioFormat"j)letto_json=simple_to_jsonto_valueendmoduleAudioSource=structtypenonrect={bytes:AudioSourceBytesBlob.toption[@ocaml.doc"Audio data encoded in base64."];s3Location:S3Location.toption[@ocaml.doc"A reference to audio data stored in an Amazon S3 bucket. To see which models support S3 uploads, see Supported models and features for Converse."]}letmake?bytes=fun?s3Location->fun()->{bytes;s3Location}letto_valuex=structure_to_value[("bytes",(Option.mapx.bytes~f:AudioSourceBytesBlob.to_value));("s3Location",(Option.mapx.s3Location~f:S3Location.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lets3Location=(Option.map~f:S3Location.of_xml)(Xml.childxml_arg0"s3Location")inletbytes=(Option.map~f:AudioSourceBytesBlob.of_xml)(Xml.childxml_arg0"bytes")inmake?s3Location?bytes()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lets3Location=field_mapjson__"s3Location"S3Location.of_jsoninletbytes=field_mapjson__"bytes"AudioSourceBytesBlob.of_jsoninmake?s3Location?bytes()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The source of audio data, which can be provided either as raw bytes or a reference to an S3 location."]moduleCachePointType=structtypenonrect=|Default|Non_static_idofstringletmakei=iletto_string=function|Default->"default"|Non_static_ids->sletof_string=function|"default"->Default|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration CachePointType"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"CachePointType"j)letto_json=simple_to_jsonto_valueendmoduleCacheTTL=structtypenonrect=|Zz5m|Zz1h|Non_static_idofstringletmakei=iletto_string=function|Zz5m->"5m"|Zz1h->"1h"|Non_static_ids->sletof_string=function|"5m"->Zz5m|"1h"->Zz1h|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration CacheTTL"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"CacheTTL"j)letto_json=simple_to_jsonto_valueendmoduleCitationGeneratedContentList=structtypenonrect=CitationGeneratedContent.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:CitationGeneratedContent.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:CitationGeneratedContent.of_xml)letof_jsonj=list_of_json~kind:"CitationGeneratedContentList"~of_json:CitationGeneratedContent.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleCitations=structtypenonrect=Citation.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:Citation.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:Citation.of_xml)letof_jsonj=list_of_json~kind:"Citations"~of_json:Citation.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleGuardrailConverseImageBlock=structtypenonrect={format:GuardrailConverseImageFormat.t[@ocaml.doc"The format details for the image type of the guardrail converse image block."];source:GuardrailConverseImageSource.t[@ocaml.doc"The image source (image bytes) of the guardrail converse image block."]}letcontext_="GuardrailConverseImageBlock"letmake~format=fun~source->fun()->{format;source}letto_valuex=structure_to_value[("format",(Some(GuardrailConverseImageFormat.to_valuex.format)));("source",(Some(GuardrailConverseImageSource.to_valuex.source)))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letsource=GuardrailConverseImageSource.of_xml(Xml.child_exn~context:context_xml_arg0"source")inletformat=GuardrailConverseImageFormat.of_xml(Xml.child_exn~context:context_xml_arg0"format")inmake~source~format()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letsource=field_map_exnjson__"source"GuardrailConverseImageSource.of_jsoninletformat=field_map_exnjson__"format"GuardrailConverseImageFormat.of_jsoninmake~source~format()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"An image block that contains images that you want to assess with a guardrail."]moduleGuardrailConverseTextBlock=structtypenonrect={text:String_.t[@ocaml.doc"The text that you want to guard."];qualifiers:GuardrailConverseContentQualifierList.toption[@ocaml.doc"The qualifier details for the guardrails contextual grounding filter."]}letcontext_="GuardrailConverseTextBlock"letmake?qualifiers=fun~text->fun()->{qualifiers;text}letto_valuex=structure_to_value[("text",(Some(String_.to_valuex.text)));("qualifiers",(Option.mapx.qualifiers~f:GuardrailConverseContentQualifierList.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letqualifiers=(Option.map~f:GuardrailConverseContentQualifierList.of_xml)(Xml.childxml_arg0"qualifiers")inlettext=String_.of_xml(Xml.child_exn~context:context_xml_arg0"text")inmake?qualifiers~text()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letqualifiers=field_mapjson__"qualifiers"GuardrailConverseContentQualifierList.of_jsoninlettext=field_map_exnjson__"text"String_.of_jsoninmake?qualifiers~text()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A text block that contains text that you want to assess with a guardrail. For more information, see GuardrailConverseContentBlock."]moduleBlob=structtypenonrect=stringletmakei=iletof_stringx=xletto_valuex=`Blobxletto_queryv=to_queryto_valuevletto_headerx=xletof_xmlxml_arg0=string_of_xml~kind:"a blob"xml_arg0letof_jsonj=string_of_json~kind:"a blob"jletto_json=simple_to_jsonto_valueendmoduleReasoningTextBlock=structtypenonrect={text:String_.t[@ocaml.doc"The reasoning that the model used to return the output."];signature:String_.toption[@ocaml.doc"A token that verifies that the reasoning text was generated by the model. If you pass a reasoning block back to the API in a multi-turn conversation, include the text and its signature unmodified."]}letcontext_="ReasoningTextBlock"letmake?signature=fun~text->fun()->{signature;text}letto_valuex=structure_to_value[("text",(Some(String_.to_valuex.text)));("signature",(Option.mapx.signature~f:String_.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letsignature=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"signature")inlettext=String_.of_xml(Xml.child_exn~context:context_xml_arg0"text")inmake?signature~text()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letsignature=field_mapjson__"signature"String_.of_jsoninlettext=field_map_exnjson__"text"String_.of_jsoninmake?signature~text()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Contains the reasoning that the model used to return the output."]moduleToolResultContentBlocks=structtypenonrect=ToolResultContentBlock.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:ToolResultContentBlock.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:ToolResultContentBlock.of_xml)letof_jsonj=list_of_json~kind:"ToolResultContentBlocks"~of_json:ToolResultContentBlock.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleToolResultStatus=structtypenonrect=|Success|Error|Non_static_idofstringletmakei=iletto_string=function|Success->"success"|Error->"error"|Non_static_ids->sletof_string=function|"success"->Success|"error"->Error|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration ToolResultStatus"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"ToolResultStatus"j)letto_json=simple_to_jsonto_valueendmoduleToolUseId=structtypenonrect=stringletcontext_="ToolUseId"letmakei=letopenResultinok_or_failwith((check_string_mini~min:1)>>=(fun()->(check_string_maxi~max:64)>>=(fun()->check_patterni~pattern:"[a-zA-Z0-9_.:-]+")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"ToolUseId"jletto_json=simple_to_jsonto_valueendmoduleToolName=structtypenonrect=stringletcontext_="ToolName"letmakei=letopenResultinok_or_failwith((check_string_mini~min:1)>>=(fun()->(check_string_maxi~max:64)>>=(fun()->check_patterni~pattern:"[a-zA-Z0-9_-]+")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"ToolName"jletto_json=simple_to_jsonto_valueendmoduleToolUseType=structtypenonrect=|Server_tool_use|Non_static_idofstringletmakei=iletto_string=function|Server_tool_use->"server_tool_use"|Non_static_ids->sletof_string=function|"server_tool_use"->Server_tool_use|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration ToolUseType"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"ToolUseType"j)letto_json=simple_to_jsonto_valueendmoduleAppliedGuardrailDetails=structtypenonrect={guardrailId:GuardrailId.toption[@ocaml.doc"The unique ID of the guardrail that was applied."];guardrailVersion:GuardrailVersion.toption[@ocaml.doc"The version of the guardrail that was applied."];guardrailArn:GuardrailArn.toption[@ocaml.doc"The ARN of the guardrail that was applied."];guardrailOrigin:GuardrailOriginList.toption[@ocaml.doc"The origin of how the guardrail was applied. This can be either requested at the API level or enforced at the account or organization level as a default guardrail."];guardrailOwnership:GuardrailOwnership.toption[@ocaml.doc"The ownership type of the guardrail, indicating whether it is owned by the requesting account or is a cross-account guardrail shared from another AWS account."]}letmake?guardrailId=fun?guardrailVersion->fun?guardrailArn->fun?guardrailOrigin->fun?guardrailOwnership->fun()->{guardrailId;guardrailVersion;guardrailArn;guardrailOrigin;guardrailOwnership}letto_valuex=structure_to_value[("guardrailId",(Option.mapx.guardrailId~f:GuardrailId.to_value));("guardrailVersion",(Option.mapx.guardrailVersion~f:GuardrailVersion.to_value));("guardrailArn",(Option.mapx.guardrailArn~f:GuardrailArn.to_value));("guardrailOrigin",(Option.mapx.guardrailOrigin~f:GuardrailOriginList.to_value));("guardrailOwnership",(Option.mapx.guardrailOwnership~f:GuardrailOwnership.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letguardrailOwnership=(Option.map~f:GuardrailOwnership.of_xml)(Xml.childxml_arg0"guardrailOwnership")inletguardrailOrigin=(Option.map~f:GuardrailOriginList.of_xml)(Xml.childxml_arg0"guardrailOrigin")inletguardrailArn=(Option.map~f:GuardrailArn.of_xml)(Xml.childxml_arg0"guardrailArn")inletguardrailVersion=(Option.map~f:GuardrailVersion.of_xml)(Xml.childxml_arg0"guardrailVersion")inletguardrailId=(Option.map~f:GuardrailId.of_xml)(Xml.childxml_arg0"guardrailId")inmake?guardrailOwnership?guardrailOrigin?guardrailArn?guardrailVersion?guardrailId()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letguardrailOwnership=field_mapjson__"guardrailOwnership"GuardrailOwnership.of_jsoninletguardrailOrigin=field_mapjson__"guardrailOrigin"GuardrailOriginList.of_jsoninletguardrailArn=field_mapjson__"guardrailArn"GuardrailArn.of_jsoninletguardrailVersion=field_mapjson__"guardrailVersion"GuardrailVersion.of_jsoninletguardrailId=field_mapjson__"guardrailId"GuardrailId.of_jsoninmake?guardrailOwnership?guardrailOrigin?guardrailArn?guardrailVersion?guardrailId()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Details about the specific guardrail that was applied during this assessment, including its identifier, version, ARN, origin, and ownership information."]moduleGuardrailAutomatedReasoningPolicyAssessment=structtypenonrect={findings:GuardrailAutomatedReasoningFindingList.toption[@ocaml.doc"List of logical validation results produced by evaluating the input content against automated reasoning policies."]}letmake?findings=fun()->{findings}letto_valuex=structure_to_value[("findings",(Option.mapx.findings~f:GuardrailAutomatedReasoningFindingList.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letfindings=(Option.map~f:GuardrailAutomatedReasoningFindingList.of_xml)(Xml.childxml_arg0"findings")inmake?findings()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letfindings=field_mapjson__"findings"GuardrailAutomatedReasoningFindingList.of_jsoninmake?findings()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Contains the results of automated reasoning policy evaluation, including logical findings about the validity of claims made in the input content."]moduleGuardrailContentPolicyAssessment=structtypenonrect={filters:GuardrailContentFilterList.toption[@ocaml.doc"The content policy filters."]}letmake?filters=fun()->{filters}letto_valuex=structure_to_value[("filters",(Option.mapx.filters~f:GuardrailContentFilterList.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letfilters=(Option.map~f:GuardrailContentFilterList.of_xml)(Xml.childxml_arg0"filters")inmake?filters()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letfilters=field_mapjson__"filters"GuardrailContentFilterList.of_jsoninmake?filters()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"An assessment of a content policy for a guardrail."]moduleGuardrailContextualGroundingPolicyAssessment=structtypenonrect={filters:GuardrailContextualGroundingFilters.toption[@ocaml.doc"The filter details for the guardrails contextual grounding filter."]}letmake?filters=fun()->{filters}letto_valuex=structure_to_value[("filters",(Option.mapx.filters~f:GuardrailContextualGroundingFilters.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letfilters=(Option.map~f:GuardrailContextualGroundingFilters.of_xml)(Xml.childxml_arg0"filters")inmake?filters()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letfilters=field_mapjson__"filters"GuardrailContextualGroundingFilters.of_jsoninmake?filters()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The policy assessment details for the guardrails contextual grounding filter."]moduleGuardrailInvocationMetrics=structtypenonrect={guardrailProcessingLatency:GuardrailProcessingLatency.toption[@ocaml.doc"The processing latency details for the guardrail invocation metrics."];usage:GuardrailUsage.toption[@ocaml.doc"The usage details for the guardrail invocation metrics."];guardrailCoverage:GuardrailCoverage.toption[@ocaml.doc"The coverage details for the guardrail invocation metrics."]}letmake?guardrailProcessingLatency=fun?usage->fun?guardrailCoverage->fun()->{guardrailProcessingLatency;usage;guardrailCoverage}letto_valuex=structure_to_value[("guardrailProcessingLatency",(Option.mapx.guardrailProcessingLatency~f:GuardrailProcessingLatency.to_value));("usage",(Option.mapx.usage~f:GuardrailUsage.to_value));("guardrailCoverage",(Option.mapx.guardrailCoverage~f:GuardrailCoverage.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letguardrailCoverage=(Option.map~f:GuardrailCoverage.of_xml)(Xml.childxml_arg0"guardrailCoverage")inletusage=(Option.map~f:GuardrailUsage.of_xml)(Xml.childxml_arg0"usage")inletguardrailProcessingLatency=(Option.map~f:GuardrailProcessingLatency.of_xml)(Xml.childxml_arg0"guardrailProcessingLatency")inmake?guardrailCoverage?usage?guardrailProcessingLatency()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letguardrailCoverage=field_mapjson__"guardrailCoverage"GuardrailCoverage.of_jsoninletusage=field_mapjson__"usage"GuardrailUsage.of_jsoninletguardrailProcessingLatency=field_mapjson__"guardrailProcessingLatency"GuardrailProcessingLatency.of_jsoninmake?guardrailCoverage?usage?guardrailProcessingLatency()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The invocation metrics for the guardrail."]moduleGuardrailSensitiveInformationPolicyAssessment=structtypenonrect={piiEntities:GuardrailPiiEntityFilterList.toption[@ocaml.doc"The PII entities in the assessment."];regexes:GuardrailRegexFilterList.toption[@ocaml.doc"The regex queries in the assessment."]}letmake?piiEntities=fun?regexes->fun()->{piiEntities;regexes}letto_valuex=structure_to_value[("piiEntities",(Option.mapx.piiEntities~f:GuardrailPiiEntityFilterList.to_value));("regexes",(Option.mapx.regexes~f:GuardrailRegexFilterList.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letregexes=(Option.map~f:GuardrailRegexFilterList.of_xml)(Xml.childxml_arg0"regexes")inletpiiEntities=(Option.map~f:GuardrailPiiEntityFilterList.of_xml)(Xml.childxml_arg0"piiEntities")inmake?regexes?piiEntities()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letregexes=field_mapjson__"regexes"GuardrailRegexFilterList.of_jsoninletpiiEntities=field_mapjson__"piiEntities"GuardrailPiiEntityFilterList.of_jsoninmake?regexes?piiEntities()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The assessment for a Personally Identifiable Information (PII) policy."]moduleGuardrailTopicPolicyAssessment=structtypenonrect={topics:GuardrailTopicList.toption[@ocaml.doc"The topics in the assessment."]}letmake?topics=fun()->{topics}letto_valuex=structure_to_value[("topics",(Option.mapx.topics~f:GuardrailTopicList.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lettopics=(Option.map~f:GuardrailTopicList.of_xml)(Xml.childxml_arg0"topics")inmake?topics()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lettopics=field_mapjson__"topics"GuardrailTopicList.of_jsoninmake?topics()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A behavior assessment of a topic policy."]moduleGuardrailWordPolicyAssessment=structtypenonrect={customWords:GuardrailCustomWordList.toption[@ocaml.doc"Custom words in the assessment."];managedWordLists:GuardrailManagedWordList.toption[@ocaml.doc"Managed word lists in the assessment."]}letmake?customWords=fun?managedWordLists->fun()->{customWords;managedWordLists}letto_valuex=structure_to_value[("customWords",(Option.mapx.customWords~f:GuardrailCustomWordList.to_value));("managedWordLists",(Option.mapx.managedWordLists~f:GuardrailManagedWordList.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmanagedWordLists=(Option.map~f:GuardrailManagedWordList.of_xml)(Xml.childxml_arg0"managedWordLists")inletcustomWords=(Option.map~f:GuardrailCustomWordList.of_xml)(Xml.childxml_arg0"customWords")inmake?managedWordLists?customWords()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmanagedWordLists=field_mapjson__"managedWordLists"GuardrailManagedWordList.of_jsoninletcustomWords=field_mapjson__"customWords"GuardrailCustomWordList.of_jsoninmake?managedWordLists?customWords()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The word policy assessment."]moduleAudioBlock=structtypenonrect={format:AudioFormat.t[@ocaml.doc"The format of the audio data, such as MP3, WAV, FLAC, or other supported audio formats."];source:AudioSource.t[@ocaml.doc"The source of the audio data, which can be provided as raw bytes or an S3 location."];error:ErrorBlock.toption[@ocaml.doc"Error information if the audio block could not be processed or contains invalid data."]}letcontext_="AudioBlock"letmake?error=fun~format->fun~source->fun()->{error;format;source}letto_valuex=structure_to_value[("format",(Some(AudioFormat.to_valuex.format)));("source",(Some(AudioSource.to_valuex.source)));("error",(Option.mapx.error~f:ErrorBlock.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=leterror=(Option.map~f:ErrorBlock.of_xml)(Xml.childxml_arg0"error")inletsource=AudioSource.of_xml(Xml.child_exn~context:context_xml_arg0"source")inletformat=AudioFormat.of_xml(Xml.child_exn~context:context_xml_arg0"format")inmake?error~source~format()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=leterror=field_mapjson__"error"ErrorBlock.of_jsoninletsource=field_map_exnjson__"source"AudioSource.of_jsoninletformat=field_map_exnjson__"format"AudioFormat.of_jsoninmake?error~source~format()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"An audio content block that contains audio data in various supported formats."]moduleCachePointBlock=structtypenonrect={type_:CachePointType.t[@ocaml.doc"Specifies the type of cache point within the CachePointBlock."];ttl:CacheTTL.toption[@ocaml.doc"Optional TTL duration for cache entries. When specified, enables extended TTL caching with the specified duration. When omitted, uses type value for caching behavior."]}letcontext_="CachePointBlock"letmake?ttl=fun~type_->fun()->{ttl;type_}letto_valuex=structure_to_value[("type",(Some(CachePointType.to_valuex.type_)));("ttl",(Option.mapx.ttl~f:CacheTTL.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letttl=(Option.map~f:CacheTTL.of_xml)(Xml.childxml_arg0"ttl")inlettype_=CachePointType.of_xml(Xml.child_exn~context:context_xml_arg0"type")inmake?ttl~type_()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letttl=field_mapjson__"ttl"CacheTTL.of_jsoninlettype_=field_map_exnjson__"type"CachePointType.of_jsoninmake?ttl~type_()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Defines a section of content to be cached for reuse in subsequent API calls."]moduleCitationsContentBlock=structtypenonrect={content:CitationGeneratedContentList.toption[@ocaml.doc"The generated content that is supported by the associated citations."];citations:Citations.toption[@ocaml.doc"An array of citations that reference the source documents used to generate the associated content."]}letmake?content=fun?citations->fun()->{content;citations}letto_valuex=structure_to_value[("content",(Option.mapx.content~f:CitationGeneratedContentList.to_value));("citations",(Option.mapx.citations~f:Citations.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letcitations=(Option.map~f:Citations.of_xml)(Xml.childxml_arg0"citations")inletcontent=(Option.map~f:CitationGeneratedContentList.of_xml)(Xml.childxml_arg0"content")inmake?citations?content()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letcitations=field_mapjson__"citations"Citations.of_jsoninletcontent=field_mapjson__"content"CitationGeneratedContentList.of_jsoninmake?citations?content()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A content block that contains both generated text and associated citation information. This block type is returned when document citations are enabled, providing traceability between the generated content and the source documents that informed the response."]moduleGuardrailConverseContentBlock=structtypenonrect={text:GuardrailConverseTextBlock.toption[@ocaml.doc"The text to guard."];image:GuardrailConverseImageBlock.toption[@ocaml.doc"Image within converse content block to be evaluated by the guardrail."]}letmake?text=fun?image->fun()->{text;image}letto_valuex=structure_to_value[("text",(Option.mapx.text~f:GuardrailConverseTextBlock.to_value));("image",(Option.mapx.image~f:GuardrailConverseImageBlock.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letimage=(Option.map~f:GuardrailConverseImageBlock.of_xml)(Xml.childxml_arg0"image")inlettext=(Option.map~f:GuardrailConverseTextBlock.of_xml)(Xml.childxml_arg0"text")inmake?image?text()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letimage=field_mapjson__"image"GuardrailConverseImageBlock.of_jsoninlettext=field_mapjson__"text"GuardrailConverseTextBlock.of_jsoninmake?image?text()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A content block for selective guarding with the Converse or ConverseStream API operations."]moduleReasoningContentBlock=structtypenonrect={reasoningText:ReasoningTextBlock.toption[@ocaml.doc"The reasoning that the model used to return the output."];redactedContent:Blob.toption[@ocaml.doc"The content in the reasoning that was encrypted by the model provider for safety reasons. The encryption doesn't affect the quality of responses."]}letmake?reasoningText=fun?redactedContent->fun()->{reasoningText;redactedContent}letto_valuex=structure_to_value[("reasoningText",(Option.mapx.reasoningText~f:ReasoningTextBlock.to_value));("redactedContent",(Option.mapx.redactedContent~f:Blob.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letredactedContent=(Option.map~f:Blob.of_xml)(Xml.childxml_arg0"redactedContent")inletreasoningText=(Option.map~f:ReasoningTextBlock.of_xml)(Xml.childxml_arg0"reasoningText")inmake?redactedContent?reasoningText()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letredactedContent=field_mapjson__"redactedContent"Blob.of_jsoninletreasoningText=field_mapjson__"reasoningText"ReasoningTextBlock.of_jsoninmake?redactedContent?reasoningText()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Contains content regarding the reasoning that is carried out by the model with respect to the content in the content block. Reasoning refers to a Chain of Thought (CoT) that the model generates to enhance the accuracy of its final response."]moduleToolResultBlock=structtypenonrect={toolUseId:ToolUseId.t[@ocaml.doc"The ID of the tool request that this is the result for."];content:ToolResultContentBlocks.t[@ocaml.doc"The content for tool result content block."];status:ToolResultStatus.toption[@ocaml.doc"The status for the tool result content block. This field is only supported by Amazon Nova and Anthropic Claude 3 and 4 models."];type_:String_.toption[@ocaml.doc"The type for the tool result content block."]}letcontext_="ToolResultBlock"letmake?status=fun?type_->fun~toolUseId->fun~content->fun()->{status;type_;toolUseId;content}letto_valuex=structure_to_value[("toolUseId",(Some(ToolUseId.to_valuex.toolUseId)));("content",(Some(ToolResultContentBlocks.to_valuex.content)));("status",(Option.mapx.status~f:ToolResultStatus.to_value));("type",(Option.mapx.type_~f:String_.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lettype_=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"type")inletstatus=(Option.map~f:ToolResultStatus.of_xml)(Xml.childxml_arg0"status")inletcontent=ToolResultContentBlocks.of_xml(Xml.child_exn~context:context_xml_arg0"content")inlettoolUseId=ToolUseId.of_xml(Xml.child_exn~context:context_xml_arg0"toolUseId")inmake?type_?status~content~toolUseId()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lettype_=field_mapjson__"type"String_.of_jsoninletstatus=field_mapjson__"status"ToolResultStatus.of_jsoninletcontent=field_map_exnjson__"content"ToolResultContentBlocks.of_jsoninlettoolUseId=field_map_exnjson__"toolUseId"ToolUseId.of_jsoninmake?type_?status~content~toolUseId()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A tool result block that contains the results for a tool request that the model previously made. For more information, see Call a tool with the Converse API in the Amazon Bedrock User Guide."]moduleToolUseBlock=structtypenonrect={toolUseId:ToolUseId.t[@ocaml.doc"The ID for the tool request."];name:ToolName.t[@ocaml.doc"The name of the tool that the model wants to use."];input:Document.t[@ocaml.doc"The input to pass to the tool."];type_:ToolUseType.toption[@ocaml.doc"The type for the tool request."]}letcontext_="ToolUseBlock"letmake?type_=fun~toolUseId->fun~name->fun~input->fun()->{type_;toolUseId;name;input}letto_valuex=structure_to_value[("toolUseId",(Some(ToolUseId.to_valuex.toolUseId)));("name",(Some(ToolName.to_valuex.name)));("input",(Some(Document.to_valuex.input)));("type",(Option.mapx.type_~f:ToolUseType.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lettype_=(Option.map~f:ToolUseType.of_xml)(Xml.childxml_arg0"type")inletinput=Document.of_xml(Xml.child_exn~context:context_xml_arg0"input")inletname=ToolName.of_xml(Xml.child_exn~context:context_xml_arg0"name")inlettoolUseId=ToolUseId.of_xml(Xml.child_exn~context:context_xml_arg0"toolUseId")inmake?type_~input~name~toolUseId()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lettype_=field_mapjson__"type"ToolUseType.of_jsoninletinput=field_map_exnjson__"input"Document.of_jsoninletname=field_map_exnjson__"name"ToolName.of_jsoninlettoolUseId=field_map_exnjson__"toolUseId"ToolUseId.of_jsoninmake?type_~input~name~toolUseId()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A tool use content block. Contains information about a tool that the model is requesting be run., The model uses the result from the tool to generate a response. For more information, see Call a tool with the Converse API in the Amazon Bedrock User Guide."]moduleNonEmptyString=structtypenonrect=stringletcontext_="NonEmptyString"letmakei=letopenResultinok_or_failwith(check_string_mini~min:1);iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"NonEmptyString"jletto_json=simple_to_jsonto_valueendmoduleToolInputSchema=structtypenonrect={json:Document.toption[@ocaml.doc"The JSON schema for the tool. For more information, see JSON Schema Reference."]}letmake?json=fun()->{json}letto_valuex=structure_to_value[("json",(Option.mapx.json~f:Document.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letjson=(Option.map~f:Document.of_xml)(Xml.childxml_arg0"json")inmake?json()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letjson=field_mapjson__"json"Document.of_jsoninmake?json()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The schema for the tool. The top level schema type must be object. For more information, see Call a tool with the Converse API in the Amazon Bedrock User Guide."]moduleGuardrailAssessment=structtypenonrect={topicPolicy:GuardrailTopicPolicyAssessment.toption[@ocaml.doc"The topic policy."];contentPolicy:GuardrailContentPolicyAssessment.toption[@ocaml.doc"The content policy."];wordPolicy:GuardrailWordPolicyAssessment.toption[@ocaml.doc"The word policy."];sensitiveInformationPolicy:GuardrailSensitiveInformationPolicyAssessment.toption[@ocaml.doc"The sensitive information policy."];contextualGroundingPolicy:GuardrailContextualGroundingPolicyAssessment.toption[@ocaml.doc"The contextual grounding policy used for the guardrail assessment."];automatedReasoningPolicy:GuardrailAutomatedReasoningPolicyAssessment.toption[@ocaml.doc"The automated reasoning policy assessment results, including logical validation findings for the input content."];invocationMetrics:GuardrailInvocationMetrics.toption[@ocaml.doc"The invocation metrics for the guardrail assessment."];appliedGuardrailDetails:AppliedGuardrailDetails.toption}letmake?topicPolicy=fun?contentPolicy->fun?wordPolicy->fun?sensitiveInformationPolicy->fun?contextualGroundingPolicy->fun?automatedReasoningPolicy->fun?invocationMetrics->fun?appliedGuardrailDetails->fun()->{topicPolicy;contentPolicy;wordPolicy;sensitiveInformationPolicy;contextualGroundingPolicy;automatedReasoningPolicy;invocationMetrics;appliedGuardrailDetails}letto_valuex=structure_to_value[("topicPolicy",(Option.mapx.topicPolicy~f:GuardrailTopicPolicyAssessment.to_value));("contentPolicy",(Option.mapx.contentPolicy~f:GuardrailContentPolicyAssessment.to_value));("wordPolicy",(Option.mapx.wordPolicy~f:GuardrailWordPolicyAssessment.to_value));("sensitiveInformationPolicy",(Option.mapx.sensitiveInformationPolicy~f:GuardrailSensitiveInformationPolicyAssessment.to_value));("contextualGroundingPolicy",(Option.mapx.contextualGroundingPolicy~f:GuardrailContextualGroundingPolicyAssessment.to_value));("automatedReasoningPolicy",(Option.mapx.automatedReasoningPolicy~f:GuardrailAutomatedReasoningPolicyAssessment.to_value));("invocationMetrics",(Option.mapx.invocationMetrics~f:GuardrailInvocationMetrics.to_value));("appliedGuardrailDetails",(Option.mapx.appliedGuardrailDetails~f:AppliedGuardrailDetails.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letappliedGuardrailDetails=(Option.map~f:AppliedGuardrailDetails.of_xml)(Xml.childxml_arg0"appliedGuardrailDetails")inletinvocationMetrics=(Option.map~f:GuardrailInvocationMetrics.of_xml)(Xml.childxml_arg0"invocationMetrics")inletautomatedReasoningPolicy=(Option.map~f:GuardrailAutomatedReasoningPolicyAssessment.of_xml)(Xml.childxml_arg0"automatedReasoningPolicy")inletcontextualGroundingPolicy=(Option.map~f:GuardrailContextualGroundingPolicyAssessment.of_xml)(Xml.childxml_arg0"contextualGroundingPolicy")inletsensitiveInformationPolicy=(Option.map~f:GuardrailSensitiveInformationPolicyAssessment.of_xml)(Xml.childxml_arg0"sensitiveInformationPolicy")inletwordPolicy=(Option.map~f:GuardrailWordPolicyAssessment.of_xml)(Xml.childxml_arg0"wordPolicy")inletcontentPolicy=(Option.map~f:GuardrailContentPolicyAssessment.of_xml)(Xml.childxml_arg0"contentPolicy")inlettopicPolicy=(Option.map~f:GuardrailTopicPolicyAssessment.of_xml)(Xml.childxml_arg0"topicPolicy")inmake?appliedGuardrailDetails?invocationMetrics?automatedReasoningPolicy?contextualGroundingPolicy?sensitiveInformationPolicy?wordPolicy?contentPolicy?topicPolicy()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letappliedGuardrailDetails=field_mapjson__"appliedGuardrailDetails"AppliedGuardrailDetails.of_jsoninletinvocationMetrics=field_mapjson__"invocationMetrics"GuardrailInvocationMetrics.of_jsoninletautomatedReasoningPolicy=field_mapjson__"automatedReasoningPolicy"GuardrailAutomatedReasoningPolicyAssessment.of_jsoninletcontextualGroundingPolicy=field_mapjson__"contextualGroundingPolicy"GuardrailContextualGroundingPolicyAssessment.of_jsoninletsensitiveInformationPolicy=field_mapjson__"sensitiveInformationPolicy"GuardrailSensitiveInformationPolicyAssessment.of_jsoninletwordPolicy=field_mapjson__"wordPolicy"GuardrailWordPolicyAssessment.of_jsoninletcontentPolicy=field_mapjson__"contentPolicy"GuardrailContentPolicyAssessment.of_jsoninlettopicPolicy=field_mapjson__"topicPolicy"GuardrailTopicPolicyAssessment.of_jsoninmake?appliedGuardrailDetails?invocationMetrics?automatedReasoningPolicy?contextualGroundingPolicy?sensitiveInformationPolicy?wordPolicy?contentPolicy?topicPolicy()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A behavior assessment of the guardrail policies used in a call to the Converse API."]moduleContentBlock=structtypenonrect={text:String_.toption[@ocaml.doc"Text to include in the message."];image:ImageBlock.toption[@ocaml.doc"Image to include in the message. This field is only supported by Anthropic Claude 3 models."];document:DocumentBlock.toption[@ocaml.doc"A document to include in the message."];video:VideoBlock.toption[@ocaml.doc"Video to include in the message."];audio:AudioBlock.toption[@ocaml.doc"An audio content block containing audio data in the conversation."];toolUse:ToolUseBlock.toption[@ocaml.doc"Information about a tool use request from a model."];toolResult:ToolResultBlock.toption[@ocaml.doc"The result for a tool request that a model makes."];guardContent:GuardrailConverseContentBlock.toption[@ocaml.doc"Contains the content to assess with the guardrail. If you don't specify guardContent in a call to the Converse API, the guardrail (if passed in the Converse API) assesses the entire message. For more information, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide."];cachePoint:CachePointBlock.toption[@ocaml.doc"CachePoint to include in the message."];reasoningContent:ReasoningContentBlock.toption[@ocaml.doc"Contains content regarding the reasoning that is carried out by the model. Reasoning refers to a Chain of Thought (CoT) that the model generates to enhance the accuracy of its final response."];citationsContent:CitationsContentBlock.toption[@ocaml.doc"A content block that contains both generated text and associated citation information, providing traceability between the response and source documents."];searchResult:SearchResultBlock.toption[@ocaml.doc"Search result to include in the message."]}letmake?text=fun?image->fun?document->fun?video->fun?audio->fun?toolUse->fun?toolResult->fun?guardContent->fun?cachePoint->fun?reasoningContent->fun?citationsContent->fun?searchResult->fun()->{text;image;document;video;audio;toolUse;toolResult;guardContent;cachePoint;reasoningContent;citationsContent;searchResult}letto_valuex=structure_to_value[("text",(Option.mapx.text~f:String_.to_value));("image",(Option.mapx.image~f:ImageBlock.to_value));("document",(Option.mapx.document~f:DocumentBlock.to_value));("video",(Option.mapx.video~f:VideoBlock.to_value));("audio",(Option.mapx.audio~f:AudioBlock.to_value));("toolUse",(Option.mapx.toolUse~f:ToolUseBlock.to_value));("toolResult",(Option.mapx.toolResult~f:ToolResultBlock.to_value));("guardContent",(Option.mapx.guardContent~f:GuardrailConverseContentBlock.to_value));("cachePoint",(Option.mapx.cachePoint~f:CachePointBlock.to_value));("reasoningContent",(Option.mapx.reasoningContent~f:ReasoningContentBlock.to_value));("citationsContent",(Option.mapx.citationsContent~f:CitationsContentBlock.to_value));("searchResult",(Option.mapx.searchResult~f:SearchResultBlock.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letsearchResult=(Option.map~f:SearchResultBlock.of_xml)(Xml.childxml_arg0"searchResult")inletcitationsContent=(Option.map~f:CitationsContentBlock.of_xml)(Xml.childxml_arg0"citationsContent")inletreasoningContent=(Option.map~f:ReasoningContentBlock.of_xml)(Xml.childxml_arg0"reasoningContent")inletcachePoint=(Option.map~f:CachePointBlock.of_xml)(Xml.childxml_arg0"cachePoint")inletguardContent=(Option.map~f:GuardrailConverseContentBlock.of_xml)(Xml.childxml_arg0"guardContent")inlettoolResult=(Option.map~f:ToolResultBlock.of_xml)(Xml.childxml_arg0"toolResult")inlettoolUse=(Option.map~f:ToolUseBlock.of_xml)(Xml.childxml_arg0"toolUse")inletaudio=(Option.map~f:AudioBlock.of_xml)(Xml.childxml_arg0"audio")inletvideo=(Option.map~f:VideoBlock.of_xml)(Xml.childxml_arg0"video")inletdocument=(Option.map~f:DocumentBlock.of_xml)(Xml.childxml_arg0"document")inletimage=(Option.map~f:ImageBlock.of_xml)(Xml.childxml_arg0"image")inlettext=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"text")inmake?searchResult?citationsContent?reasoningContent?cachePoint?guardContent?toolResult?toolUse?audio?video?document?image?text()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letsearchResult=field_mapjson__"searchResult"SearchResultBlock.of_jsoninletcitationsContent=field_mapjson__"citationsContent"CitationsContentBlock.of_jsoninletreasoningContent=field_mapjson__"reasoningContent"ReasoningContentBlock.of_jsoninletcachePoint=field_mapjson__"cachePoint"CachePointBlock.of_jsoninletguardContent=field_mapjson__"guardContent"GuardrailConverseContentBlock.of_jsoninlettoolResult=field_mapjson__"toolResult"ToolResultBlock.of_jsoninlettoolUse=field_mapjson__"toolUse"ToolUseBlock.of_jsoninletaudio=field_mapjson__"audio"AudioBlock.of_jsoninletvideo=field_mapjson__"video"VideoBlock.of_jsoninletdocument=field_mapjson__"document"DocumentBlock.of_jsoninletimage=field_mapjson__"image"ImageBlock.of_jsoninlettext=field_mapjson__"text"String_.of_jsoninmake?searchResult?citationsContent?reasoningContent?cachePoint?guardContent?toolResult?toolUse?audio?video?document?image?text()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A block of content for a message that you pass to, or receive from, a model with the Converse or ConverseStream API operations."]moduleSystemTool=structtypenonrect={name:ToolName.t[@ocaml.doc"The name of the system-defined tool that you want to call."]}letcontext_="SystemTool"letmake~name=fun()->{name}letto_valuex=structure_to_value[("name",(Some(ToolName.to_valuex.name)))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letname=ToolName.of_xml(Xml.child_exn~context:context_xml_arg0"name")inmake~name()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letname=field_map_exnjson__"name"ToolName.of_jsoninmake~name()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Specifies a system-defined tool for the model to use. System-defined tools are tools that are created and provided by the model provider."]moduleToolSpecification=structtypenonrect={name:ToolName.t[@ocaml.doc"The name for the tool."];description:NonEmptyString.toption[@ocaml.doc"The description for the tool."];inputSchema:ToolInputSchema.t[@ocaml.doc"The input schema for the tool in JSON format."];strict:Boolean.toption[@ocaml.doc"Flag to enable structured output enforcement on a tool usage response."]}letcontext_="ToolSpecification"letmake?description=fun?strict->fun~name->fun~inputSchema->fun()->{description;strict;name;inputSchema}letto_valuex=structure_to_value[("name",(Some(ToolName.to_valuex.name)));("description",(Option.mapx.description~f:NonEmptyString.to_value));("inputSchema",(Some(ToolInputSchema.to_valuex.inputSchema)));("strict",(Option.mapx.strict~f:Boolean.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letstrict=(Option.map~f:Boolean.of_xml)(Xml.childxml_arg0"strict")inletinputSchema=ToolInputSchema.of_xml(Xml.child_exn~context:context_xml_arg0"inputSchema")inletdescription=(Option.map~f:NonEmptyString.of_xml)(Xml.childxml_arg0"description")inletname=ToolName.of_xml(Xml.child_exn~context:context_xml_arg0"name")inmake?strict~inputSchema?description~name()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letstrict=field_mapjson__"strict"Boolean.of_jsoninletinputSchema=field_map_exnjson__"inputSchema"ToolInputSchema.of_jsoninletdescription=field_mapjson__"description"NonEmptyString.of_jsoninletname=field_map_exnjson__"name"ToolName.of_jsoninmake?strict~inputSchema?description~name()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The specification for the tool. For more information, see Call a tool with the Converse API in the Amazon Bedrock User Guide."]moduleCitationSourceContentDelta=structtypenonrect={text:String_.toption[@ocaml.doc"An incremental update to the text content from the source document that is being cited."]}letmake?text=fun()->{text}letto_valuex=structure_to_value[("text",(Option.mapx.text~f:String_.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lettext=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"text")inmake?text()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lettext=field_mapjson__"text"String_.of_jsoninmake?text()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Contains incremental updates to the source content text during streaming responses, allowing clients to build up the cited content progressively."]moduleGuardrailAssessmentList=structtypenonrect=GuardrailAssessment.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:GuardrailAssessment.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:GuardrailAssessment.of_xml)letof_jsonj=list_of_json~kind:"GuardrailAssessmentList"~of_json:GuardrailAssessment.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleGuardrailOutputText=structtypenonrect=stringletcontext_="GuardrailOutputText"letmakei=iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"GuardrailOutputText"jletto_json=simple_to_jsonto_valueendmoduleCacheDetailInputTokensInteger=structtypenonrect=intletmakei=letopenResultinok_or_failwith(check_int_mini~min:0);iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for CacheDetailInputTokensInteger"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleKmsKeyId=structtypenonrect=stringletcontext_="KmsKeyId"letmakei=letopenResultinok_or_failwith((check_string_mini~min:1)>>=(fun()->(check_string_maxi~max:2048)>>=(fun()->check_patterni~pattern:"arn:aws(-[^:]+)?:kms:[a-zA-Z0-9-]*:[0-9]{12}:((key/[a-zA-Z0-9-]{36})|(alias/[a-zA-Z0-9-_/]+))")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"KmsKeyId"jletto_json=simple_to_jsonto_valueendmoduleContentBlocks=structtypenonrect=ContentBlock.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:ContentBlock.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:ContentBlock.of_xml)letof_jsonj=list_of_json~kind:"ContentBlocks"~of_json:ContentBlock.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleConversationRole=structtypenonrect=|User|Assistant|Non_static_idofstringletmakei=iletto_string=function|User->"user"|Assistant->"assistant"|Non_static_ids->sletof_string=function|"user"->User|"assistant"->Assistant|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration ConversationRole"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"ConversationRole"j)letto_json=simple_to_jsonto_valueendmoduleAnyToolChoice=structtypenonrect=unitletmake()=()letof_header_and_body=((fun(xs,pipe)->make())[@warning"-27"])letto_value_=`Structure[]letto_queryv=to_queryto_valuevletof_xml_=make()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_json_=make()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The model must request at least one tool (no text is generated). For example, \\{\"any\" : \\{\\}\\}. For more information, see Call a tool with the Converse API in the Amazon Bedrock User Guide."]moduleAutoToolChoice=structtypenonrect=unitletmake()=()letof_header_and_body=((fun(xs,pipe)->make())[@warning"-27"])letto_value_=`Structure[]letto_queryv=to_queryto_valuevletof_xml_=make()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_json_=make()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The Model automatically decides if a tool should be called or whether to generate text instead. For example, \\{\"auto\" : \\{\\}\\}. For more information, see Call a tool with the Converse API in the Amazon Bedrock User Guide"]moduleSpecificToolChoice=structtypenonrect={name:ToolName.t[@ocaml.doc"The name of the tool that the model must request."]}letcontext_="SpecificToolChoice"letmake~name=fun()->{name}letto_valuex=structure_to_value[("name",(Some(ToolName.to_valuex.name)))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letname=ToolName.of_xml(Xml.child_exn~context:context_xml_arg0"name")inmake~name()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letname=field_map_exnjson__"name"ToolName.of_jsoninmake~name()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The model must request a specific tool. For example, \\{\"tool\" : \\{\"name\" : \"Your tool name\"\\}\\}. For more information, see Call a tool with the Converse API in the Amazon Bedrock User Guide This field is only supported by Anthropic Claude 3 models."]moduleTool=structtypenonrect={toolSpec:ToolSpecification.toption[@ocaml.doc"The specfication for the tool."];systemTool:SystemTool.toption[@ocaml.doc"Specifies the system-defined tool that you want use."];cachePoint:CachePointBlock.toption[@ocaml.doc"CachePoint to include in the tool configuration."]}letmake?toolSpec=fun?systemTool->fun?cachePoint->fun()->{toolSpec;systemTool;cachePoint}letto_valuex=structure_to_value[("toolSpec",(Option.mapx.toolSpec~f:ToolSpecification.to_value));("systemTool",(Option.mapx.systemTool~f:SystemTool.to_value));("cachePoint",(Option.mapx.cachePoint~f:CachePointBlock.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letcachePoint=(Option.map~f:CachePointBlock.of_xml)(Xml.childxml_arg0"cachePoint")inletsystemTool=(Option.map~f:SystemTool.of_xml)(Xml.childxml_arg0"systemTool")inlettoolSpec=(Option.map~f:ToolSpecification.of_xml)(Xml.childxml_arg0"toolSpec")inmake?cachePoint?systemTool?toolSpec()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letcachePoint=field_mapjson__"cachePoint"CachePointBlock.of_jsoninletsystemTool=field_mapjson__"systemTool"SystemTool.of_jsoninlettoolSpec=field_mapjson__"toolSpec"ToolSpecification.of_jsoninmake?cachePoint?systemTool?toolSpec()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Information about a tool that you can use with the Converse API. For more information, see Call a tool with the Converse API in the Amazon Bedrock User Guide."]moduleCitationSourceContentListDelta=structtypenonrect=CitationSourceContentDelta.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:CitationSourceContentDelta.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:CitationSourceContentDelta.of_xml)letof_jsonj=list_of_json~kind:"CitationSourceContentListDelta"~of_json:CitationSourceContentDelta.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleToolResultBlockDelta=structtypenonrect={text:String_.toption[@ocaml.doc"The reasoning the model used to return the output."];json:Document.toption[@ocaml.doc"The JSON schema for the tool result content block. see JSON Schema Reference."]}letmake?text=fun?json->fun()->{text;json}letto_valuex=structure_to_value[("text",(Option.mapx.text~f:String_.to_value));("json",(Option.mapx.json~f:Document.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letjson=(Option.map~f:Document.of_xml)(Xml.childxml_arg0"json")inlettext=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"text")inmake?json?text()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letjson=field_mapjson__"json"Document.of_jsoninlettext=field_mapjson__"text"String_.of_jsoninmake?json?text()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Contains incremental updates to tool results information during streaming responses. This allows clients to build up tool results data progressively as the response is generated."]moduleGuardrailAssessmentListMap=structtypenonrect=(String_.t*GuardrailAssessmentList.t)listletmakei=iletof_headerxs=make(List.filter_mapxs~f:(fun(k,v)->(Base.String.chop_prefixk~prefix:"x-amz-meta-")|>(Option.map~f:(funchopped->let(_:string)=vinlet(_:string)=choppedinfailwith"no of_header for complex types String GuardrailAssessmentList"))))letto_valuexs=(xs|>(List.map~f:(fun(x,y)->(String_.to_valuex)|>(funx->(GuardrailAssessmentList.to_valuey)|>(funy->(x,y))))))|>(funx->`Mapx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for Map_shape objects"()letof_xml_=failwith"of_xml_converter_of_shape: Map_shape case not implemented"letof_jsonj=object_of_json~key_of_string:String_.of_string~of_json:GuardrailAssessmentList.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleGuardrailAssessmentMap=structtypenonrect=(String_.t*GuardrailAssessment.t)listletmakei=iletof_headerxs=make(List.filter_mapxs~f:(fun(k,v)->(Base.String.chop_prefixk~prefix:"x-amz-meta-")|>(Option.map~f:(funchopped->let(_:string)=vinlet(_:string)=choppedinfailwith"no of_header for complex types String GuardrailAssessment"))))letto_valuexs=(xs|>(List.map~f:(fun(x,y)->(String_.to_valuex)|>(funx->(GuardrailAssessment.to_valuey)|>(funy->(x,y))))))|>(funx->`Mapx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for Map_shape objects"()letof_xml_=failwith"of_xml_converter_of_shape: Map_shape case not implemented"letof_jsonj=object_of_json~key_of_string:String_.of_string~of_json:GuardrailAssessment.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleModelOutputs=structtypenonrect=GuardrailOutputText.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:GuardrailOutputText.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:GuardrailOutputText.of_xml)letof_jsonj=list_of_json~kind:"ModelOutputs"~of_json:GuardrailOutputText.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleInvokedModelId=structtypenonrect=stringletcontext_="InvokedModelId"letmakei=letopenResultinok_or_failwith(check_patterni~pattern:"(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}::foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([a-z0-9-]{1,63}[.]){0,2}[a-z0-9-]{1,63}([:][a-z0-9-]{1,63}){0,2})|(arn:aws(|-us-gov|-cn|-iso|-iso-b):bedrock:(|[0-9a-z-]{1,20}):(|[0-9]{12}):inference-profile/[a-zA-Z0-9-:.]+)");iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"InvokedModelId"jletto_json=simple_to_jsonto_valueendmoduleCacheDetail=structtypenonrect={ttl:CacheTTL.toption[@ocaml.doc"TTL duration for these cached tokens"];inputTokens:CacheDetailInputTokensInteger.toption[@ocaml.doc"Number of tokens written to cache with this TTL (cache creation tokens)"]}letmake?ttl=fun?inputTokens->fun()->{ttl;inputTokens}letto_valuex=structure_to_value[("ttl",(Option.mapx.ttl~f:CacheTTL.to_value));("inputTokens",(Option.mapx.inputTokens~f:CacheDetailInputTokensInteger.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letinputTokens=(Option.map~f:CacheDetailInputTokensInteger.of_xml)(Xml.childxml_arg0"inputTokens")inletttl=(Option.map~f:CacheTTL.of_xml)(Xml.childxml_arg0"ttl")inmake?inputTokens?ttl()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letinputTokens=field_mapjson__"inputTokens"CacheDetailInputTokensInteger.of_jsoninletttl=field_mapjson__"ttl"CacheTTL.of_jsoninmake?inputTokens?ttl()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Cache creation metrics for a specific TTL duration"]moduleGuardrailImageSourceBytesBlob=structtypenonrect=stringletmakei=iletof_stringx=xletto_valuex=`Blobxletto_queryv=to_queryto_valuevletto_headerx=xletof_xmlxml_arg0=string_of_xml~kind:"a blob"xml_arg0letof_jsonj=string_of_json~kind:"a blob"jletto_json=simple_to_jsonto_valueendmoduleGuardrailContentQualifier=structtypenonrect=|Grounding_source|Query|Guard_content|Non_static_idofstringletmakei=iletto_string=function|Grounding_source->"grounding_source"|Query->"query"|Guard_content->"guard_content"|Non_static_ids->sletof_string=function|"grounding_source"->Grounding_source|"query"->Query|"guard_content"->Guard_content|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration GuardrailContentQualifier"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"GuardrailContentQualifier"j)letto_json=simple_to_jsonto_valueendmoduleAsyncInvokeS3OutputDataConfig=structtypenonrect={s3Uri:S3Uri.t[@ocaml.doc"An object URI starting with s3://."];kmsKeyId:KmsKeyId.toption[@ocaml.doc"A KMS encryption key ID."];bucketOwner:AccountId.toption[@ocaml.doc"If the bucket belongs to another AWS account, specify that account's ID."]}letcontext_="AsyncInvokeS3OutputDataConfig"letmake?kmsKeyId=fun?bucketOwner->fun~s3Uri->fun()->{kmsKeyId;bucketOwner;s3Uri}letto_valuex=structure_to_value[("s3Uri",(Some(S3Uri.to_valuex.s3Uri)));("kmsKeyId",(Option.mapx.kmsKeyId~f:KmsKeyId.to_value));("bucketOwner",(Option.mapx.bucketOwner~f:AccountId.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letbucketOwner=(Option.map~f:AccountId.of_xml)(Xml.childxml_arg0"bucketOwner")inletkmsKeyId=(Option.map~f:KmsKeyId.of_xml)(Xml.childxml_arg0"kmsKeyId")inlets3Uri=S3Uri.of_xml(Xml.child_exn~context:context_xml_arg0"s3Uri")inmake?bucketOwner?kmsKeyId~s3Uri()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letbucketOwner=field_mapjson__"bucketOwner"AccountId.of_jsoninletkmsKeyId=field_mapjson__"kmsKeyId"KmsKeyId.of_jsoninlets3Uri=field_map_exnjson__"s3Uri"S3Uri.of_jsoninmake?bucketOwner?kmsKeyId~s3Uri()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Asynchronous invocation output data settings."]moduleMessage=structtypenonrect={role:ConversationRole.t[@ocaml.doc"The role that the message plays in the message."];content:ContentBlocks.t[@ocaml.doc"The message content. Note the following restrictions: You can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively. You can include up to five documents. Each document's size must be no more than 4.5 MB. If you include a ContentBlock with a document field in the array, you must also include a ContentBlock with a text field. You can only include images and documents if the role is user."]}letcontext_="Message"letmake~role=fun~content->fun()->{role;content}letto_valuex=structure_to_value[("role",(Some(ConversationRole.to_valuex.role)));("content",(Some(ContentBlocks.to_valuex.content)))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letcontent=ContentBlocks.of_xml(Xml.child_exn~context:context_xml_arg0"content")inletrole=ConversationRole.of_xml(Xml.child_exn~context:context_xml_arg0"role")inmake~content~role()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letcontent=field_map_exnjson__"content"ContentBlocks.of_jsoninletrole=field_map_exnjson__"role"ConversationRole.of_jsoninmake~content~role()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A message input, or returned from, a call to Converse or ConverseStream."]moduleSystemContentBlock=structtypenonrect={text:NonEmptyString.toption[@ocaml.doc"A system prompt for the model."];guardContent:GuardrailConverseContentBlock.toption[@ocaml.doc"A content block to assess with the guardrail. Use with the Converse or ConverseStream API operations. For more information, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide."];cachePoint:CachePointBlock.toption[@ocaml.doc"CachePoint to include in the system prompt."]}letmake?text=fun?guardContent->fun?cachePoint->fun()->{text;guardContent;cachePoint}letto_valuex=structure_to_value[("text",(Option.mapx.text~f:NonEmptyString.to_value));("guardContent",(Option.mapx.guardContent~f:GuardrailConverseContentBlock.to_value));("cachePoint",(Option.mapx.cachePoint~f:CachePointBlock.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letcachePoint=(Option.map~f:CachePointBlock.of_xml)(Xml.childxml_arg0"cachePoint")inletguardContent=(Option.map~f:GuardrailConverseContentBlock.of_xml)(Xml.childxml_arg0"guardContent")inlettext=(Option.map~f:NonEmptyString.of_xml)(Xml.childxml_arg0"text")inmake?cachePoint?guardContent?text()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letcachePoint=field_mapjson__"cachePoint"CachePointBlock.of_jsoninletguardContent=field_mapjson__"guardContent"GuardrailConverseContentBlock.of_jsoninlettext=field_mapjson__"text"NonEmptyString.of_jsoninmake?cachePoint?guardContent?text()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Contains configurations for instructions to provide the model for how to handle input. To learn more, see Using the Converse API."]moduleToolChoice=structtypenonrect={auto:AutoToolChoice.toption[@ocaml.doc"(Default). The Model automatically decides if a tool should be called or whether to generate text instead."];any:AnyToolChoice.toption[@ocaml.doc"The model must request at least one tool (no text is generated)."];tool:SpecificToolChoice.toption[@ocaml.doc"The Model must request the specified tool. Only supported by Anthropic Claude 3 and Amazon Nova models."]}letmake?auto=fun?any->fun?tool->fun()->{auto;any;tool}letto_valuex=structure_to_value[("auto",(Option.mapx.auto~f:AutoToolChoice.to_value));("any",(Option.mapx.any~f:AnyToolChoice.to_value));("tool",(Option.mapx.tool~f:SpecificToolChoice.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lettool=(Option.map~f:SpecificToolChoice.of_xml)(Xml.childxml_arg0"tool")inletany=(Option.map~f:AnyToolChoice.of_xml)(Xml.childxml_arg0"any")inletauto=(Option.map~f:AutoToolChoice.of_xml)(Xml.childxml_arg0"auto")inmake?tool?any?auto()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lettool=field_mapjson__"tool"SpecificToolChoice.of_jsoninletany=field_mapjson__"any"AnyToolChoice.of_jsoninletauto=field_mapjson__"auto"AutoToolChoice.of_jsoninmake?tool?any?auto()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Determines which tools the model should request in a call to Converse or ConverseStream. For more information, see Call a tool with the Converse API in the Amazon Bedrock User Guide."]moduleToolConfigurationToolsList=structtypenonrect=Tool.tlistletmakei=letopenResultinok_or_failwith(check_list_mini~min:1);iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:Tool.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:Tool.of_xml)letof_jsonj=list_of_json~kind:"ToolConfigurationToolsList"~of_json:Tool.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleCitationsDelta=structtypenonrect={title:String_.toption[@ocaml.doc"The title or identifier of the source document being cited."];source:String_.toption[@ocaml.doc"The source from the original search result that provided the cited content."];sourceContent:CitationSourceContentListDelta.toption[@ocaml.doc"The specific content from the source document that was referenced or cited in the generated response."];location:CitationLocation.toption[@ocaml.doc"Specifies the precise location within a source document where cited content can be found. This can include character-level positions, page numbers, or document chunks depending on the document type and indexing method."]}letmake?title=fun?source->fun?sourceContent->fun?location->fun()->{title;source;sourceContent;location}letto_valuex=structure_to_value[("title",(Option.mapx.title~f:String_.to_value));("source",(Option.mapx.source~f:String_.to_value));("sourceContent",(Option.mapx.sourceContent~f:CitationSourceContentListDelta.to_value));("location",(Option.mapx.location~f:CitationLocation.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letlocation=(Option.map~f:CitationLocation.of_xml)(Xml.childxml_arg0"location")inletsourceContent=(Option.map~f:CitationSourceContentListDelta.of_xml)(Xml.childxml_arg0"sourceContent")inletsource=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"source")inlettitle=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"title")inmake?location?sourceContent?source?title()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letlocation=field_mapjson__"location"CitationLocation.of_jsoninletsourceContent=field_mapjson__"sourceContent"CitationSourceContentListDelta.of_jsoninletsource=field_mapjson__"source"String_.of_jsoninlettitle=field_mapjson__"title"String_.of_jsoninmake?location?sourceContent?source?title()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Contains incremental updates to citation information during streaming responses. This allows clients to build up citation data progressively as the response is generated."]moduleImageBlockDelta=structtypenonrect={source:ImageSource.toption[@ocaml.doc"The incremental image source data for this delta event."];error:ErrorBlock.toption[@ocaml.doc"Error information if this image delta could not be processed."]}letmake?source=fun?error->fun()->{source;error}letto_valuex=structure_to_value[("source",(Option.mapx.source~f:ImageSource.to_value));("error",(Option.mapx.error~f:ErrorBlock.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=leterror=(Option.map~f:ErrorBlock.of_xml)(Xml.childxml_arg0"error")inletsource=(Option.map~f:ImageSource.of_xml)(Xml.childxml_arg0"source")inmake?error?source()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=leterror=field_mapjson__"error"ErrorBlock.of_jsoninletsource=field_mapjson__"source"ImageSource.of_jsoninmake?error?source()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A streaming delta event that contains incremental image data during streaming responses."]moduleReasoningContentBlockDelta=structtypenonrect={text:String_.toption[@ocaml.doc"The reasoning that the model used to return the output."];redactedContent:Blob.toption[@ocaml.doc"The content in the reasoning that was encrypted by the model provider for safety reasons. The encryption doesn't affect the quality of responses."];signature:String_.toption[@ocaml.doc"A token that verifies that the reasoning text was generated by the model. If you pass a reasoning block back to the API in a multi-turn conversation, include the text and its signature unmodified."]}letmake?text=fun?redactedContent->fun?signature->fun()->{text;redactedContent;signature}letto_valuex=structure_to_value[("text",(Option.mapx.text~f:String_.to_value));("redactedContent",(Option.mapx.redactedContent~f:Blob.to_value));("signature",(Option.mapx.signature~f:String_.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letsignature=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"signature")inletredactedContent=(Option.map~f:Blob.of_xml)(Xml.childxml_arg0"redactedContent")inlettext=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"text")inmake?signature?redactedContent?text()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letsignature=field_mapjson__"signature"String_.of_jsoninletredactedContent=field_mapjson__"redactedContent"Blob.of_jsoninlettext=field_mapjson__"text"String_.of_jsoninmake?signature?redactedContent?text()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Contains content regarding the reasoning that is carried out by the model with respect to the content in the content block. Reasoning refers to a Chain of Thought (CoT) that the model generates to enhance the accuracy of its final response."]moduleToolResultBlocksDelta=structtypenonrect=ToolResultBlockDelta.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:ToolResultBlockDelta.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:ToolResultBlockDelta.of_xml)letof_jsonj=list_of_json~kind:"ToolResultBlocksDelta"~of_json:ToolResultBlockDelta.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleToolUseBlockDelta=structtypenonrect={input:String_.toption[@ocaml.doc"The input for a requested tool."]}letmake?input=fun()->{input}letto_valuex=structure_to_value[("input",(Option.mapx.input~f:String_.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letinput=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"input")inmake?input()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letinput=field_mapjson__"input"String_.of_jsoninmake?input()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The delta for a tool use block."]moduleImageBlockStart=structtypenonrect={format:ImageFormat.toption[@ocaml.doc"The format of the image data that will be streamed in subsequent delta events."]}letmake?format=fun()->{format}letto_valuex=structure_to_value[("format",(Option.mapx.format~f:ImageFormat.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letformat=(Option.map~f:ImageFormat.of_xml)(Xml.childxml_arg0"format")inmake?format()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letformat=field_mapjson__"format"ImageFormat.of_jsoninmake?format()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The initial event in a streaming image block that indicates the start of image content."]moduleToolResultBlockStart=structtypenonrect={toolUseId:ToolUseId.toption[@ocaml.doc"The ID of the tool that was used to generate this tool result block."];type_:String_.toption[@ocaml.doc"The type for the tool that was used to generate this tool result block."];status:ToolResultStatus.toption[@ocaml.doc"The status of the tool result block."]}letmake?toolUseId=fun?type_->fun?status->fun()->{toolUseId;type_;status}letto_valuex=structure_to_value[("toolUseId",(Option.mapx.toolUseId~f:ToolUseId.to_value));("type",(Option.mapx.type_~f:String_.to_value));("status",(Option.mapx.status~f:ToolResultStatus.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letstatus=(Option.map~f:ToolResultStatus.of_xml)(Xml.childxml_arg0"status")inlettype_=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"type")inlettoolUseId=(Option.map~f:ToolUseId.of_xml)(Xml.childxml_arg0"toolUseId")inmake?status?type_?toolUseId()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letstatus=field_mapjson__"status"ToolResultStatus.of_jsoninlettype_=field_mapjson__"type"String_.of_jsoninlettoolUseId=field_mapjson__"toolUseId"ToolUseId.of_jsoninmake?status?type_?toolUseId()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The start of a tool result block. For more information, see Call a tool with the Converse API in the Amazon Bedrock User Guide."]moduleToolUseBlockStart=structtypenonrect={toolUseId:ToolUseId.toption[@ocaml.doc"The ID for the tool request."];name:ToolName.toption[@ocaml.doc"The name of the tool that the model is requesting to use."];type_:ToolUseType.toption[@ocaml.doc"The type for the tool request."]}letmake?toolUseId=fun?name->fun?type_->fun()->{toolUseId;name;type_}letto_valuex=structure_to_value[("toolUseId",(Option.mapx.toolUseId~f:ToolUseId.to_value));("name",(Option.mapx.name~f:ToolName.to_value));("type",(Option.mapx.type_~f:ToolUseType.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lettype_=(Option.map~f:ToolUseType.of_xml)(Xml.childxml_arg0"type")inletname=(Option.map~f:ToolName.of_xml)(Xml.childxml_arg0"name")inlettoolUseId=(Option.map~f:ToolUseId.of_xml)(Xml.childxml_arg0"toolUseId")inmake?type_?name?toolUseId()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lettype_=field_mapjson__"type"ToolUseType.of_jsoninletname=field_mapjson__"name"ToolName.of_jsoninlettoolUseId=field_mapjson__"toolUseId"ToolUseId.of_jsoninmake?type_?name?toolUseId()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The start of a tool use block. For more information, see Call a tool with the Converse API in the Amazon Bedrock User Guide."]moduleLong=structtypenonrect=Int64.tletmakei=iletof_string=Int64.of_stringletto_valuex=`Longxletto_queryv=to_queryto_valuevletto_headerx=Int64.to_stringxletof_xmlxml_arg0=Int64.of_string(string_of_xml~kind:"a long"xml_arg0)letof_jsonj=Int64.of_float(float_of_json~kind:"a long"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailTraceAssessment=structtypenonrect={modelOutput:ModelOutputs.toption[@ocaml.doc"The output from the model."];inputAssessment:GuardrailAssessmentMap.toption[@ocaml.doc"The input assessment."];outputAssessments:GuardrailAssessmentListMap.toption[@ocaml.doc"the output assessments."];actionReason:String_.toption[@ocaml.doc"Provides the reason for the action taken when harmful content is detected."]}letmake?modelOutput=fun?inputAssessment->fun?outputAssessments->fun?actionReason->fun()->{modelOutput;inputAssessment;outputAssessments;actionReason}letto_valuex=structure_to_value[("modelOutput",(Option.mapx.modelOutput~f:ModelOutputs.to_value));("inputAssessment",(Option.mapx.inputAssessment~f:GuardrailAssessmentMap.to_value));("outputAssessments",(Option.mapx.outputAssessments~f:GuardrailAssessmentListMap.to_value));("actionReason",(Option.mapx.actionReason~f:String_.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letactionReason=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"actionReason")inletoutputAssessments=(Option.map~f:GuardrailAssessmentListMap.of_xml)(Xml.childxml_arg0"outputAssessments")inletinputAssessment=(Option.map~f:GuardrailAssessmentMap.of_xml)(Xml.childxml_arg0"inputAssessment")inletmodelOutput=(Option.map~f:ModelOutputs.of_xml)(Xml.childxml_arg0"modelOutput")inmake?actionReason?outputAssessments?inputAssessment?modelOutput()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letactionReason=field_mapjson__"actionReason"String_.of_jsoninletoutputAssessments=field_mapjson__"outputAssessments"GuardrailAssessmentListMap.of_jsoninletinputAssessment=field_mapjson__"inputAssessment"GuardrailAssessmentMap.of_jsoninletmodelOutput=field_mapjson__"modelOutput"ModelOutputs.of_jsoninmake?actionReason?outputAssessments?inputAssessment?modelOutput()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A Top level guardrail trace object. For more information, see ConverseTrace."]modulePromptRouterTrace=structtypenonrect={invokedModelId:InvokedModelId.toption[@ocaml.doc"The ID of the invoked model."]}letmake?invokedModelId=fun()->{invokedModelId}letto_valuex=structure_to_value[("invokedModelId",(Option.mapx.invokedModelId~f:InvokedModelId.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letinvokedModelId=(Option.map~f:InvokedModelId.of_xml)(Xml.childxml_arg0"invokedModelId")inmake?invokedModelId()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letinvokedModelId=field_mapjson__"invokedModelId"InvokedModelId.of_jsoninmake?invokedModelId()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A prompt router trace."]modulePerformanceConfigLatency=structtypenonrect=|Standard|Optimized|Non_static_idofstringletmakei=iletto_string=function|Standard->"standard"|Optimized->"optimized"|Non_static_ids->sletof_string=function|"standard"->Standard|"optimized"->Optimized|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration PerformanceConfigLatency"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"PerformanceConfigLatency"j)letto_json=simple_to_jsonto_valueendmoduleServiceTierType=structtypenonrect=|Priority|Default|Flex|Reserved|Non_static_idofstringletmakei=iletto_string=function|Priority->"priority"|Default->"default"|Flex->"flex"|Reserved->"reserved"|Non_static_ids->sletof_string=function|"priority"->Priority|"default"->Default|"flex"->Flex|"reserved"->Reserved|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration ServiceTierType"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"ServiceTierType"j)letto_json=simple_to_jsonto_valueendmoduleCacheDetailsList=structtypenonrect=CacheDetail.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:CacheDetail.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:CacheDetail.of_xml)letof_jsonj=list_of_json~kind:"CacheDetailsList"~of_json:CacheDetail.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleTokenUsageCacheReadInputTokensInteger=structtypenonrect=intletmakei=letopenResultinok_or_failwith(check_int_mini~min:0);iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for TokenUsageCacheReadInputTokensInteger"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleTokenUsageCacheWriteInputTokensInteger=structtypenonrect=intletmakei=letopenResultinok_or_failwith(check_int_mini~min:0);iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for TokenUsageCacheWriteInputTokensInteger"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleTokenUsageInputTokensInteger=structtypenonrect=intletmakei=letopenResultinok_or_failwith(check_int_mini~min:0);iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for TokenUsageInputTokensInteger"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleTokenUsageOutputTokensInteger=structtypenonrect=intletmakei=letopenResultinok_or_failwith(check_int_mini~min:0);iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for TokenUsageOutputTokensInteger"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleTokenUsageTotalTokensInteger=structtypenonrect=intletmakei=letopenResultinok_or_failwith(check_int_mini~min:0);iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for TokenUsageTotalTokensInteger"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleJsonSchemaDefinition=structtypenonrect={schema:String_.t[@ocaml.doc"The JSON schema to constrain the model's output. For more information, see JSON Schema Reference."];name:String_.toption[@ocaml.doc"The name of the JSON schema."];description:String_.toption[@ocaml.doc"A description of the JSON schema."]}letcontext_="JsonSchemaDefinition"letmake?name=fun?description->fun~schema->fun()->{name;description;schema}letto_valuex=structure_to_value[("schema",(Some(String_.to_valuex.schema)));("name",(Option.mapx.name~f:String_.to_value));("description",(Option.mapx.description~f:String_.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letdescription=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"description")inletname=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"name")inletschema=String_.of_xml(Xml.child_exn~context:context_xml_arg0"schema")inmake?description?name~schema()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letdescription=field_mapjson__"description"String_.of_jsoninletname=field_mapjson__"name"String_.of_jsoninletschema=field_map_exnjson__"schema"String_.of_jsoninmake?description?name~schema()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"JSON schema structured output format options."]moduleGuardrailImageFormat=structtypenonrect=|Png|Jpeg|Non_static_idofstringletmakei=iletto_string=function|Png->"png"|Jpeg->"jpeg"|Non_static_ids->sletof_string=function|"png"->Png|"jpeg"->Jpeg|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration GuardrailImageFormat"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"GuardrailImageFormat"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailImageSource=structtypenonrect={bytes:GuardrailImageSourceBytesBlob.toption[@ocaml.doc"The bytes details of the guardrail image source. Object used in independent api."]}letmake?bytes=fun()->{bytes}letof_header_and_body=((fun(xs,pipe)->make?bytes:(Somepipe)())[@warning"-27"])letto_valuex=structure_to_value[("bytes",(Option.mapx.bytes~f:GuardrailImageSourceBytesBlob.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letbytes=(Option.map~f:GuardrailImageSourceBytesBlob.of_xml)(Xml.childxml_arg0"bytes")inmake?bytes()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letbytes=field_mapjson__"bytes"GuardrailImageSourceBytesBlob.of_jsoninmake?bytes()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The image source (image bytes) of the guardrail image source. Object used in independent api."]moduleGuardrailContentQualifierList=structtypenonrect=GuardrailContentQualifier.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:GuardrailContentQualifier.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:GuardrailContentQualifier.of_xml)letof_jsonj=list_of_json~kind:"GuardrailContentQualifierList"~of_json:GuardrailContentQualifier.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleTagKey=structtypenonrect=stringletcontext_="TagKey"letmakei=letopenResultinok_or_failwith((check_string_mini~min:1)>>=(fun()->(check_string_maxi~max:128)>>=(fun()->check_patterni~pattern:"[a-zA-Z0-9\\s._:/=+@-]*")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"TagKey"jletto_json=simple_to_jsonto_valueendmoduleTagValue=structtypenonrect=stringletcontext_="TagValue"letmakei=letopenResultinok_or_failwith((check_string_mini~min:0)>>=(fun()->(check_string_maxi~max:256)>>=(fun()->check_patterni~pattern:"[a-zA-Z0-9\\s._:/=+@-]*")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"TagValue"jletto_json=simple_to_jsonto_valueendmoduleAsyncInvokeArn=structtypenonrect=stringletcontext_="AsyncInvokeArn"letmakei=letopenResultinok_or_failwith((check_string_mini~min:1)>>=(fun()->(check_string_maxi~max:2048)>>=(fun()->check_patterni~pattern:"arn:[a-z0-9\\-]+:bedrock:[a-z0-9\\-]*:[0-9]*:(provisioned-model|foundation-model)/.+")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"AsyncInvokeArn"jletto_json=simple_to_jsonto_valueendmoduleAsyncInvokeIdempotencyToken=structtypenonrect=stringletcontext_="AsyncInvokeIdempotencyToken"letmakei=letopenResultinok_or_failwith((check_string_mini~min:1)>>=(fun()->(check_string_maxi~max:256)>>=(fun()->check_patterni~pattern:"[!-~]*")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"AsyncInvokeIdempotencyToken"jletto_json=simple_to_jsonto_valueendmoduleAsyncInvokeMessage=structtypenonrect=stringletcontext_="AsyncInvokeMessage"letmakei=letopenResultinok_or_failwith((check_string_maxi~max:2048)>>=(fun()->check_string_mini~min:0));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"AsyncInvokeMessage"jletto_json=simple_to_jsonto_valueendmoduleAsyncInvokeOutputDataConfig=structtypenonrect={s3OutputDataConfig:AsyncInvokeS3OutputDataConfig.toption[@ocaml.doc"A storage location for the output data in an S3 bucket"]}letmake?s3OutputDataConfig=fun()->{s3OutputDataConfig}letto_valuex=structure_to_value[("s3OutputDataConfig",(Option.mapx.s3OutputDataConfig~f:AsyncInvokeS3OutputDataConfig.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lets3OutputDataConfig=(Option.map~f:AsyncInvokeS3OutputDataConfig.of_xml)(Xml.childxml_arg0"s3OutputDataConfig")inmake?s3OutputDataConfig()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lets3OutputDataConfig=field_mapjson__"s3OutputDataConfig"AsyncInvokeS3OutputDataConfig.of_jsoninmake?s3OutputDataConfig()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Asynchronous invocation output data settings."]moduleAsyncInvokeStatus=structtypenonrect=|InProgress|Completed|Failed|Non_static_idofstringletmakei=iletto_string=function|InProgress->"InProgress"|Completed->"Completed"|Failed->"Failed"|Non_static_ids->sletof_string=function|"InProgress"->InProgress|"Completed"->Completed|"Failed"->Failed|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration AsyncInvokeStatus"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"AsyncInvokeStatus"j)letto_json=simple_to_jsonto_valueendmoduleInvocationArn=structtypenonrect=stringletcontext_="InvocationArn"letmakei=letopenResultinok_or_failwith((check_string_mini~min:1)>>=(fun()->(check_string_maxi~max:2048)>>=(fun()->check_patterni~pattern:"arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:async-invoke/[a-z0-9]{12}")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"InvocationArn"jletto_json=simple_to_jsonto_valueendmoduleTimestamp=structtypenonrect=stringletmakei=iletof_stringx=xletto_valuex=`Timestampxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=string_of_xml~kind:"a timestamp"letof_json=timestamp_of_jsonletto_json=simple_to_jsonto_valueendmoduleNonBlankString=structtypenonrect=stringletcontext_="NonBlankString"letmakei=letopenResultinok_or_failwith(check_patterni~pattern:"[\\s\\S]*");iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"NonBlankString"jletto_json=simple_to_jsonto_valueendmoduleStatusCode=structtypenonrect=intletmakei=letopenResultinok_or_failwith((check_int_maxi~max:599)>>=(fun()->check_int_mini~min:100));iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for StatusCode"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmodulePartBody=structtypenonrect=stringletmakei=iletof_stringx=xletto_valuex=`Blobxletto_queryv=to_queryto_valuevletto_headerx=xletof_xmlxml_arg0=string_of_xml~kind:"a blob"xml_arg0letof_jsonj=string_of_json~kind:"a blob"jletto_json=simple_to_jsonto_valueendmoduleMessages=structtypenonrect=Message.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:Message.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:Message.of_xml)letof_jsonj=list_of_json~kind:"Messages"~of_json:Message.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleSystemContentBlocks=structtypenonrect=SystemContentBlock.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:SystemContentBlock.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:SystemContentBlock.of_xml)letof_jsonj=list_of_json~kind:"SystemContentBlocks"~of_json:SystemContentBlock.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleToolConfiguration=structtypenonrect={tools:ToolConfigurationToolsList.t[@ocaml.doc"An array of tools that you want to pass to a model."];toolChoice:ToolChoice.toption[@ocaml.doc"If supported by model, forces the model to request a tool."]}letcontext_="ToolConfiguration"letmake?toolChoice=fun~tools->fun()->{toolChoice;tools}letto_valuex=structure_to_value[("tools",(Some(ToolConfigurationToolsList.to_valuex.tools)));("toolChoice",(Option.mapx.toolChoice~f:ToolChoice.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lettoolChoice=(Option.map~f:ToolChoice.of_xml)(Xml.childxml_arg0"toolChoice")inlettools=ToolConfigurationToolsList.of_xml(Xml.child_exn~context:context_xml_arg0"tools")inmake?toolChoice~tools()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lettoolChoice=field_mapjson__"toolChoice"ToolChoice.of_jsoninlettools=field_map_exnjson__"tools"ToolConfigurationToolsList.of_jsoninmake?toolChoice~tools()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Configuration information for the tools that you pass to a model. For more information, see Tool use (function calling) in the Amazon Bedrock User Guide."]moduleBody=structtypenonrect=stringletmakei=iletof_stringx=xletto_valuex=`Blobxletto_queryv=to_queryto_valuevletto_headerx=xletof_xmlxml_arg0=string_of_xml~kind:"a blob"xml_arg0letof_jsonj=string_of_json~kind:"a blob"jletto_json=simple_to_jsonto_valueendmoduleContentBlockDelta=structtypenonrect={text:String_.toption[@ocaml.doc"The content text."];toolUse:ToolUseBlockDelta.toption[@ocaml.doc"Information about a tool that the model is requesting to use."];toolResult:ToolResultBlocksDelta.toption[@ocaml.doc"An incremental update that contains the results from a tool call."];reasoningContent:ReasoningContentBlockDelta.toption[@ocaml.doc"Contains content regarding the reasoning that is carried out by the model. Reasoning refers to a Chain of Thought (CoT) that the model generates to enhance the accuracy of its final response."];citation:CitationsDelta.toption[@ocaml.doc"Incremental citation information that is streamed as part of the response generation process."];image:ImageBlockDelta.toption[@ocaml.doc"A streaming delta event containing incremental image data."]}letmake?text=fun?toolUse->fun?toolResult->fun?reasoningContent->fun?citation->fun?image->fun()->{text;toolUse;toolResult;reasoningContent;citation;image}letto_valuex=structure_to_value[("text",(Option.mapx.text~f:String_.to_value));("toolUse",(Option.mapx.toolUse~f:ToolUseBlockDelta.to_value));("toolResult",(Option.mapx.toolResult~f:ToolResultBlocksDelta.to_value));("reasoningContent",(Option.mapx.reasoningContent~f:ReasoningContentBlockDelta.to_value));("citation",(Option.mapx.citation~f:CitationsDelta.to_value));("image",(Option.mapx.image~f:ImageBlockDelta.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letimage=(Option.map~f:ImageBlockDelta.of_xml)(Xml.childxml_arg0"image")inletcitation=(Option.map~f:CitationsDelta.of_xml)(Xml.childxml_arg0"citation")inletreasoningContent=(Option.map~f:ReasoningContentBlockDelta.of_xml)(Xml.childxml_arg0"reasoningContent")inlettoolResult=(Option.map~f:ToolResultBlocksDelta.of_xml)(Xml.childxml_arg0"toolResult")inlettoolUse=(Option.map~f:ToolUseBlockDelta.of_xml)(Xml.childxml_arg0"toolUse")inlettext=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"text")inmake?image?citation?reasoningContent?toolResult?toolUse?text()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letimage=field_mapjson__"image"ImageBlockDelta.of_jsoninletcitation=field_mapjson__"citation"CitationsDelta.of_jsoninletreasoningContent=field_mapjson__"reasoningContent"ReasoningContentBlockDelta.of_jsoninlettoolResult=field_mapjson__"toolResult"ToolResultBlocksDelta.of_jsoninlettoolUse=field_mapjson__"toolUse"ToolUseBlockDelta.of_jsoninlettext=field_mapjson__"text"String_.of_jsoninmake?image?citation?reasoningContent?toolResult?toolUse?text()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A block of content in a streaming response."]moduleNonNegativeInteger=structtypenonrect=intletmakei=letopenResultinok_or_failwith(check_int_mini~min:0);iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for NonNegativeInteger"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleContentBlockStart=structtypenonrect={toolUse:ToolUseBlockStart.toption[@ocaml.doc"Information about a tool that the model is requesting to use."];toolResult:ToolResultBlockStart.toption[@ocaml.doc"The"];image:ImageBlockStart.toption[@ocaml.doc"The initial event indicating the start of a streaming image block."]}letmake?toolUse=fun?toolResult->fun?image->fun()->{toolUse;toolResult;image}letto_valuex=structure_to_value[("toolUse",(Option.mapx.toolUse~f:ToolUseBlockStart.to_value));("toolResult",(Option.mapx.toolResult~f:ToolResultBlockStart.to_value));("image",(Option.mapx.image~f:ImageBlockStart.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letimage=(Option.map~f:ImageBlockStart.of_xml)(Xml.childxml_arg0"image")inlettoolResult=(Option.map~f:ToolResultBlockStart.of_xml)(Xml.childxml_arg0"toolResult")inlettoolUse=(Option.map~f:ToolUseBlockStart.of_xml)(Xml.childxml_arg0"toolUse")inmake?image?toolResult?toolUse()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letimage=field_mapjson__"image"ImageBlockStart.of_jsoninlettoolResult=field_mapjson__"toolResult"ToolResultBlockStart.of_jsoninlettoolUse=field_mapjson__"toolUse"ToolUseBlockStart.of_jsoninmake?image?toolResult?toolUse()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Content block start information."]moduleConverseStreamMetrics=structtypenonrect={latencyMs:Long.toption[@ocaml.doc"The latency for the streaming request, in milliseconds."]}letmake?latencyMs=fun()->{latencyMs}letto_valuex=structure_to_value[("latencyMs",(Option.mapx.latencyMs~f:Long.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letlatencyMs=(Option.map~f:Long.of_xml)(Xml.childxml_arg0"latencyMs")inmake?latencyMs()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letlatencyMs=field_mapjson__"latencyMs"Long.of_jsoninmake?latencyMs()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Metrics for the stream."]moduleConverseStreamTrace=structtypenonrect={guardrail:GuardrailTraceAssessment.toption[@ocaml.doc"The guardrail trace object."];promptRouter:PromptRouterTrace.toption[@ocaml.doc"The request's prompt router."]}letmake?guardrail=fun?promptRouter->fun()->{guardrail;promptRouter}letto_valuex=structure_to_value[("guardrail",(Option.mapx.guardrail~f:GuardrailTraceAssessment.to_value));("promptRouter",(Option.mapx.promptRouter~f:PromptRouterTrace.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letpromptRouter=(Option.map~f:PromptRouterTrace.of_xml)(Xml.childxml_arg0"promptRouter")inletguardrail=(Option.map~f:GuardrailTraceAssessment.of_xml)(Xml.childxml_arg0"guardrail")inmake?promptRouter?guardrail()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letpromptRouter=field_mapjson__"promptRouter"PromptRouterTrace.of_jsoninletguardrail=field_mapjson__"guardrail"GuardrailTraceAssessment.of_jsoninmake?promptRouter?guardrail()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The trace object in a response from ConverseStream."]modulePerformanceConfiguration=structtypenonrect={latency:PerformanceConfigLatency.toption[@ocaml.doc"To use a latency-optimized version of the model, set to optimized."]}letmake?latency=fun()->{latency}letto_valuex=structure_to_value[("latency",(Option.mapx.latency~f:PerformanceConfigLatency.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letlatency=(Option.map~f:PerformanceConfigLatency.of_xml)(Xml.childxml_arg0"latency")inmake?latency()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letlatency=field_mapjson__"latency"PerformanceConfigLatency.of_jsoninmake?latency()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Performance settings for a model."]moduleServiceTier=structtypenonrect={type_:ServiceTierType.t[@ocaml.doc"Specifies the processing tier type used for serving the request."]}letcontext_="ServiceTier"letmake~type_=fun()->{type_}letto_valuex=structure_to_value[("type",(Some(ServiceTierType.to_valuex.type_)))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lettype_=ServiceTierType.of_xml(Xml.child_exn~context:context_xml_arg0"type")inmake~type_()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lettype_=field_map_exnjson__"type"ServiceTierType.of_jsoninmake~type_()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Specifies the processing tier configuration used for serving the request."]moduleTokenUsage=structtypenonrect={inputTokens:TokenUsageInputTokensInteger.toption[@ocaml.doc"The number of tokens sent in the request to the model."];outputTokens:TokenUsageOutputTokensInteger.toption[@ocaml.doc"The number of tokens that the model generated for the request."];totalTokens:TokenUsageTotalTokensInteger.toption[@ocaml.doc"The total of input tokens and tokens generated by the model."];cacheReadInputTokens:TokenUsageCacheReadInputTokensInteger.toption[@ocaml.doc"The number of input tokens read from the cache for the request."];cacheWriteInputTokens:TokenUsageCacheWriteInputTokensInteger.toption[@ocaml.doc"The number of input tokens written to the cache for the request."];cacheDetails:CacheDetailsList.toption[@ocaml.doc"Detailed breakdown of cache writes by TTL. Empty if no cache creation occurred. Sorted by TTL duration (1h before 5m)."]}letmake?inputTokens=fun?outputTokens->fun?totalTokens->fun?cacheReadInputTokens->fun?cacheWriteInputTokens->fun?cacheDetails->fun()->{inputTokens;outputTokens;totalTokens;cacheReadInputTokens;cacheWriteInputTokens;cacheDetails}letto_valuex=structure_to_value[("inputTokens",(Option.mapx.inputTokens~f:TokenUsageInputTokensInteger.to_value));("outputTokens",(Option.mapx.outputTokens~f:TokenUsageOutputTokensInteger.to_value));("totalTokens",(Option.mapx.totalTokens~f:TokenUsageTotalTokensInteger.to_value));("cacheReadInputTokens",(Option.mapx.cacheReadInputTokens~f:TokenUsageCacheReadInputTokensInteger.to_value));("cacheWriteInputTokens",(Option.mapx.cacheWriteInputTokens~f:TokenUsageCacheWriteInputTokensInteger.to_value));("cacheDetails",(Option.mapx.cacheDetails~f:CacheDetailsList.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letcacheDetails=(Option.map~f:CacheDetailsList.of_xml)(Xml.childxml_arg0"cacheDetails")inletcacheWriteInputTokens=(Option.map~f:TokenUsageCacheWriteInputTokensInteger.of_xml)(Xml.childxml_arg0"cacheWriteInputTokens")inletcacheReadInputTokens=(Option.map~f:TokenUsageCacheReadInputTokensInteger.of_xml)(Xml.childxml_arg0"cacheReadInputTokens")inlettotalTokens=(Option.map~f:TokenUsageTotalTokensInteger.of_xml)(Xml.childxml_arg0"totalTokens")inletoutputTokens=(Option.map~f:TokenUsageOutputTokensInteger.of_xml)(Xml.childxml_arg0"outputTokens")inletinputTokens=(Option.map~f:TokenUsageInputTokensInteger.of_xml)(Xml.childxml_arg0"inputTokens")inmake?cacheDetails?cacheWriteInputTokens?cacheReadInputTokens?totalTokens?outputTokens?inputTokens()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letcacheDetails=field_mapjson__"cacheDetails"CacheDetailsList.of_jsoninletcacheWriteInputTokens=field_mapjson__"cacheWriteInputTokens"TokenUsageCacheWriteInputTokensInteger.of_jsoninletcacheReadInputTokens=field_mapjson__"cacheReadInputTokens"TokenUsageCacheReadInputTokensInteger.of_jsoninlettotalTokens=field_mapjson__"totalTokens"TokenUsageTotalTokensInteger.of_jsoninletoutputTokens=field_mapjson__"outputTokens"TokenUsageOutputTokensInteger.of_jsoninletinputTokens=field_mapjson__"inputTokens"TokenUsageInputTokensInteger.of_jsoninmake?cacheDetails?cacheWriteInputTokens?cacheReadInputTokens?totalTokens?outputTokens?inputTokens()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The tokens used in a message API inference call."]moduleStopReason=structtypenonrect=|End_turn|Tool_use|Max_tokens|Stop_sequence|Guardrail_intervened|Content_filtered|Malformed_model_output|Malformed_tool_use|Model_context_window_exceeded|Non_static_idofstringletmakei=iletto_string=function|End_turn->"end_turn"|Tool_use->"tool_use"|Max_tokens->"max_tokens"|Stop_sequence->"stop_sequence"|Guardrail_intervened->"guardrail_intervened"|Content_filtered->"content_filtered"|Malformed_model_output->"malformed_model_output"|Malformed_tool_use->"malformed_tool_use"|Model_context_window_exceeded->"model_context_window_exceeded"|Non_static_ids->sletof_string=function|"end_turn"->End_turn|"tool_use"->Tool_use|"max_tokens"->Max_tokens|"stop_sequence"->Stop_sequence|"guardrail_intervened"->Guardrail_intervened|"content_filtered"->Content_filtered|"malformed_model_output"->Malformed_model_output|"malformed_tool_use"->Malformed_tool_use|"model_context_window_exceeded"->Model_context_window_exceeded|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration StopReason"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"StopReason"j)letto_json=simple_to_jsonto_valueendmoduleOutputFormatStructure=structtypenonrect={jsonSchema:JsonSchemaDefinition.toption[@ocaml.doc"A JSON schema structure that the model's output must adhere to."]}letmake?jsonSchema=fun()->{jsonSchema}letto_valuex=structure_to_value[("jsonSchema",(Option.mapx.jsonSchema~f:JsonSchemaDefinition.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letjsonSchema=(Option.map~f:JsonSchemaDefinition.of_xml)(Xml.childxml_arg0"jsonSchema")inmake?jsonSchema()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letjsonSchema=field_mapjson__"jsonSchema"JsonSchemaDefinition.of_jsoninmake?jsonSchema()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The structure that the model's output must adhere to."]moduleOutputFormatType=structtypenonrect=|Json_schema|Non_static_idofstringletmakei=iletto_string=function|Json_schema->"json_schema"|Non_static_ids->sletof_string=function|"json_schema"->Json_schema|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration OutputFormatType"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"OutputFormatType"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailImageBlock=structtypenonrect={format:GuardrailImageFormat.t[@ocaml.doc"The format details for the file type of the image blocked by the guardrail."];source:GuardrailImageSource.t[@ocaml.doc"The image source (image bytes) details of the image blocked by the guardrail."]}letcontext_="GuardrailImageBlock"letmake~format=fun~source->fun()->{format;source}letto_valuex=structure_to_value[("format",(Some(GuardrailImageFormat.to_valuex.format)));("source",(Some(GuardrailImageSource.to_valuex.source)))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letsource=GuardrailImageSource.of_xml(Xml.child_exn~context:context_xml_arg0"source")inletformat=GuardrailImageFormat.of_xml(Xml.child_exn~context:context_xml_arg0"format")inmake~source~format()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letsource=field_map_exnjson__"source"GuardrailImageSource.of_jsoninletformat=field_map_exnjson__"format"GuardrailImageFormat.of_jsoninmake~source~format()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Contain an image which user wants guarded. This block is accepted by the guardrails independent API."]moduleGuardrailTextBlock=structtypenonrect={text:String_.t[@ocaml.doc"The input text details to be evaluated by the guardrail."];qualifiers:GuardrailContentQualifierList.toption[@ocaml.doc"The qualifiers describing the text block."]}letcontext_="GuardrailTextBlock"letmake?qualifiers=fun~text->fun()->{qualifiers;text}letto_valuex=structure_to_value[("text",(Some(String_.to_valuex.text)));("qualifiers",(Option.mapx.qualifiers~f:GuardrailContentQualifierList.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letqualifiers=(Option.map~f:GuardrailContentQualifierList.of_xml)(Xml.childxml_arg0"qualifiers")inlettext=String_.of_xml(Xml.child_exn~context:context_xml_arg0"text")inmake?qualifiers~text()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letqualifiers=field_mapjson__"qualifiers"GuardrailContentQualifierList.of_jsoninlettext=field_map_exnjson__"text"String_.of_jsoninmake?qualifiers~text()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The text block to be evaluated by the guardrail."]moduleTag=structtypenonrect={key:TagKey.t[@ocaml.doc"The tag's key."];value:TagValue.t[@ocaml.doc"The tag's value."]}letcontext_="Tag"letmake~key=fun~value->fun()->{key;value}letto_valuex=structure_to_value[("key",(Some(TagKey.to_valuex.key)));("value",(Some(TagValue.to_valuex.value)))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letvalue=TagValue.of_xml(Xml.child_exn~context:context_xml_arg0"value")inletkey=TagKey.of_xml(Xml.child_exn~context:context_xml_arg0"key")inmake~value~key()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letvalue=field_map_exnjson__"value"TagValue.of_jsoninletkey=field_map_exnjson__"key"TagKey.of_jsoninmake~value~key()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A tag."]moduleAsyncInvokeSummary=structtypenonrect={invocationArn:InvocationArn.toption[@ocaml.doc"The invocation's ARN."];modelArn:AsyncInvokeArn.toption[@ocaml.doc"The invoked model's ARN."];clientRequestToken:AsyncInvokeIdempotencyToken.toption[@ocaml.doc"The invocation's idempotency token."];status:AsyncInvokeStatus.toption[@ocaml.doc"The invocation's status."];failureMessage:AsyncInvokeMessage.toption[@ocaml.doc"An error message."];submitTime:Timestamp.toption[@ocaml.doc"When the invocation was submitted."];lastModifiedTime:Timestamp.toption[@ocaml.doc"When the invocation was last modified."];endTime:Timestamp.toption[@ocaml.doc"When the invocation ended."];outputDataConfig:AsyncInvokeOutputDataConfig.toption[@ocaml.doc"The invocation's output data settings."]}letmake?invocationArn=fun?modelArn->fun?clientRequestToken->fun?status->fun?failureMessage->fun?submitTime->fun?lastModifiedTime->fun?endTime->fun?outputDataConfig->fun()->{invocationArn;modelArn;clientRequestToken;status;failureMessage;submitTime;lastModifiedTime;endTime;outputDataConfig}letto_valuex=structure_to_value[("invocationArn",(Option.mapx.invocationArn~f:InvocationArn.to_value));("modelArn",(Option.mapx.modelArn~f:AsyncInvokeArn.to_value));("clientRequestToken",(Option.mapx.clientRequestToken~f:AsyncInvokeIdempotencyToken.to_value));("status",(Option.mapx.status~f:AsyncInvokeStatus.to_value));("failureMessage",(Option.mapx.failureMessage~f:AsyncInvokeMessage.to_value));("submitTime",(Option.mapx.submitTime~f:Timestamp.to_value));("lastModifiedTime",(Option.mapx.lastModifiedTime~f:Timestamp.to_value));("endTime",(Option.mapx.endTime~f:Timestamp.to_value));("outputDataConfig",(Option.mapx.outputDataConfig~f:AsyncInvokeOutputDataConfig.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letoutputDataConfig=(Option.map~f:AsyncInvokeOutputDataConfig.of_xml)(Xml.childxml_arg0"outputDataConfig")inletendTime=(Option.map~f:Timestamp.of_xml)(Xml.childxml_arg0"endTime")inletlastModifiedTime=(Option.map~f:Timestamp.of_xml)(Xml.childxml_arg0"lastModifiedTime")inletsubmitTime=(Option.map~f:Timestamp.of_xml)(Xml.childxml_arg0"submitTime")inletfailureMessage=(Option.map~f:AsyncInvokeMessage.of_xml)(Xml.childxml_arg0"failureMessage")inletstatus=(Option.map~f:AsyncInvokeStatus.of_xml)(Xml.childxml_arg0"status")inletclientRequestToken=(Option.map~f:AsyncInvokeIdempotencyToken.of_xml)(Xml.childxml_arg0"clientRequestToken")inletmodelArn=(Option.map~f:AsyncInvokeArn.of_xml)(Xml.childxml_arg0"modelArn")inletinvocationArn=(Option.map~f:InvocationArn.of_xml)(Xml.childxml_arg0"invocationArn")inmake?outputDataConfig?endTime?lastModifiedTime?submitTime?failureMessage?status?clientRequestToken?modelArn?invocationArn()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letoutputDataConfig=field_mapjson__"outputDataConfig"AsyncInvokeOutputDataConfig.of_jsoninletendTime=field_mapjson__"endTime"Timestamp.of_jsoninletlastModifiedTime=field_mapjson__"lastModifiedTime"Timestamp.of_jsoninletsubmitTime=field_mapjson__"submitTime"Timestamp.of_jsoninletfailureMessage=field_mapjson__"failureMessage"AsyncInvokeMessage.of_jsoninletstatus=field_mapjson__"status"AsyncInvokeStatus.of_jsoninletclientRequestToken=field_mapjson__"clientRequestToken"AsyncInvokeIdempotencyToken.of_jsoninletmodelArn=field_mapjson__"modelArn"AsyncInvokeArn.of_jsoninletinvocationArn=field_mapjson__"invocationArn"InvocationArn.of_jsoninmake?outputDataConfig?endTime?lastModifiedTime?submitTime?failureMessage?status?clientRequestToken?modelArn?invocationArn()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A summary of an asynchronous invocation."]moduleInternalServerException=structtypenonrect={message:NonBlankString.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:NonBlankString.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:NonBlankString.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"NonBlankString.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"An internal server error occurred. For troubleshooting this error, see InternalFailure in the Amazon Bedrock User Guide"]moduleModelStreamErrorException=structtypenonrect={message:NonBlankString.toption;originalStatusCode:StatusCode.toption[@ocaml.doc"The original status code."];originalMessage:NonBlankString.toption[@ocaml.doc"The original message."]}letmake?message=fun?originalStatusCode->fun?originalMessage->fun()->{message;originalStatusCode;originalMessage}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:NonBlankString.to_value));("originalStatusCode",(Option.mapx.originalStatusCode~f:StatusCode.to_value));("originalMessage",(Option.mapx.originalMessage~f:NonBlankString.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letoriginalMessage=(Option.map~f:NonBlankString.of_xml)(Xml.childxml_arg0"originalMessage")inletoriginalStatusCode=(Option.map~f:StatusCode.of_xml)(Xml.childxml_arg0"originalStatusCode")inletmessage=(Option.map~f:NonBlankString.of_xml)(Xml.childxml_arg0"message")inmake?originalMessage?originalStatusCode?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letoriginalMessage=field_mapjson__"originalMessage"NonBlankString.of_jsoninletoriginalStatusCode=field_mapjson__"originalStatusCode"StatusCode.of_jsoninletmessage=field_mapjson__"message"NonBlankString.of_jsoninmake?originalMessage?originalStatusCode?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"An error occurred while streaming the response. Retry your request."]moduleModelTimeoutException=structtypenonrect={message:NonBlankString.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:NonBlankString.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:NonBlankString.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"NonBlankString.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The request took too long to process. Processing time exceeded the model timeout length."]modulePayloadPart=structtypenonrect={bytes:PartBody.toption[@ocaml.doc"Base64-encoded bytes of payload data."]}letmake?bytes=fun()->{bytes}letof_header_and_body=((fun(xs,pipe)->make?bytes:(Somepipe)())[@warning"-27"])letto_valuex=structure_to_value[("bytes",(Option.mapx.bytes~f:PartBody.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letbytes=(Option.map~f:PartBody.of_xml)(Xml.childxml_arg0"bytes")inmake?bytes()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letbytes=field_mapjson__"bytes"PartBody.of_jsoninmake?bytes()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Payload content included in the response."]moduleServiceUnavailableException=structtypenonrect={message:NonBlankString.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:NonBlankString.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:NonBlankString.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"NonBlankString.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The service isn't currently available. For troubleshooting this error, see ServiceUnavailable in the Amazon Bedrock User Guide"]moduleThrottlingException=structtypenonrect={message:NonBlankString.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:NonBlankString.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:NonBlankString.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"NonBlankString.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Your request was denied due to exceeding the account quotas for Amazon Bedrock. For troubleshooting this error, see ThrottlingException in the Amazon Bedrock User Guide"]moduleValidationException=structtypenonrect={message:NonBlankString.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:NonBlankString.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:NonBlankString.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"NonBlankString.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The input fails to satisfy the constraints specified by Amazon Bedrock. For troubleshooting this error, see ValidationError in the Amazon Bedrock User Guide"]moduleBidirectionalOutputPayloadPart=structtypenonrect={bytes:PartBody.toption[@ocaml.doc"The speech output of the bidirectional stream."]}letmake?bytes=fun()->{bytes}letof_header_and_body=((fun(xs,pipe)->make?bytes:(Somepipe)())[@warning"-27"])letto_valuex=structure_to_value[("bytes",(Option.mapx.bytes~f:PartBody.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letbytes=(Option.map~f:PartBody.of_xml)(Xml.childxml_arg0"bytes")inmake?bytes()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letbytes=field_mapjson__"bytes"PartBody.of_jsoninmake?bytes()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Output from the bidirectional stream. The output is speech and a text transcription."]moduleBidirectionalInputPayloadPart=structtypenonrect={bytes:PartBody.toption[@ocaml.doc"The audio content for the bidirectional input."]}letmake?bytes=fun()->{bytes}letof_header_and_body=((fun(xs,pipe)->make?bytes:(Somepipe)())[@warning"-27"])letto_valuex=structure_to_value[("bytes",(Option.mapx.bytes~f:PartBody.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letbytes=(Option.map~f:PartBody.of_xml)(Xml.childxml_arg0"bytes")inmake?bytes()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letbytes=field_mapjson__"bytes"PartBody.of_jsoninmake?bytes()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Payload content for the bidirectional input. The input is an audio stream."]moduleConverseTokensRequest=structtypenonrect={messages:Messages.toption[@ocaml.doc"An array of messages to count tokens for."];system:SystemContentBlocks.toption[@ocaml.doc"The system content blocks to count tokens for. System content provides instructions or context to the model about how it should behave or respond. The token count will include any system content provided."];toolConfig:ToolConfiguration.toption[@ocaml.doc"The toolConfig of Converse input request to count tokens for. Configuration information for the tools that the model can use when generating a response."];additionalModelRequestFields:Document.toption[@ocaml.doc"The additionalModelRequestFields of Converse input request to count tokens for. Use this field when you want to pass additional parameters that the model supports."]}letmake?messages=fun?system->fun?toolConfig->fun?additionalModelRequestFields->fun()->{messages;system;toolConfig;additionalModelRequestFields}letto_valuex=structure_to_value[("messages",(Option.mapx.messages~f:Messages.to_value));("system",(Option.mapx.system~f:SystemContentBlocks.to_value));("toolConfig",(Option.mapx.toolConfig~f:ToolConfiguration.to_value));("additionalModelRequestFields",(Option.mapx.additionalModelRequestFields~f:Document.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letadditionalModelRequestFields=(Option.map~f:Document.of_xml)(Xml.childxml_arg0"additionalModelRequestFields")inlettoolConfig=(Option.map~f:ToolConfiguration.of_xml)(Xml.childxml_arg0"toolConfig")inletsystem=(Option.map~f:SystemContentBlocks.of_xml)(Xml.childxml_arg0"system")inletmessages=(Option.map~f:Messages.of_xml)(Xml.childxml_arg0"messages")inmake?additionalModelRequestFields?toolConfig?system?messages()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letadditionalModelRequestFields=field_mapjson__"additionalModelRequestFields"Document.of_jsoninlettoolConfig=field_mapjson__"toolConfig"ToolConfiguration.of_jsoninletsystem=field_mapjson__"system"SystemContentBlocks.of_jsoninletmessages=field_mapjson__"messages"Messages.of_jsoninmake?additionalModelRequestFields?toolConfig?system?messages()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The inputs from a Converse API request for token counting. This structure mirrors the input format for the Converse operation, allowing you to count tokens for conversation-based inference requests."]moduleInvokeModelTokensRequest=structtypenonrect={body:Body.t[@ocaml.doc"The request body to count tokens for, formatted according to the model's expected input format. To learn about the input format for different models, see Model inference parameters and responses."]}letcontext_="InvokeModelTokensRequest"letmake~body=fun()->{body}letof_header_and_body=((fun(xs,pipe)->make~body:pipe())[@warning"-27"])letto_valuex=structure_to_value[("body",(Some(Body.to_valuex.body)))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letbody=Body.of_xml(Xml.child_exn~context:context_xml_arg0"body")inmake~body()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letbody=field_map_exnjson__"body"Body.of_jsoninmake~body()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The body of an InvokeModel API request for token counting. This structure mirrors the input format for the InvokeModel operation, allowing you to count tokens for raw text inference requests."]moduleContentBlockDeltaEvent=structtypenonrect={delta:ContentBlockDelta.toption[@ocaml.doc"The delta for a content block delta event."];contentBlockIndex:NonNegativeInteger.toption[@ocaml.doc"The block index for a content block delta event."]}letmake?delta=fun?contentBlockIndex->fun()->{delta;contentBlockIndex}letto_valuex=structure_to_value[("delta",(Option.mapx.delta~f:ContentBlockDelta.to_value));("contentBlockIndex",(Option.mapx.contentBlockIndex~f:NonNegativeInteger.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letcontentBlockIndex=(Option.map~f:NonNegativeInteger.of_xml)(Xml.childxml_arg0"contentBlockIndex")inletdelta=(Option.map~f:ContentBlockDelta.of_xml)(Xml.childxml_arg0"delta")inmake?contentBlockIndex?delta()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letcontentBlockIndex=field_mapjson__"contentBlockIndex"NonNegativeInteger.of_jsoninletdelta=field_mapjson__"delta"ContentBlockDelta.of_jsoninmake?contentBlockIndex?delta()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The content block delta event."]moduleContentBlockStartEvent=structtypenonrect={start:ContentBlockStart.toption[@ocaml.doc"Start information about a content block start event."];contentBlockIndex:NonNegativeInteger.toption[@ocaml.doc"The index for a content block start event."]}letmake?start=fun?contentBlockIndex->fun()->{start;contentBlockIndex}letto_valuex=structure_to_value[("start",(Option.mapx.start~f:ContentBlockStart.to_value));("contentBlockIndex",(Option.mapx.contentBlockIndex~f:NonNegativeInteger.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letcontentBlockIndex=(Option.map~f:NonNegativeInteger.of_xml)(Xml.childxml_arg0"contentBlockIndex")inletstart=(Option.map~f:ContentBlockStart.of_xml)(Xml.childxml_arg0"start")inmake?contentBlockIndex?start()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letcontentBlockIndex=field_mapjson__"contentBlockIndex"NonNegativeInteger.of_jsoninletstart=field_mapjson__"start"ContentBlockStart.of_jsoninmake?contentBlockIndex?start()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Content block start event."]moduleContentBlockStopEvent=structtypenonrect={contentBlockIndex:NonNegativeInteger.toption[@ocaml.doc"The index for a content block."]}letmake?contentBlockIndex=fun()->{contentBlockIndex}letto_valuex=structure_to_value[("contentBlockIndex",(Option.mapx.contentBlockIndex~f:NonNegativeInteger.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letcontentBlockIndex=(Option.map~f:NonNegativeInteger.of_xml)(Xml.childxml_arg0"contentBlockIndex")inmake?contentBlockIndex()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letcontentBlockIndex=field_mapjson__"contentBlockIndex"NonNegativeInteger.of_jsoninmake?contentBlockIndex()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A content block stop event."]moduleConverseStreamMetadataEvent=structtypenonrect={usage:TokenUsage.toption[@ocaml.doc"Usage information for the conversation stream event."];metrics:ConverseStreamMetrics.toption[@ocaml.doc"The metrics for the conversation stream metadata event."];trace:ConverseStreamTrace.toption[@ocaml.doc"The trace object in the response from ConverseStream that contains information about the guardrail behavior."];performanceConfig:PerformanceConfiguration.toption[@ocaml.doc"Model performance configuration metadata for the conversation stream event."];serviceTier:ServiceTier.toption[@ocaml.doc"Specifies the processing tier configuration used for serving the request."]}letmake?usage=fun?metrics->fun?trace->fun?performanceConfig->fun?serviceTier->fun()->{usage;metrics;trace;performanceConfig;serviceTier}letto_valuex=structure_to_value[("usage",(Option.mapx.usage~f:TokenUsage.to_value));("metrics",(Option.mapx.metrics~f:ConverseStreamMetrics.to_value));("trace",(Option.mapx.trace~f:ConverseStreamTrace.to_value));("performanceConfig",(Option.mapx.performanceConfig~f:PerformanceConfiguration.to_value));("serviceTier",(Option.mapx.serviceTier~f:ServiceTier.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letserviceTier=(Option.map~f:ServiceTier.of_xml)(Xml.childxml_arg0"serviceTier")inletperformanceConfig=(Option.map~f:PerformanceConfiguration.of_xml)(Xml.childxml_arg0"performanceConfig")inlettrace=(Option.map~f:ConverseStreamTrace.of_xml)(Xml.childxml_arg0"trace")inletmetrics=(Option.map~f:ConverseStreamMetrics.of_xml)(Xml.childxml_arg0"metrics")inletusage=(Option.map~f:TokenUsage.of_xml)(Xml.childxml_arg0"usage")inmake?serviceTier?performanceConfig?trace?metrics?usage()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letserviceTier=field_mapjson__"serviceTier"ServiceTier.of_jsoninletperformanceConfig=field_mapjson__"performanceConfig"PerformanceConfiguration.of_jsoninlettrace=field_mapjson__"trace"ConverseStreamTrace.of_jsoninletmetrics=field_mapjson__"metrics"ConverseStreamMetrics.of_jsoninletusage=field_mapjson__"usage"TokenUsage.of_jsoninmake?serviceTier?performanceConfig?trace?metrics?usage()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A conversation stream metadata event."]moduleMessageStartEvent=structtypenonrect={role:ConversationRole.toption[@ocaml.doc"The role for the message."]}letmake?role=fun()->{role}letto_valuex=structure_to_value[("role",(Option.mapx.role~f:ConversationRole.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letrole=(Option.map~f:ConversationRole.of_xml)(Xml.childxml_arg0"role")inmake?role()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letrole=field_mapjson__"role"ConversationRole.of_jsoninmake?role()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The start of a message."]moduleMessageStopEvent=structtypenonrect={stopReason:StopReason.toption[@ocaml.doc"The reason why the model stopped generating output."];additionalModelResponseFields:Document.toption[@ocaml.doc"The additional model response fields."]}letmake?stopReason=fun?additionalModelResponseFields->fun()->{stopReason;additionalModelResponseFields}letto_valuex=structure_to_value[("stopReason",(Option.mapx.stopReason~f:StopReason.to_value));("additionalModelResponseFields",(Option.mapx.additionalModelResponseFields~f:Document.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letadditionalModelResponseFields=(Option.map~f:Document.of_xml)(Xml.childxml_arg0"additionalModelResponseFields")inletstopReason=(Option.map~f:StopReason.of_xml)(Xml.childxml_arg0"stopReason")inmake?additionalModelResponseFields?stopReason()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letadditionalModelResponseFields=field_mapjson__"additionalModelResponseFields"Document.of_jsoninletstopReason=field_mapjson__"stopReason"StopReason.of_jsoninmake?additionalModelResponseFields?stopReason()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The stop event for a message."]moduleConverseStreamRequestAdditionalModelResponseFieldPathsListMemberString=structtypenonrect=stringletcontext_="ConverseStreamRequestAdditionalModelResponseFieldPathsListMemberString"letmakei=letopenResultinok_or_failwith((check_string_maxi~max:256)>>=(fun()->check_string_mini~min:1));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"ConverseStreamRequestAdditionalModelResponseFieldPathsListMemberString"jletto_json=simple_to_jsonto_valueendmoduleGuardrailIdentifier=structtypenonrect=stringletcontext_="GuardrailIdentifier"letmakei=letopenResultinok_or_failwith((check_string_mini~min:0)>>=(fun()->(check_string_maxi~max:2048)>>=(fun()->check_patterni~pattern:"(|([a-z0-9]+)|(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:guardrail/[a-z0-9]+))")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"GuardrailIdentifier"jletto_json=simple_to_jsonto_valueendmoduleGuardrailStreamProcessingMode=structtypenonrect=|Sync|Async|Non_static_idofstringletmakei=iletto_string=function|Sync->"sync"|Async->"async"|Non_static_ids->sletof_string=function|"sync"->Sync|"async"->Async|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration GuardrailStreamProcessingMode"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"GuardrailStreamProcessingMode"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailTrace=structtypenonrect=|Enabled|Disabled|Enabled_full|Non_static_idofstringletmakei=iletto_string=function|Enabled->"enabled"|Disabled->"disabled"|Enabled_full->"enabled_full"|Non_static_ids->sletof_string=function|"enabled"->Enabled|"disabled"->Disabled|"enabled_full"->Enabled_full|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration GuardrailTrace"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"GuardrailTrace"j)letto_json=simple_to_jsonto_valueendmoduleInferenceConfigurationMaxTokensInteger=structtypenonrect=intletmakei=letopenResultinok_or_failwith(check_int_mini~min:1);iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for InferenceConfigurationMaxTokensInteger"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleInferenceConfigurationStopSequencesList=structtypenonrect=NonEmptyString.tlistletmakei=letopenResultinok_or_failwith((check_list_maxi~max:2500)>>=(fun()->check_list_mini~min:0));iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:NonEmptyString.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:NonEmptyString.of_xml)letof_jsonj=list_of_json~kind:"InferenceConfigurationStopSequencesList"~of_json:NonEmptyString.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleInferenceConfigurationTemperatureFloat=structtypenonrect=floatletmakei=letopenResultinok_or_failwith((check_float_mini~min:1.)>>=(fun()->check_float_mini~min:0.));iletof_string=Float.of_stringletto_valuex=`Floatxletto_queryv=to_queryto_valuevletto_headerx=Stdlib.Float.to_stringxletof_xmlxml_arg0=Float.of_string(string_of_xml~kind:"a float"xml_arg0)letof_jsonj=float_of_json~kind:"a float"jletto_json=simple_to_jsonto_valueendmoduleInferenceConfigurationTopPFloat=structtypenonrect=floatletmakei=letopenResultinok_or_failwith((check_float_mini~min:1.)>>=(fun()->check_float_mini~min:0.));iletof_string=Float.of_stringletto_valuex=`Floatxletto_queryv=to_queryto_valuevletto_headerx=Stdlib.Float.to_stringxletof_xmlxml_arg0=Float.of_string(string_of_xml~kind:"a float"xml_arg0)letof_jsonj=float_of_json~kind:"a float"jletto_json=simple_to_jsonto_valueendmoduleOutputFormat=structtypenonrect={type_:OutputFormatType.t[@ocaml.doc"The type of structured output format."];structure:OutputFormatStructure.t[@ocaml.doc"The structure that the model's output must adhere to."]}letcontext_="OutputFormat"letmake~type_=fun~structure->fun()->{type_;structure}letto_valuex=structure_to_value[("type",(Some(OutputFormatType.to_valuex.type_)));("structure",(Some(OutputFormatStructure.to_valuex.structure)))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letstructure=OutputFormatStructure.of_xml(Xml.child_exn~context:context_xml_arg0"structure")inlettype_=OutputFormatType.of_xml(Xml.child_exn~context:context_xml_arg0"type")inmake~structure~type_()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letstructure=field_map_exnjson__"structure"OutputFormatStructure.of_jsoninlettype_=field_map_exnjson__"type"OutputFormatType.of_jsoninmake~structure~type_()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Structured output parameters to control the model's response."]modulePromptVariableValues=structtypenonrect={text:String_.toption[@ocaml.doc"The text value that the variable maps to."]}letmake?text=fun()->{text}letto_valuex=structure_to_value[("text",(Option.mapx.text~f:String_.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lettext=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"text")inmake?text()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lettext=field_mapjson__"text"String_.of_jsoninmake?text()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Contains a map of variables in a prompt from Prompt management to an object containing the values to fill in for them when running model invocation. For more information, see How Prompt management works."]moduleRequestMetadataKeyString=structtypenonrect=stringletcontext_="RequestMetadataKeyString"letmakei=letopenResultinok_or_failwith((check_string_mini~min:1)>>=(fun()->(check_string_maxi~max:256)>>=(fun()->check_patterni~pattern:"[a-zA-Z0-9\\s:_@$#=/+,-.]{1,256}")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"RequestMetadataKeyString"jletto_json=simple_to_jsonto_valueendmoduleRequestMetadataValueString=structtypenonrect=stringletcontext_="RequestMetadataValueString"letmakei=letopenResultinok_or_failwith((check_string_mini~min:0)>>=(fun()->(check_string_maxi~max:256)>>=(fun()->check_patterni~pattern:"[a-zA-Z0-9\\s:_@$#=/+,-.]{0,256}")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"RequestMetadataValueString"jletto_json=simple_to_jsonto_valueendmoduleConverseRequestAdditionalModelResponseFieldPathsListMemberString=structtypenonrect=stringletcontext_="ConverseRequestAdditionalModelResponseFieldPathsListMemberString"letmakei=letopenResultinok_or_failwith((check_string_maxi~max:256)>>=(fun()->check_string_mini~min:1));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"ConverseRequestAdditionalModelResponseFieldPathsListMemberString"jletto_json=simple_to_jsonto_valueendmoduleGuardrailOutputContent=structtypenonrect={text:GuardrailOutputText.toption[@ocaml.doc"The specific text for the output content produced by the guardrail."]}letmake?text=fun()->{text}letto_valuex=structure_to_value[("text",(Option.mapx.text~f:GuardrailOutputText.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lettext=(Option.map~f:GuardrailOutputText.of_xml)(Xml.childxml_arg0"text")inmake?text()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lettext=field_mapjson__"text"GuardrailOutputText.of_jsoninmake?text()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The output content produced by the guardrail."]moduleGuardrailContentBlock=structtypenonrect={text:GuardrailTextBlock.toption[@ocaml.doc"Text within content block to be evaluated by the guardrail."];image:GuardrailImageBlock.toption[@ocaml.doc"Image within guardrail content block to be evaluated by the guardrail."]}letmake?text=fun?image->fun()->{text;image}letto_valuex=structure_to_value[("text",(Option.mapx.text~f:GuardrailTextBlock.to_value));("image",(Option.mapx.image~f:GuardrailImageBlock.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letimage=(Option.map~f:GuardrailImageBlock.of_xml)(Xml.childxml_arg0"image")inlettext=(Option.map~f:GuardrailTextBlock.of_xml)(Xml.childxml_arg0"text")inmake?image?text()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letimage=field_mapjson__"image"GuardrailImageBlock.of_jsoninlettext=field_mapjson__"text"GuardrailTextBlock.of_jsoninmake?image?text()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The content block to be evaluated by the guardrail."]moduleAccessDeniedException=structtypenonrect={message:NonBlankString.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:NonBlankString.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:NonBlankString.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"NonBlankString.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The request is denied because you do not have sufficient permissions to perform the requested action. For troubleshooting this error, see AccessDeniedException in the Amazon Bedrock User Guide"]moduleConflictException=structtypenonrect={message:NonBlankString.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:NonBlankString.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:NonBlankString.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"NonBlankString.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Error occurred because of a conflict while performing an operation."]moduleResourceNotFoundException=structtypenonrect={message:NonBlankString.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:NonBlankString.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:NonBlankString.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"NonBlankString.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The specified resource ARN was not found. For troubleshooting this error, see ResourceNotFound in the Amazon Bedrock User Guide"]moduleServiceQuotaExceededException=structtypenonrect={message:NonBlankString.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:NonBlankString.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:NonBlankString.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"NonBlankString.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Your request exceeds the service quota for your account. You can view your quotas at Viewing service quotas. You can resubmit your request later."]moduleAsyncInvokeIdentifier=structtypenonrect=stringletcontext_="AsyncInvokeIdentifier"letmakei=letopenResultinok_or_failwith((check_string_mini~min:1)>>=(fun()->(check_string_maxi~max:256)>>=(fun()->check_patterni~pattern:"[a-zA-Z_\\.\\-/0-9:]+")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"AsyncInvokeIdentifier"jletto_json=simple_to_jsonto_valueendmoduleModelInputPayload=structtypenonrect=unitletmake()=()letof_header_and_body=((fun(xs,pipe)->make())[@warning"-27"])letto_value_=`Structure[]letto_queryv=to_queryto_valuevletof_xml_=make()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_json_=make()letto_jsonv=composed_to_jsonto_valuevendmoduleTagList=structtypenonrect=Tag.tlistletmakei=letopenResultinok_or_failwith((check_list_maxi~max:200)>>=(fun()->check_list_mini~min:0));iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:Tag.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:Tag.of_xml)letof_jsonj=list_of_json~kind:"TagList"~of_json:Tag.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleAsyncInvokeSummaries=structtypenonrect=AsyncInvokeSummary.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:AsyncInvokeSummary.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:AsyncInvokeSummary.of_xml)letof_jsonj=list_of_json~kind:"AsyncInvokeSummaries"~of_json:AsyncInvokeSummary.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmodulePaginationToken=structtypenonrect=stringletcontext_="PaginationToken"letmakei=letopenResultinok_or_failwith((check_string_mini~min:1)>>=(fun()->(check_string_maxi~max:2048)>>=(fun()->check_patterni~pattern:"\\S*")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"PaginationToken"jletto_json=simple_to_jsonto_valueendmoduleMaxResults=structtypenonrect=intletmakei=letopenResultinok_or_failwith((check_int_maxi~max:1000)>>=(fun()->check_int_mini~min:1));iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for MaxResults"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleSortAsyncInvocationBy=structtypenonrect=|SubmissionTime|Non_static_idofstringletmakei=iletto_string=function|SubmissionTime->"SubmissionTime"|Non_static_ids->sletof_string=function|"SubmissionTime"->SubmissionTime|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration SortAsyncInvocationBy"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"SortAsyncInvocationBy"j)letto_json=simple_to_jsonto_valueendmoduleSortOrder=structtypenonrect=|Ascending|Descending|Non_static_idofstringletmakei=iletto_string=function|Ascending->"Ascending"|Descending->"Descending"|Non_static_ids->sletof_string=function|"Ascending"->Ascending|"Descending"->Descending|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration SortOrder"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"SortOrder"j)letto_json=simple_to_jsonto_valueendmoduleMimeType=structtypenonrect=stringletcontext_="MimeType"letmakei=iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"MimeType"jletto_json=simple_to_jsonto_valueendmoduleModelErrorException=structtypenonrect={message:NonBlankString.toption;originalStatusCode:StatusCode.toption[@ocaml.doc"The original status code."];resourceName:NonBlankString.toption[@ocaml.doc"The resource name."]}letmake?message=fun?originalStatusCode->fun?resourceName->fun()->{message;originalStatusCode;resourceName}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:NonBlankString.to_value));("originalStatusCode",(Option.mapx.originalStatusCode~f:StatusCode.to_value));("resourceName",(Option.mapx.resourceName~f:NonBlankString.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letresourceName=(Option.map~f:NonBlankString.of_xml)(Xml.childxml_arg0"resourceName")inletoriginalStatusCode=(Option.map~f:StatusCode.of_xml)(Xml.childxml_arg0"originalStatusCode")inletmessage=(Option.map~f:NonBlankString.of_xml)(Xml.childxml_arg0"message")inmake?resourceName?originalStatusCode?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letresourceName=field_mapjson__"resourceName"NonBlankString.of_jsoninletoriginalStatusCode=field_mapjson__"originalStatusCode"StatusCode.of_jsoninletmessage=field_mapjson__"message"NonBlankString.of_jsoninmake?resourceName?originalStatusCode?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The request failed due to an error while processing the model."]moduleModelNotReadyException=structtypenonrect={message:NonBlankString.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:NonBlankString.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:NonBlankString.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"NonBlankString.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The model specified in the request is not ready to serve inference requests. The AWS SDK will automatically retry the operation up to 5 times. For information about configuring automatic retries, see Retry behavior in the AWS SDKs and Tools reference guide."]moduleResponseStream=structtypenonrect={chunk:PayloadPart.toption[@ocaml.doc"Content included in the response."];internalServerException:InternalServerException.toption[@ocaml.doc"An internal server error occurred. Retry your request."];modelStreamErrorException:ModelStreamErrorException.toption[@ocaml.doc"An error occurred while streaming the response. Retry your request."];validationException:ValidationException.toption[@ocaml.doc"Input validation failed. Check your request parameters and retry the request."];throttlingException:ThrottlingException.toption[@ocaml.doc"Your request was throttled because of service-wide limitations. Resubmit your request later or in a different region. You can also purchase Provisioned Throughput to increase the rate or number of tokens you can process."];modelTimeoutException:ModelTimeoutException.toption[@ocaml.doc"The request took too long to process. Processing time exceeded the model timeout length."];serviceUnavailableException:ServiceUnavailableException.toption[@ocaml.doc"The service isn't available. Try again later."]}letmake?chunk=fun?internalServerException->fun?modelStreamErrorException->fun?validationException->fun?throttlingException->fun?modelTimeoutException->fun?serviceUnavailableException->fun()->{chunk;internalServerException;modelStreamErrorException;validationException;throttlingException;modelTimeoutException;serviceUnavailableException}letto_valuex=structure_to_value[("chunk",(Option.mapx.chunk~f:PayloadPart.to_value));("internalServerException",(Option.mapx.internalServerException~f:InternalServerException.to_value));("modelStreamErrorException",(Option.mapx.modelStreamErrorException~f:ModelStreamErrorException.to_value));("validationException",(Option.mapx.validationException~f:ValidationException.to_value));("throttlingException",(Option.mapx.throttlingException~f:ThrottlingException.to_value));("modelTimeoutException",(Option.mapx.modelTimeoutException~f:ModelTimeoutException.to_value));("serviceUnavailableException",(Option.mapx.serviceUnavailableException~f:ServiceUnavailableException.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letserviceUnavailableException=(Option.map~f:ServiceUnavailableException.of_xml)(Xml.childxml_arg0"serviceUnavailableException")inletmodelTimeoutException=(Option.map~f:ModelTimeoutException.of_xml)(Xml.childxml_arg0"modelTimeoutException")inletthrottlingException=(Option.map~f:ThrottlingException.of_xml)(Xml.childxml_arg0"throttlingException")inletvalidationException=(Option.map~f:ValidationException.of_xml)(Xml.childxml_arg0"validationException")inletmodelStreamErrorException=(Option.map~f:ModelStreamErrorException.of_xml)(Xml.childxml_arg0"modelStreamErrorException")inletinternalServerException=(Option.map~f:InternalServerException.of_xml)(Xml.childxml_arg0"internalServerException")inletchunk=(Option.map~f:PayloadPart.of_xml)(Xml.childxml_arg0"chunk")inmake?serviceUnavailableException?modelTimeoutException?throttlingException?validationException?modelStreamErrorException?internalServerException?chunk()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letserviceUnavailableException=field_mapjson__"serviceUnavailableException"ServiceUnavailableException.of_jsoninletmodelTimeoutException=field_mapjson__"modelTimeoutException"ModelTimeoutException.of_jsoninletthrottlingException=field_mapjson__"throttlingException"ThrottlingException.of_jsoninletvalidationException=field_mapjson__"validationException"ValidationException.of_jsoninletmodelStreamErrorException=field_mapjson__"modelStreamErrorException"ModelStreamErrorException.of_jsoninletinternalServerException=field_mapjson__"internalServerException"InternalServerException.of_jsoninletchunk=field_mapjson__"chunk"PayloadPart.of_jsoninmake?serviceUnavailableException?modelTimeoutException?throttlingException?validationException?modelStreamErrorException?internalServerException?chunk()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Definition of content in the response stream."]moduleInvokeModelIdentifier=structtypenonrect=stringletcontext_="InvokeModelIdentifier"letmakei=letopenResultinok_or_failwith((check_string_mini~min:1)>>=(fun()->(check_string_maxi~max:2048)>>=(fun()->check_patterni~pattern:"(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|([0-9]{12}:imported-model/[a-z0-9]{12})|([0-9]{12}:provisioned-model/[a-z0-9]{12})|([0-9]{12}:custom-model-deployment/[a-z0-9]{12})|([0-9]{12}:(inference-profile|application-inference-profile)/[a-zA-Z0-9-:.]+)))|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|(([0-9a-zA-Z][_-]?)+)|([a-zA-Z0-9-:.]+)$|(^(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:prompt/[0-9a-zA-Z]{10}(?::[0-9]{1,5})?))$|(^arn:aws:sagemaker:[a-z0-9-]+:[0-9]{12}:endpoint/[a-zA-Z0-9-]+$)|(^arn:aws(-[^:]+)?:bedrock:([0-9a-z-]{1,20}):([0-9]{12}):(default-)?prompt-router/[a-zA-Z0-9-:.]+$)")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"InvokeModelIdentifier"jletto_json=simple_to_jsonto_valueendmoduleTrace=structtypenonrect=|ENABLED|DISABLED|ENABLED_FULL|Non_static_idofstringletmakei=iletto_string=function|ENABLED->"ENABLED"|DISABLED->"DISABLED"|ENABLED_FULL->"ENABLED_FULL"|Non_static_ids->sletof_string=function|"ENABLED"->ENABLED|"DISABLED"->DISABLED|"ENABLED_FULL"->ENABLED_FULL|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration Trace"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"Trace"j)letto_json=simple_to_jsonto_valueendmoduleInvokeModelWithBidirectionalStreamOutput=structtypenonrect={chunk:BidirectionalOutputPayloadPart.toption[@ocaml.doc"The speech chunk that was provided as output from the invocation step."];internalServerException:InternalServerException.toption[@ocaml.doc"The request encountered an unknown internal error."];modelStreamErrorException:ModelStreamErrorException.toption[@ocaml.doc"The request encountered an error with the model stream."];validationException:ValidationException.toption[@ocaml.doc"The input fails to satisfy the constraints specified by an Amazon Web Services service."];throttlingException:ThrottlingException.toption[@ocaml.doc"The request was denied due to request throttling."];modelTimeoutException:ModelTimeoutException.toption[@ocaml.doc"The connection was closed because a request was not received within the timeout period."];serviceUnavailableException:ServiceUnavailableException.toption[@ocaml.doc"The request has failed due to a temporary failure of the server."]}letmake?chunk=fun?internalServerException->fun?modelStreamErrorException->fun?validationException->fun?throttlingException->fun?modelTimeoutException->fun?serviceUnavailableException->fun()->{chunk;internalServerException;modelStreamErrorException;validationException;throttlingException;modelTimeoutException;serviceUnavailableException}letto_valuex=structure_to_value[("chunk",(Option.mapx.chunk~f:BidirectionalOutputPayloadPart.to_value));("internalServerException",(Option.mapx.internalServerException~f:InternalServerException.to_value));("modelStreamErrorException",(Option.mapx.modelStreamErrorException~f:ModelStreamErrorException.to_value));("validationException",(Option.mapx.validationException~f:ValidationException.to_value));("throttlingException",(Option.mapx.throttlingException~f:ThrottlingException.to_value));("modelTimeoutException",(Option.mapx.modelTimeoutException~f:ModelTimeoutException.to_value));("serviceUnavailableException",(Option.mapx.serviceUnavailableException~f:ServiceUnavailableException.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letserviceUnavailableException=(Option.map~f:ServiceUnavailableException.of_xml)(Xml.childxml_arg0"serviceUnavailableException")inletmodelTimeoutException=(Option.map~f:ModelTimeoutException.of_xml)(Xml.childxml_arg0"modelTimeoutException")inletthrottlingException=(Option.map~f:ThrottlingException.of_xml)(Xml.childxml_arg0"throttlingException")inletvalidationException=(Option.map~f:ValidationException.of_xml)(Xml.childxml_arg0"validationException")inletmodelStreamErrorException=(Option.map~f:ModelStreamErrorException.of_xml)(Xml.childxml_arg0"modelStreamErrorException")inletinternalServerException=(Option.map~f:InternalServerException.of_xml)(Xml.childxml_arg0"internalServerException")inletchunk=(Option.map~f:BidirectionalOutputPayloadPart.of_xml)(Xml.childxml_arg0"chunk")inmake?serviceUnavailableException?modelTimeoutException?throttlingException?validationException?modelStreamErrorException?internalServerException?chunk()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letserviceUnavailableException=field_mapjson__"serviceUnavailableException"ServiceUnavailableException.of_jsoninletmodelTimeoutException=field_mapjson__"modelTimeoutException"ModelTimeoutException.of_jsoninletthrottlingException=field_mapjson__"throttlingException"ThrottlingException.of_jsoninletvalidationException=field_mapjson__"validationException"ValidationException.of_jsoninletmodelStreamErrorException=field_mapjson__"modelStreamErrorException"ModelStreamErrorException.of_jsoninletinternalServerException=field_mapjson__"internalServerException"InternalServerException.of_jsoninletchunk=field_mapjson__"chunk"BidirectionalOutputPayloadPart.of_jsoninmake?serviceUnavailableException?modelTimeoutException?throttlingException?validationException?modelStreamErrorException?internalServerException?chunk()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Output from the bidirectional stream that was used for model invocation."]moduleInvokeModelWithBidirectionalStreamInput=structtypenonrect={chunk:BidirectionalInputPayloadPart.toption[@ocaml.doc"The audio chunk that is used as input for the invocation step."]}letmake?chunk=fun()->{chunk}letto_valuex=structure_to_value[("chunk",(Option.mapx.chunk~f:BidirectionalInputPayloadPart.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letchunk=(Option.map~f:BidirectionalInputPayloadPart.of_xml)(Xml.childxml_arg0"chunk")inmake?chunk()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letchunk=field_mapjson__"chunk"BidirectionalInputPayloadPart.of_jsoninmake?chunk()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Payload content, the speech chunk, for the bidirectional input of the invocation step."]moduleInteger=structtypenonrect=intletmakei=iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for Integer"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleCountTokensInput=structtypenonrect={invokeModel:InvokeModelTokensRequest.toption[@ocaml.doc"An InvokeModel request for which to count tokens. Use this field when you want to count tokens for a raw text input that would be sent to the InvokeModel operation."];converse:ConverseTokensRequest.toption[@ocaml.doc"A Converse request for which to count tokens. Use this field when you want to count tokens for a conversation-based input that would be sent to the Converse operation."]}letmake?invokeModel=fun?converse->fun()->{invokeModel;converse}letto_valuex=structure_to_value[("invokeModel",(Option.mapx.invokeModel~f:InvokeModelTokensRequest.to_value));("converse",(Option.mapx.converse~f:ConverseTokensRequest.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letconverse=(Option.map~f:ConverseTokensRequest.of_xml)(Xml.childxml_arg0"converse")inletinvokeModel=(Option.map~f:InvokeModelTokensRequest.of_xml)(Xml.childxml_arg0"invokeModel")inmake?converse?invokeModel()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letconverse=field_mapjson__"converse"ConverseTokensRequest.of_jsoninletinvokeModel=field_mapjson__"invokeModel"InvokeModelTokensRequest.of_jsoninmake?converse?invokeModel()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The input value for token counting. The value should be either an InvokeModel or Converse request body."]moduleFoundationModelVersionIdentifier=structtypenonrect=string[@@ocaml.doc"ARN or ID of a Bedrock model"]letcontext_="FoundationModelVersionIdentifier"letmakei=letopenResultinok_or_failwith((check_string_mini~min:1)>>=(fun()->(check_string_maxi~max:256)>>=(fun()->check_patterni~pattern:"[a-zA-Z_\\.\\-/0-9:]+")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"FoundationModelVersionIdentifier"jletto_json=simple_to_jsonto_valueend[@@ocaml.doc"ARN or ID of a Bedrock model"]moduleConverseStreamOutput=structtypenonrect={messageStart:MessageStartEvent.toption[@ocaml.doc"Message start information."];contentBlockStart:ContentBlockStartEvent.toption[@ocaml.doc"Start information for a content block."];contentBlockDelta:ContentBlockDeltaEvent.toption[@ocaml.doc"The messages output content block delta."];contentBlockStop:ContentBlockStopEvent.toption[@ocaml.doc"Stop information for a content block."];messageStop:MessageStopEvent.toption[@ocaml.doc"Message stop information."];metadata:ConverseStreamMetadataEvent.toption[@ocaml.doc"Metadata for the converse output stream."];internalServerException:InternalServerException.toption[@ocaml.doc"An internal server error occurred. Retry your request."];modelStreamErrorException:ModelStreamErrorException.toption[@ocaml.doc"A streaming error occurred. Retry your request."];validationException:ValidationException.toption[@ocaml.doc"The input fails to satisfy the constraints specified by Amazon Bedrock. For troubleshooting this error, see ValidationError in the Amazon Bedrock User Guide."];throttlingException:ThrottlingException.toption[@ocaml.doc"Your request was denied due to exceeding the account quotas for Amazon Bedrock. For troubleshooting this error, see ThrottlingException in the Amazon Bedrock User Guide."];serviceUnavailableException:ServiceUnavailableException.toption[@ocaml.doc"The service isn't currently available. For troubleshooting this error, see ServiceUnavailable in the Amazon Bedrock User Guide"]}letmake?messageStart=fun?contentBlockStart->fun?contentBlockDelta->fun?contentBlockStop->fun?messageStop->fun?metadata->fun?internalServerException->fun?modelStreamErrorException->fun?validationException->fun?throttlingException->fun?serviceUnavailableException->fun()->{messageStart;contentBlockStart;contentBlockDelta;contentBlockStop;messageStop;metadata;internalServerException;modelStreamErrorException;validationException;throttlingException;serviceUnavailableException}letto_valuex=structure_to_value[("messageStart",(Option.mapx.messageStart~f:MessageStartEvent.to_value));("contentBlockStart",(Option.mapx.contentBlockStart~f:ContentBlockStartEvent.to_value));("contentBlockDelta",(Option.mapx.contentBlockDelta~f:ContentBlockDeltaEvent.to_value));("contentBlockStop",(Option.mapx.contentBlockStop~f:ContentBlockStopEvent.to_value));("messageStop",(Option.mapx.messageStop~f:MessageStopEvent.to_value));("metadata",(Option.mapx.metadata~f:ConverseStreamMetadataEvent.to_value));("internalServerException",(Option.mapx.internalServerException~f:InternalServerException.to_value));("modelStreamErrorException",(Option.mapx.modelStreamErrorException~f:ModelStreamErrorException.to_value));("validationException",(Option.mapx.validationException~f:ValidationException.to_value));("throttlingException",(Option.mapx.throttlingException~f:ThrottlingException.to_value));("serviceUnavailableException",(Option.mapx.serviceUnavailableException~f:ServiceUnavailableException.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letserviceUnavailableException=(Option.map~f:ServiceUnavailableException.of_xml)(Xml.childxml_arg0"serviceUnavailableException")inletthrottlingException=(Option.map~f:ThrottlingException.of_xml)(Xml.childxml_arg0"throttlingException")inletvalidationException=(Option.map~f:ValidationException.of_xml)(Xml.childxml_arg0"validationException")inletmodelStreamErrorException=(Option.map~f:ModelStreamErrorException.of_xml)(Xml.childxml_arg0"modelStreamErrorException")inletinternalServerException=(Option.map~f:InternalServerException.of_xml)(Xml.childxml_arg0"internalServerException")inletmetadata=(Option.map~f:ConverseStreamMetadataEvent.of_xml)(Xml.childxml_arg0"metadata")inletmessageStop=(Option.map~f:MessageStopEvent.of_xml)(Xml.childxml_arg0"messageStop")inletcontentBlockStop=(Option.map~f:ContentBlockStopEvent.of_xml)(Xml.childxml_arg0"contentBlockStop")inletcontentBlockDelta=(Option.map~f:ContentBlockDeltaEvent.of_xml)(Xml.childxml_arg0"contentBlockDelta")inletcontentBlockStart=(Option.map~f:ContentBlockStartEvent.of_xml)(Xml.childxml_arg0"contentBlockStart")inletmessageStart=(Option.map~f:MessageStartEvent.of_xml)(Xml.childxml_arg0"messageStart")inmake?serviceUnavailableException?throttlingException?validationException?modelStreamErrorException?internalServerException?metadata?messageStop?contentBlockStop?contentBlockDelta?contentBlockStart?messageStart()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letserviceUnavailableException=field_mapjson__"serviceUnavailableException"ServiceUnavailableException.of_jsoninletthrottlingException=field_mapjson__"throttlingException"ThrottlingException.of_jsoninletvalidationException=field_mapjson__"validationException"ValidationException.of_jsoninletmodelStreamErrorException=field_mapjson__"modelStreamErrorException"ModelStreamErrorException.of_jsoninletinternalServerException=field_mapjson__"internalServerException"InternalServerException.of_jsoninletmetadata=field_mapjson__"metadata"ConverseStreamMetadataEvent.of_jsoninletmessageStop=field_mapjson__"messageStop"MessageStopEvent.of_jsoninletcontentBlockStop=field_mapjson__"contentBlockStop"ContentBlockStopEvent.of_jsoninletcontentBlockDelta=field_mapjson__"contentBlockDelta"ContentBlockDeltaEvent.of_jsoninletcontentBlockStart=field_mapjson__"contentBlockStart"ContentBlockStartEvent.of_jsoninletmessageStart=field_mapjson__"messageStart"MessageStartEvent.of_jsoninmake?serviceUnavailableException?throttlingException?validationException?modelStreamErrorException?internalServerException?metadata?messageStop?contentBlockStop?contentBlockDelta?contentBlockStart?messageStart()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The messages output stream"]moduleConversationalModelId=structtypenonrect=stringletcontext_="ConversationalModelId"letmakei=letopenResultinok_or_failwith((check_string_mini~min:1)>>=(fun()->(check_string_maxi~max:2048)>>=(fun()->check_patterni~pattern:"(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|([0-9]{12}:imported-model/[a-z0-9]{12})|([0-9]{12}:provisioned-model/[a-z0-9]{12})|([0-9]{12}:custom-model-deployment/[a-z0-9]{12})|([0-9]{12}:(inference-profile|application-inference-profile)/[a-zA-Z0-9-:.]+)))|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|(([0-9a-zA-Z][_-]?)+)|([a-zA-Z0-9-:.]+)|(^(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:prompt/[0-9a-zA-Z]{10}(?::[0-9]{1,5})?))$|(^arn:aws:sagemaker:[a-z0-9-]+:[0-9]{12}:endpoint/[a-zA-Z0-9-]+$)|(^arn:aws(-[^:]+)?:bedrock:([0-9a-z-]{1,20}):([0-9]{12}):(default-)?prompt-router/[a-zA-Z0-9-:.]+$)")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"ConversationalModelId"jletto_json=simple_to_jsonto_valueendmoduleConverseStreamRequestAdditionalModelResponseFieldPathsList=structtypenonrect=ConverseStreamRequestAdditionalModelResponseFieldPathsListMemberString.tlistletmakei=letopenResultinok_or_failwith((check_list_maxi~max:10)>>=(fun()->check_list_mini~min:0));iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:ConverseStreamRequestAdditionalModelResponseFieldPathsListMemberString.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:ConverseStreamRequestAdditionalModelResponseFieldPathsListMemberString.of_xml)letof_jsonj=list_of_json~kind:"ConverseStreamRequestAdditionalModelResponseFieldPathsList"~of_json:ConverseStreamRequestAdditionalModelResponseFieldPathsListMemberString.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleGuardrailStreamConfiguration=structtypenonrect={guardrailIdentifier:GuardrailIdentifier.toption[@ocaml.doc"The identifier for the guardrail."];guardrailVersion:GuardrailVersion.toption[@ocaml.doc"The version of the guardrail."];trace:GuardrailTrace.toption[@ocaml.doc"The trace behavior for the guardrail."];streamProcessingMode:GuardrailStreamProcessingMode.toption[@ocaml.doc"The processing mode. The processing mode. For more information, see Configure streaming response behavior in the Amazon Bedrock User Guide."]}letmake?guardrailIdentifier=fun?guardrailVersion->fun?trace->fun?streamProcessingMode->fun()->{guardrailIdentifier;guardrailVersion;trace;streamProcessingMode}letto_valuex=structure_to_value[("guardrailIdentifier",(Option.mapx.guardrailIdentifier~f:GuardrailIdentifier.to_value));("guardrailVersion",(Option.mapx.guardrailVersion~f:GuardrailVersion.to_value));("trace",(Option.mapx.trace~f:GuardrailTrace.to_value));("streamProcessingMode",(Option.mapx.streamProcessingMode~f:GuardrailStreamProcessingMode.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letstreamProcessingMode=(Option.map~f:GuardrailStreamProcessingMode.of_xml)(Xml.childxml_arg0"streamProcessingMode")inlettrace=(Option.map~f:GuardrailTrace.of_xml)(Xml.childxml_arg0"trace")inletguardrailVersion=(Option.map~f:GuardrailVersion.of_xml)(Xml.childxml_arg0"guardrailVersion")inletguardrailIdentifier=(Option.map~f:GuardrailIdentifier.of_xml)(Xml.childxml_arg0"guardrailIdentifier")inmake?streamProcessingMode?trace?guardrailVersion?guardrailIdentifier()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letstreamProcessingMode=field_mapjson__"streamProcessingMode"GuardrailStreamProcessingMode.of_jsoninlettrace=field_mapjson__"trace"GuardrailTrace.of_jsoninletguardrailVersion=field_mapjson__"guardrailVersion"GuardrailVersion.of_jsoninletguardrailIdentifier=field_mapjson__"guardrailIdentifier"GuardrailIdentifier.of_jsoninmake?streamProcessingMode?trace?guardrailVersion?guardrailIdentifier()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Configuration information for a guardrail that you use with the ConverseStream action."]moduleInferenceConfiguration=structtypenonrect={maxTokens:InferenceConfigurationMaxTokensInteger.toption[@ocaml.doc"The maximum number of tokens to allow in the generated response. The default value is the maximum allowed value for the model that you are using. For more information, see Inference parameters for foundation models."];temperature:InferenceConfigurationTemperatureFloat.toption[@ocaml.doc"The likelihood of the model selecting higher-probability options while generating a response. A lower value makes the model more likely to choose higher-probability options, while a higher value makes the model more likely to choose lower-probability options. The default value is the default value for the model that you are using. For more information, see Inference parameters for foundation models."];topP:InferenceConfigurationTopPFloat.toption[@ocaml.doc"The percentage of most-likely candidates that the model considers for the next token. For example, if you choose a value of 0.8 for topP, the model selects from the top 80% of the probability distribution of tokens that could be next in the sequence. The default value is the default value for the model that you are using. For more information, see Inference parameters for foundation models."];stopSequences:InferenceConfigurationStopSequencesList.toption[@ocaml.doc"A list of stop sequences. A stop sequence is a sequence of characters that causes the model to stop generating the response."]}letmake?maxTokens=fun?temperature->fun?topP->fun?stopSequences->fun()->{maxTokens;temperature;topP;stopSequences}letto_valuex=structure_to_value[("maxTokens",(Option.mapx.maxTokens~f:InferenceConfigurationMaxTokensInteger.to_value));("temperature",(Option.mapx.temperature~f:InferenceConfigurationTemperatureFloat.to_value));("topP",(Option.mapx.topP~f:InferenceConfigurationTopPFloat.to_value));("stopSequences",(Option.mapx.stopSequences~f:InferenceConfigurationStopSequencesList.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letstopSequences=(Option.map~f:InferenceConfigurationStopSequencesList.of_xml)(Xml.childxml_arg0"stopSequences")inlettopP=(Option.map~f:InferenceConfigurationTopPFloat.of_xml)(Xml.childxml_arg0"topP")inlettemperature=(Option.map~f:InferenceConfigurationTemperatureFloat.of_xml)(Xml.childxml_arg0"temperature")inletmaxTokens=(Option.map~f:InferenceConfigurationMaxTokensInteger.of_xml)(Xml.childxml_arg0"maxTokens")inmake?stopSequences?topP?temperature?maxTokens()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letstopSequences=field_mapjson__"stopSequences"InferenceConfigurationStopSequencesList.of_jsoninlettopP=field_mapjson__"topP"InferenceConfigurationTopPFloat.of_jsoninlettemperature=field_mapjson__"temperature"InferenceConfigurationTemperatureFloat.of_jsoninletmaxTokens=field_mapjson__"maxTokens"InferenceConfigurationMaxTokensInteger.of_jsoninmake?stopSequences?topP?temperature?maxTokens()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Base inference parameters to pass to a model in a call to Converse or ConverseStream. For more information, see Inference parameters for foundation models. If you need to pass additional parameters that the model supports, use the additionalModelRequestFields request field in the call to Converse or ConverseStream. For more information, see Model parameters."]moduleOutputConfig=structtypenonrect={textFormat:OutputFormat.toption[@ocaml.doc"Structured output parameters to control the model's text response."]}letmake?textFormat=fun()->{textFormat}letto_valuex=structure_to_value[("textFormat",(Option.mapx.textFormat~f:OutputFormat.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lettextFormat=(Option.map~f:OutputFormat.of_xml)(Xml.childxml_arg0"textFormat")inmake?textFormat()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lettextFormat=field_mapjson__"textFormat"OutputFormat.of_jsoninmake?textFormat()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Output configuration for a model response in a call to Converse or ConverseStream."]modulePromptVariableMap=structtypenonrect=(String_.t*PromptVariableValues.t)listletmakei=iletof_headerxs=make(List.filter_mapxs~f:(fun(k,v)->(Base.String.chop_prefixk~prefix:"x-amz-meta-")|>(Option.map~f:(funchopped->let(_:string)=vinlet(_:string)=choppedinfailwith"no of_header for complex types String PromptVariableValues"))))letto_valuexs=(xs|>(List.map~f:(fun(x,y)->(String_.to_valuex)|>(funx->(PromptVariableValues.to_valuey)|>(funy->(x,y))))))|>(funx->`Mapx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for Map_shape objects"()letof_xml_=failwith"of_xml_converter_of_shape: Map_shape case not implemented"letof_jsonj=object_of_json~key_of_string:String_.of_string~of_json:PromptVariableValues.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleRequestMetadata=structtypenonrect=(RequestMetadataKeyString.t*RequestMetadataValueString.t)listletmakei=letopenResultinok_or_failwith((check_list_maxi~max:16)>>=(fun()->check_list_mini~min:1));iletof_headerxs=make(List.filter_mapxs~f:(fun(k,v)->(Base.String.chop_prefixk~prefix:"x-amz-meta-")|>(Option.map~f:(funchopped->((RequestMetadataKeyString.of_stringchopped),(RequestMetadataValueString.of_stringv))))))letto_valuexs=(xs|>(List.map~f:(fun(x,y)->(RequestMetadataKeyString.to_valuex)|>(funx->(RequestMetadataValueString.to_valuey)|>(funy->(x,y))))))|>(funx->`Mapx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for Map_shape objects"()letof_xml_=failwith"of_xml_converter_of_shape: Map_shape case not implemented"letof_jsonj=object_of_json~key_of_string:RequestMetadataKeyString.of_string~of_json:RequestMetadataValueString.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleConverseMetrics=structtypenonrect={latencyMs:Long.toption[@ocaml.doc"The latency of the call to Converse, in milliseconds."]}letmake?latencyMs=fun()->{latencyMs}letto_valuex=structure_to_value[("latencyMs",(Option.mapx.latencyMs~f:Long.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letlatencyMs=(Option.map~f:Long.of_xml)(Xml.childxml_arg0"latencyMs")inmake?latencyMs()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letlatencyMs=field_mapjson__"latencyMs"Long.of_jsoninmake?latencyMs()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Metrics for a call to Converse."]moduleConverseOutput=structtypenonrect={message:Message.toption[@ocaml.doc"The message that the model generates."]}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:Message.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:Message.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"Message.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The output from a call to Converse."]moduleConverseTrace=structtypenonrect={guardrail:GuardrailTraceAssessment.toption[@ocaml.doc"The guardrail trace object."];promptRouter:PromptRouterTrace.toption[@ocaml.doc"The request's prompt router."]}letmake?guardrail=fun?promptRouter->fun()->{guardrail;promptRouter}letto_valuex=structure_to_value[("guardrail",(Option.mapx.guardrail~f:GuardrailTraceAssessment.to_value));("promptRouter",(Option.mapx.promptRouter~f:PromptRouterTrace.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letpromptRouter=(Option.map~f:PromptRouterTrace.of_xml)(Xml.childxml_arg0"promptRouter")inletguardrail=(Option.map~f:GuardrailTraceAssessment.of_xml)(Xml.childxml_arg0"guardrail")inmake?promptRouter?guardrail()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letpromptRouter=field_mapjson__"promptRouter"PromptRouterTrace.of_jsoninletguardrail=field_mapjson__"guardrail"GuardrailTraceAssessment.of_jsoninmake?promptRouter?guardrail()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The trace object in a response from Converse."]moduleConverseRequestAdditionalModelResponseFieldPathsList=structtypenonrect=ConverseRequestAdditionalModelResponseFieldPathsListMemberString.tlistletmakei=letopenResultinok_or_failwith((check_list_maxi~max:10)>>=(fun()->check_list_mini~min:0));iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:ConverseRequestAdditionalModelResponseFieldPathsListMemberString.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:ConverseRequestAdditionalModelResponseFieldPathsListMemberString.of_xml)letof_jsonj=list_of_json~kind:"ConverseRequestAdditionalModelResponseFieldPathsList"~of_json:ConverseRequestAdditionalModelResponseFieldPathsListMemberString.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleGuardrailConfiguration=structtypenonrect={guardrailIdentifier:GuardrailIdentifier.toption[@ocaml.doc"The identifier for the guardrail."];guardrailVersion:GuardrailVersion.toption[@ocaml.doc"The version of the guardrail."];trace:GuardrailTrace.toption[@ocaml.doc"The trace behavior for the guardrail."]}letmake?guardrailIdentifier=fun?guardrailVersion->fun?trace->fun()->{guardrailIdentifier;guardrailVersion;trace}letto_valuex=structure_to_value[("guardrailIdentifier",(Option.mapx.guardrailIdentifier~f:GuardrailIdentifier.to_value));("guardrailVersion",(Option.mapx.guardrailVersion~f:GuardrailVersion.to_value));("trace",(Option.mapx.trace~f:GuardrailTrace.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lettrace=(Option.map~f:GuardrailTrace.of_xml)(Xml.childxml_arg0"trace")inletguardrailVersion=(Option.map~f:GuardrailVersion.of_xml)(Xml.childxml_arg0"guardrailVersion")inletguardrailIdentifier=(Option.map~f:GuardrailIdentifier.of_xml)(Xml.childxml_arg0"guardrailIdentifier")inmake?trace?guardrailVersion?guardrailIdentifier()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lettrace=field_mapjson__"trace"GuardrailTrace.of_jsoninletguardrailVersion=field_mapjson__"guardrailVersion"GuardrailVersion.of_jsoninletguardrailIdentifier=field_mapjson__"guardrailIdentifier"GuardrailIdentifier.of_jsoninmake?trace?guardrailVersion?guardrailIdentifier()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Configuration information for a guardrail that you use with the Converse operation."]moduleGuardrailAction=structtypenonrect=|NONE|GUARDRAIL_INTERVENED|Non_static_idofstringletmakei=iletto_string=function|NONE->"NONE"|GUARDRAIL_INTERVENED->"GUARDRAIL_INTERVENED"|Non_static_ids->sletof_string=function|"NONE"->NONE|"GUARDRAIL_INTERVENED"->GUARDRAIL_INTERVENED|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration GuardrailAction"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"GuardrailAction"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailOutputContentList=structtypenonrect=GuardrailOutputContent.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:GuardrailOutputContent.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:GuardrailOutputContent.of_xml)letof_jsonj=list_of_json~kind:"GuardrailOutputContentList"~of_json:GuardrailOutputContent.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleGuardrailContentBlockList=structtypenonrect=GuardrailContentBlock.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:GuardrailContentBlock.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:GuardrailContentBlock.of_xml)letof_jsonj=list_of_json~kind:"GuardrailContentBlockList"~of_json:GuardrailContentBlock.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleGuardrailContentSource=structtypenonrect=|INPUT|OUTPUT|Non_static_idofstringletmakei=iletto_string=function|INPUT->"INPUT"|OUTPUT->"OUTPUT"|Non_static_ids->sletof_string=function|"INPUT"->INPUT|"OUTPUT"->OUTPUT|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration GuardrailContentSource"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"GuardrailContentSource"j)letto_json=simple_to_jsonto_valueendmoduleGuardrailOutputScope=structtypenonrect=|INTERVENTIONS|FULL|Non_static_idofstringletmakei=iletto_string=function|INTERVENTIONS->"INTERVENTIONS"|FULL->"FULL"|Non_static_ids->sletof_string=function|"INTERVENTIONS"->INTERVENTIONS|"FULL"->FULL|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration GuardrailOutputScope"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"GuardrailOutputScope"j)letto_json=simple_to_jsonto_valueendmoduleStartAsyncInvokeResponse=structtypenonrect={invocationArn:InvocationArn.toption[@ocaml.doc"The ARN of the invocation."]}typenonrecerror=[`AccessDeniedExceptionofAccessDeniedException.t|`ConflictExceptionofConflictException.t|`InternalServerExceptionofInternalServerException.t|`ResourceNotFoundExceptionofResourceNotFoundException.t|`ServiceQuotaExceededExceptionofServiceQuotaExceededException.t|`ServiceUnavailableExceptionofServiceUnavailableException.t|`ThrottlingExceptionofThrottlingException.t|`ValidationExceptionofValidationException.t|`Unknown_operation_errorof(string*stringoption)]letmake?invocationArn=fun()->{invocationArn}leterror_of_jsonnamejson=matchnamewith|"AccessDeniedException"->`AccessDeniedException(AccessDeniedException.of_jsonjson)|"ConflictException"->`ConflictException(ConflictException.of_jsonjson)|"InternalServerException"->`InternalServerException(InternalServerException.of_jsonjson)|"ResourceNotFoundException"->`ResourceNotFoundException(ResourceNotFoundException.of_jsonjson)|"ServiceQuotaExceededException"->`ServiceQuotaExceededException(ServiceQuotaExceededException.of_jsonjson)|"ServiceUnavailableException"->`ServiceUnavailableException(ServiceUnavailableException.of_jsonjson)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_jsonjson)|"ValidationException"->`ValidationException(ValidationException.of_jsonjson)|name->`Unknown_operation_error(name,(Some(Yojson.Safe.to_stringjson)))leterror_of_xmlnamexml=matchnamewith|"AccessDeniedException"->`AccessDeniedException(AccessDeniedException.of_xmlxml)|"ConflictException"->`ConflictException(ConflictException.of_xmlxml)|"InternalServerException"->`InternalServerException(InternalServerException.of_xmlxml)|"ResourceNotFoundException"->`ResourceNotFoundException(ResourceNotFoundException.of_xmlxml)|"ServiceQuotaExceededException"->`ServiceQuotaExceededException(ServiceQuotaExceededException.of_xmlxml)|"ServiceUnavailableException"->`ServiceUnavailableException(ServiceUnavailableException.of_xmlxml)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_xmlxml)|"ValidationException"->`ValidationException(ValidationException.of_xmlxml)|name->`Unknown_operation_error(name,(Some(Awso.Xml.to_stringxml)))leterror_to_json:error->Yojson.Safe.t=function|`AccessDeniedExceptione->`Assoc[("error",(`String"AccessDeniedException"));("details",(AccessDeniedException.to_jsone))]|`ConflictExceptione->`Assoc[("error",(`String"ConflictException"));("details",(ConflictException.to_jsone))]|`InternalServerExceptione->`Assoc[("error",(`String"InternalServerException"));("details",(InternalServerException.to_jsone))]|`ResourceNotFoundExceptione->`Assoc[("error",(`String"ResourceNotFoundException"));("details",(ResourceNotFoundException.to_jsone))]|`ServiceQuotaExceededExceptione->`Assoc[("error",(`String"ServiceQuotaExceededException"));("details",(ServiceQuotaExceededException.to_jsone))]|`ServiceUnavailableExceptione->`Assoc[("error",(`String"ServiceUnavailableException"));("details",(ServiceUnavailableException.to_jsone))]|`ThrottlingExceptione->`Assoc[("error",(`String"ThrottlingException"));("details",(ThrottlingException.to_jsone))]|`ValidationExceptione->`Assoc[("error",(`String"ValidationException"));("details",(ValidationException.to_jsone))]|`Unknown_operation_error(code,msg)->`Assoc(("error",(`Stringcode))::((matchmsgwith|None->[]|Somem->[("message",(`Stringm))])))letto_valuex=structure_to_value[("invocationArn",(Option.mapx.invocationArn~f:InvocationArn.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letinvocationArn=(Option.map~f:InvocationArn.of_xml)(Xml.childxml_arg0"invocationArn")inmake?invocationArn()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letinvocationArn=field_mapjson__"invocationArn"InvocationArn.of_jsoninmake?invocationArn()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Starts an asynchronous invocation. This operation requires permission for the bedrock:InvokeModel action. To deny all inference access to resources that you specify in the modelId field, you need to deny access to the bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream actions. Doing this also denies access to the resource through the Converse API actions (Converse and ConverseStream). For more information see Deny access for inference on specific models."]moduleStartAsyncInvokeRequest=structtypenonrect={clientRequestToken:AsyncInvokeIdempotencyToken.toption[@ocaml.doc"Specify idempotency token to ensure that requests are not duplicated."];modelId:AsyncInvokeIdentifier.t[@ocaml.doc"The model to invoke."];modelInput:ModelInputPayload.t[@ocaml.doc"Input to send to the model."];outputDataConfig:AsyncInvokeOutputDataConfig.t[@ocaml.doc"Where to store the output."];tags:TagList.toption[@ocaml.doc"Tags to apply to the invocation."]}letcontext_="StartAsyncInvokeRequest"letmake?clientRequestToken=fun?tags->fun~modelId->fun~modelInput->fun~outputDataConfig->fun()->{clientRequestToken;tags;modelId;modelInput;outputDataConfig}letto_valuex=structure_to_value[("clientRequestToken",(Option.mapx.clientRequestToken~f:AsyncInvokeIdempotencyToken.to_value));("modelId",(Some(AsyncInvokeIdentifier.to_valuex.modelId)));("modelInput",(Some(ModelInputPayload.to_valuex.modelInput)));("outputDataConfig",(Some(AsyncInvokeOutputDataConfig.to_valuex.outputDataConfig)));("tags",(Option.mapx.tags~f:TagList.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lettags=(Option.map~f:TagList.of_xml)(Xml.childxml_arg0"tags")inletoutputDataConfig=AsyncInvokeOutputDataConfig.of_xml(Xml.child_exn~context:context_xml_arg0"outputDataConfig")inletmodelInput=ModelInputPayload.of_xml(Xml.child_exn~context:context_xml_arg0"modelInput")inletmodelId=AsyncInvokeIdentifier.of_xml(Xml.child_exn~context:context_xml_arg0"modelId")inletclientRequestToken=(Option.map~f:AsyncInvokeIdempotencyToken.of_xml)(Xml.childxml_arg0"clientRequestToken")inmake?tags~outputDataConfig~modelInput~modelId?clientRequestToken()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lettags=field_mapjson__"tags"TagList.of_jsoninletoutputDataConfig=field_map_exnjson__"outputDataConfig"AsyncInvokeOutputDataConfig.of_jsoninletmodelInput=field_map_exnjson__"modelInput"ModelInputPayload.of_jsoninletmodelId=field_map_exnjson__"modelId"AsyncInvokeIdentifier.of_jsoninletclientRequestToken=field_mapjson__"clientRequestToken"AsyncInvokeIdempotencyToken.of_jsoninmake?tags~outputDataConfig~modelInput~modelId?clientRequestToken()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Starts an asynchronous invocation. This operation requires permission for the bedrock:InvokeModel action. To deny all inference access to resources that you specify in the modelId field, you need to deny access to the bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream actions. Doing this also denies access to the resource through the Converse API actions (Converse and ConverseStream). For more information see Deny access for inference on specific models."]moduleListAsyncInvokesResponse=structtypenonrect={nextToken:PaginationToken.toption[@ocaml.doc"Specify the pagination token from a previous request to retrieve the next page of results."];asyncInvokeSummaries:AsyncInvokeSummaries.toption[@ocaml.doc"A list of invocation summaries."]}typenonrecerror=[`AccessDeniedExceptionofAccessDeniedException.t|`InternalServerExceptionofInternalServerException.t|`ThrottlingExceptionofThrottlingException.t|`ValidationExceptionofValidationException.t|`Unknown_operation_errorof(string*stringoption)]letmake?nextToken=fun?asyncInvokeSummaries->fun()->{nextToken;asyncInvokeSummaries}leterror_of_jsonnamejson=matchnamewith|"AccessDeniedException"->`AccessDeniedException(AccessDeniedException.of_jsonjson)|"InternalServerException"->`InternalServerException(InternalServerException.of_jsonjson)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_jsonjson)|"ValidationException"->`ValidationException(ValidationException.of_jsonjson)|name->`Unknown_operation_error(name,(Some(Yojson.Safe.to_stringjson)))leterror_of_xmlnamexml=matchnamewith|"AccessDeniedException"->`AccessDeniedException(AccessDeniedException.of_xmlxml)|"InternalServerException"->`InternalServerException(InternalServerException.of_xmlxml)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_xmlxml)|"ValidationException"->`ValidationException(ValidationException.of_xmlxml)|name->`Unknown_operation_error(name,(Some(Awso.Xml.to_stringxml)))leterror_to_json:error->Yojson.Safe.t=function|`AccessDeniedExceptione->`Assoc[("error",(`String"AccessDeniedException"));("details",(AccessDeniedException.to_jsone))]|`InternalServerExceptione->`Assoc[("error",(`String"InternalServerException"));("details",(InternalServerException.to_jsone))]|`ThrottlingExceptione->`Assoc[("error",(`String"ThrottlingException"));("details",(ThrottlingException.to_jsone))]|`ValidationExceptione->`Assoc[("error",(`String"ValidationException"));("details",(ValidationException.to_jsone))]|`Unknown_operation_error(code,msg)->`Assoc(("error",(`Stringcode))::((matchmsgwith|None->[]|Somem->[("message",(`Stringm))])))letto_valuex=structure_to_value[("nextToken",(Option.mapx.nextToken~f:PaginationToken.to_value));("asyncInvokeSummaries",(Option.mapx.asyncInvokeSummaries~f:AsyncInvokeSummaries.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letasyncInvokeSummaries=(Option.map~f:AsyncInvokeSummaries.of_xml)(Xml.childxml_arg0"asyncInvokeSummaries")inletnextToken=(Option.map~f:PaginationToken.of_xml)(Xml.childxml_arg0"nextToken")inmake?asyncInvokeSummaries?nextToken()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letasyncInvokeSummaries=field_mapjson__"asyncInvokeSummaries"AsyncInvokeSummaries.of_jsoninletnextToken=field_mapjson__"nextToken"PaginationToken.of_jsoninmake?asyncInvokeSummaries?nextToken()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Lists asynchronous invocations."]moduleListAsyncInvokesRequest=structtypenonrect={submitTimeAfter:Timestamp.toption[@ocaml.doc"Include invocations submitted after this time."];submitTimeBefore:Timestamp.toption[@ocaml.doc"Include invocations submitted before this time."];statusEquals:AsyncInvokeStatus.toption[@ocaml.doc"Filter invocations by status."];maxResults:MaxResults.toption[@ocaml.doc"The maximum number of invocations to return in one page of results."];nextToken:PaginationToken.toption[@ocaml.doc"Specify the pagination token from a previous request to retrieve the next page of results."];sortBy:SortAsyncInvocationBy.toption[@ocaml.doc"How to sort the response."];sortOrder:SortOrder.toption[@ocaml.doc"The sorting order for the response."]}letmake?submitTimeAfter=fun?submitTimeBefore->fun?statusEquals->fun?maxResults->fun?nextToken->fun?sortBy->fun?sortOrder->fun()->{submitTimeAfter;submitTimeBefore;statusEquals;maxResults;nextToken;sortBy;sortOrder}letto_valuex=structure_to_value[("submitTimeAfter",(Option.mapx.submitTimeAfter~f:Timestamp.to_value));("submitTimeBefore",(Option.mapx.submitTimeBefore~f:Timestamp.to_value));("statusEquals",(Option.mapx.statusEquals~f:AsyncInvokeStatus.to_value));("maxResults",(Option.mapx.maxResults~f:MaxResults.to_value));("nextToken",(Option.mapx.nextToken~f:PaginationToken.to_value));("sortBy",(Option.mapx.sortBy~f:SortAsyncInvocationBy.to_value));("sortOrder",(Option.mapx.sortOrder~f:SortOrder.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letsortOrder=(Option.map~f:SortOrder.of_xml)(Xml.childxml_arg0"sortOrder")inletsortBy=(Option.map~f:SortAsyncInvocationBy.of_xml)(Xml.childxml_arg0"sortBy")inletnextToken=(Option.map~f:PaginationToken.of_xml)(Xml.childxml_arg0"nextToken")inletmaxResults=(Option.map~f:MaxResults.of_xml)(Xml.childxml_arg0"maxResults")inletstatusEquals=(Option.map~f:AsyncInvokeStatus.of_xml)(Xml.childxml_arg0"statusEquals")inletsubmitTimeBefore=(Option.map~f:Timestamp.of_xml)(Xml.childxml_arg0"submitTimeBefore")inletsubmitTimeAfter=(Option.map~f:Timestamp.of_xml)(Xml.childxml_arg0"submitTimeAfter")inmake?sortOrder?sortBy?nextToken?maxResults?statusEquals?submitTimeBefore?submitTimeAfter()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letsortOrder=field_mapjson__"sortOrder"SortOrder.of_jsoninletsortBy=field_mapjson__"sortBy"SortAsyncInvocationBy.of_jsoninletnextToken=field_mapjson__"nextToken"PaginationToken.of_jsoninletmaxResults=field_mapjson__"maxResults"MaxResults.of_jsoninletstatusEquals=field_mapjson__"statusEquals"AsyncInvokeStatus.of_jsoninletsubmitTimeBefore=field_mapjson__"submitTimeBefore"Timestamp.of_jsoninletsubmitTimeAfter=field_mapjson__"submitTimeAfter"Timestamp.of_jsoninmake?sortOrder?sortBy?nextToken?maxResults?statusEquals?submitTimeBefore?submitTimeAfter()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Lists asynchronous invocations."]moduleInvokeModelWithResponseStreamResponse=structtypenonrect={body:ResponseStream.toption[@ocaml.doc"Inference response from the model in the format specified by the contentType header. To see the format and content of this field for different models, refer to Inference parameters."];contentType:MimeType.toption[@ocaml.doc"The MIME type of the inference result."];performanceConfigLatency:PerformanceConfigLatency.toption[@ocaml.doc"Model performance settings for the request."];serviceTier:ServiceTierType.toption[@ocaml.doc"Specifies the processing tier type used for serving the request."]}typenonrecerror=[`AccessDeniedExceptionofAccessDeniedException.t|`InternalServerExceptionofInternalServerException.t|`ModelErrorExceptionofModelErrorException.t|`ModelNotReadyExceptionofModelNotReadyException.t|`ModelStreamErrorExceptionofModelStreamErrorException.t|`ModelTimeoutExceptionofModelTimeoutException.t|`ResourceNotFoundExceptionofResourceNotFoundException.t|`ServiceQuotaExceededExceptionofServiceQuotaExceededException.t|`ServiceUnavailableExceptionofServiceUnavailableException.t|`ThrottlingExceptionofThrottlingException.t|`ValidationExceptionofValidationException.t|`Unknown_operation_errorof(string*stringoption)]letmake?body=fun?contentType->fun?performanceConfigLatency->fun?serviceTier->fun()->{body;contentType;performanceConfigLatency;serviceTier}leterror_of_jsonnamejson=matchnamewith|"AccessDeniedException"->`AccessDeniedException(AccessDeniedException.of_jsonjson)|"InternalServerException"->`InternalServerException(InternalServerException.of_jsonjson)|"ModelErrorException"->`ModelErrorException(ModelErrorException.of_jsonjson)|"ModelNotReadyException"->`ModelNotReadyException(ModelNotReadyException.of_jsonjson)|"ModelStreamErrorException"->`ModelStreamErrorException(ModelStreamErrorException.of_jsonjson)|"ModelTimeoutException"->`ModelTimeoutException(ModelTimeoutException.of_jsonjson)|"ResourceNotFoundException"->`ResourceNotFoundException(ResourceNotFoundException.of_jsonjson)|"ServiceQuotaExceededException"->`ServiceQuotaExceededException(ServiceQuotaExceededException.of_jsonjson)|"ServiceUnavailableException"->`ServiceUnavailableException(ServiceUnavailableException.of_jsonjson)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_jsonjson)|"ValidationException"->`ValidationException(ValidationException.of_jsonjson)|name->`Unknown_operation_error(name,(Some(Yojson.Safe.to_stringjson)))leterror_of_xmlnamexml=matchnamewith|"AccessDeniedException"->`AccessDeniedException(AccessDeniedException.of_xmlxml)|"InternalServerException"->`InternalServerException(InternalServerException.of_xmlxml)|"ModelErrorException"->`ModelErrorException(ModelErrorException.of_xmlxml)|"ModelNotReadyException"->`ModelNotReadyException(ModelNotReadyException.of_xmlxml)|"ModelStreamErrorException"->`ModelStreamErrorException(ModelStreamErrorException.of_xmlxml)|"ModelTimeoutException"->`ModelTimeoutException(ModelTimeoutException.of_xmlxml)|"ResourceNotFoundException"->`ResourceNotFoundException(ResourceNotFoundException.of_xmlxml)|"ServiceQuotaExceededException"->`ServiceQuotaExceededException(ServiceQuotaExceededException.of_xmlxml)|"ServiceUnavailableException"->`ServiceUnavailableException(ServiceUnavailableException.of_xmlxml)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_xmlxml)|"ValidationException"->`ValidationException(ValidationException.of_xmlxml)|name->`Unknown_operation_error(name,(Some(Awso.Xml.to_stringxml)))leterror_to_json:error->Yojson.Safe.t=function|`AccessDeniedExceptione->`Assoc[("error",(`String"AccessDeniedException"));("details",(AccessDeniedException.to_jsone))]|`InternalServerExceptione->`Assoc[("error",(`String"InternalServerException"));("details",(InternalServerException.to_jsone))]|`ModelErrorExceptione->`Assoc[("error",(`String"ModelErrorException"));("details",(ModelErrorException.to_jsone))]|`ModelNotReadyExceptione->`Assoc[("error",(`String"ModelNotReadyException"));("details",(ModelNotReadyException.to_jsone))]|`ModelStreamErrorExceptione->`Assoc[("error",(`String"ModelStreamErrorException"));("details",(ModelStreamErrorException.to_jsone))]|`ModelTimeoutExceptione->`Assoc[("error",(`String"ModelTimeoutException"));("details",(ModelTimeoutException.to_jsone))]|`ResourceNotFoundExceptione->`Assoc[("error",(`String"ResourceNotFoundException"));("details",(ResourceNotFoundException.to_jsone))]|`ServiceQuotaExceededExceptione->`Assoc[("error",(`String"ServiceQuotaExceededException"));("details",(ServiceQuotaExceededException.to_jsone))]|`ServiceUnavailableExceptione->`Assoc[("error",(`String"ServiceUnavailableException"));("details",(ServiceUnavailableException.to_jsone))]|`ThrottlingExceptione->`Assoc[("error",(`String"ThrottlingException"));("details",(ThrottlingException.to_jsone))]|`ValidationExceptione->`Assoc[("error",(`String"ValidationException"));("details",(ValidationException.to_jsone))]|`Unknown_operation_error(code,msg)->`Assoc(("error",(`Stringcode))::((matchmsgwith|None->[]|Somem->[("message",(`Stringm))])))letof_header_and_body=((fun(xs,pipe)->make?body:(Somepipe)?contentType:(Option.map((List.Assoc.find~equal:String.Caseless.equal)xs"X-Amzn-Bedrock-Content-Type")~f:MimeType.of_string)?performanceConfigLatency:(Option.map((List.Assoc.find~equal:String.Caseless.equal)xs"X-Amzn-Bedrock-PerformanceConfig-Latency")~f:PerformanceConfigLatency.of_string)?serviceTier:(Option.map((List.Assoc.find~equal:String.Caseless.equal)xs"X-Amzn-Bedrock-Service-Tier")~f:ServiceTierType.of_string)())[@warning"-27"])letto_valuex=structure_to_value[("body",(Option.mapx.body~f:ResponseStream.to_value));("X-Amzn-Bedrock-Content-Type",(Option.mapx.contentType~f:MimeType.to_value));("X-Amzn-Bedrock-PerformanceConfig-Latency",(Option.mapx.performanceConfigLatency~f:PerformanceConfigLatency.to_value));("X-Amzn-Bedrock-Service-Tier",(Option.mapx.serviceTier~f:ServiceTierType.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letserviceTier=(Option.map~f:ServiceTierType.of_xml)(Xml.childxml_arg0"X-Amzn-Bedrock-Service-Tier")inletperformanceConfigLatency=(Option.map~f:PerformanceConfigLatency.of_xml)(Xml.childxml_arg0"X-Amzn-Bedrock-PerformanceConfig-Latency")inletcontentType=(Option.map~f:MimeType.of_xml)(Xml.childxml_arg0"X-Amzn-Bedrock-Content-Type")inletbody=(Option.map~f:ResponseStream.of_xml)(Xml.childxml_arg0"body")inmake?serviceTier?performanceConfigLatency?contentType?body()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letserviceTier=field_mapjson__"serviceTier"ServiceTierType.of_jsoninletperformanceConfigLatency=field_mapjson__"performanceConfigLatency"PerformanceConfigLatency.of_jsoninletcontentType=field_mapjson__"contentType"MimeType.of_jsoninletbody=field_mapjson__"body"ResponseStream.of_jsoninmake?serviceTier?performanceConfigLatency?contentType?body()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Invoke the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body. The response is returned in a stream. To see if a model supports streaming, call GetFoundationModel and check the responseStreamingSupported field in the response. The CLI doesn't support streaming operations in Amazon Bedrock, including InvokeModelWithResponseStream. For example code, see Invoke model with streaming code example in the Amazon Bedrock User Guide. This operation requires permissions to perform the bedrock:InvokeModelWithResponseStream action. To deny all inference access to resources that you specify in the modelId field, you need to deny access to the bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream actions. Doing this also denies access to the resource through the Converse API actions (Converse and ConverseStream). For more information see Deny access for inference on specific models. For troubleshooting some of the common errors you might encounter when using the InvokeModelWithResponseStream API, see Troubleshooting Amazon Bedrock API Error Codes in the Amazon Bedrock User Guide"]moduleInvokeModelWithResponseStreamRequest=structtypenonrect={body:Body.toption[@ocaml.doc"The prompt and inference parameters in the format specified in the contentType in the header. You must provide the body in JSON format. To see the format and content of the request and response bodies for different models, refer to Inference parameters. For more information, see Run inference in the Bedrock User Guide."];contentType:MimeType.toption[@ocaml.doc"The MIME type of the input data in the request. You must specify application/json."];accept:MimeType.toption[@ocaml.doc"The desired MIME type of the inference body in the response. The default value is application/json."];modelId:InvokeModelIdentifier.t[@ocaml.doc"The unique identifier of the model to invoke to run inference. The modelId to provide depends on the type of model or throughput that you use: If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see Amazon Bedrock base model IDs (on-demand throughput) in the Amazon Bedrock User Guide. If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see Supported Regions and models for cross-region inference in the Amazon Bedrock User Guide. If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see Run inference using a Provisioned Throughput in the Amazon Bedrock User Guide. If you use a custom model, specify the ARN of the custom model deployment (for on-demand inference) or the ARN of your provisioned model (for Provisioned Throughput). For more information, see Use a custom model in Amazon Bedrock in the Amazon Bedrock User Guide. If you use an imported model, specify the ARN of the imported model. You can get the model ARN from a successful call to CreateModelImportJob or from the Imported models page in the Amazon Bedrock console."];trace:Trace.toption[@ocaml.doc"Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace."];guardrailIdentifier:GuardrailIdentifier.toption[@ocaml.doc"The unique identifier of the guardrail that you want to use. If you don't provide a value, no guardrail is applied to the invocation. An error is thrown in the following situations. You don't provide a guardrail identifier but you specify the amazon-bedrock-guardrailConfig field in the request body. You enable the guardrail but the contentType isn't application/json. You provide a guardrail identifier, but guardrailVersion isn't specified."];guardrailVersion:GuardrailVersion.toption[@ocaml.doc"The version number for the guardrail. The value can also be DRAFT."];performanceConfigLatency:PerformanceConfigLatency.toption[@ocaml.doc"Model performance settings for the request."];serviceTier:ServiceTierType.toption[@ocaml.doc"Specifies the processing tier type used for serving the request."]}letcontext_="InvokeModelWithResponseStreamRequest"letmake?body=fun?contentType->fun?accept->fun?trace->fun?guardrailIdentifier->fun?guardrailVersion->fun?performanceConfigLatency->fun?serviceTier->fun~modelId->fun()->{body;contentType;accept;trace;guardrailIdentifier;guardrailVersion;performanceConfigLatency;serviceTier;modelId}letof_header_and_body=((fun(xs,pipe)->make?body:(Somepipe)?contentType:(Option.map((List.Assoc.find~equal:String.Caseless.equal)xs"Content-Type")~f:MimeType.of_string)?accept:(Option.map((List.Assoc.find~equal:String.Caseless.equal)xs"X-Amzn-Bedrock-Accept")~f:MimeType.of_string)~modelId:(InvokeModelIdentifier.of_string((List.Assoc.find_exn~equal:String.Caseless.equal)xs"modelId"))?trace:(Option.map((List.Assoc.find~equal:String.Caseless.equal)xs"X-Amzn-Bedrock-Trace")~f:Trace.of_string)?guardrailIdentifier:(Option.map((List.Assoc.find~equal:String.Caseless.equal)xs"X-Amzn-Bedrock-GuardrailIdentifier")~f:GuardrailIdentifier.of_string)?guardrailVersion:(Option.map((List.Assoc.find~equal:String.Caseless.equal)xs"X-Amzn-Bedrock-GuardrailVersion")~f:GuardrailVersion.of_string)?performanceConfigLatency:(Option.map((List.Assoc.find~equal:String.Caseless.equal)xs"X-Amzn-Bedrock-PerformanceConfig-Latency")~f:PerformanceConfigLatency.of_string)?serviceTier:(Option.map((List.Assoc.find~equal:String.Caseless.equal)xs"X-Amzn-Bedrock-Service-Tier")~f:ServiceTierType.of_string)())[@warning"-27"])letto_valuex=structure_to_value[("body",(Option.mapx.body~f:Body.to_value));("Content-Type",(Option.mapx.contentType~f:MimeType.to_value));("X-Amzn-Bedrock-Accept",(Option.mapx.accept~f:MimeType.to_value));("modelId",(Some(InvokeModelIdentifier.to_valuex.modelId)));("X-Amzn-Bedrock-Trace",(Option.mapx.trace~f:Trace.to_value));("X-Amzn-Bedrock-GuardrailIdentifier",(Option.mapx.guardrailIdentifier~f:GuardrailIdentifier.to_value));("X-Amzn-Bedrock-GuardrailVersion",(Option.mapx.guardrailVersion~f:GuardrailVersion.to_value));("X-Amzn-Bedrock-PerformanceConfig-Latency",(Option.mapx.performanceConfigLatency~f:PerformanceConfigLatency.to_value));("X-Amzn-Bedrock-Service-Tier",(Option.mapx.serviceTier~f:ServiceTierType.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letserviceTier=(Option.map~f:ServiceTierType.of_xml)(Xml.childxml_arg0"X-Amzn-Bedrock-Service-Tier")inletperformanceConfigLatency=(Option.map~f:PerformanceConfigLatency.of_xml)(Xml.childxml_arg0"X-Amzn-Bedrock-PerformanceConfig-Latency")inletguardrailVersion=(Option.map~f:GuardrailVersion.of_xml)(Xml.childxml_arg0"X-Amzn-Bedrock-GuardrailVersion")inletguardrailIdentifier=(Option.map~f:GuardrailIdentifier.of_xml)(Xml.childxml_arg0"X-Amzn-Bedrock-GuardrailIdentifier")inlettrace=(Option.map~f:Trace.of_xml)(Xml.childxml_arg0"X-Amzn-Bedrock-Trace")inletmodelId=InvokeModelIdentifier.of_xml(Xml.child_exn~context:context_xml_arg0"modelId")inletaccept=(Option.map~f:MimeType.of_xml)(Xml.childxml_arg0"X-Amzn-Bedrock-Accept")inletcontentType=(Option.map~f:MimeType.of_xml)(Xml.childxml_arg0"Content-Type")inletbody=(Option.map~f:Body.of_xml)(Xml.childxml_arg0"body")inmake?serviceTier?performanceConfigLatency?guardrailVersion?guardrailIdentifier?trace~modelId?accept?contentType?body()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letserviceTier=field_mapjson__"serviceTier"ServiceTierType.of_jsoninletperformanceConfigLatency=field_mapjson__"performanceConfigLatency"PerformanceConfigLatency.of_jsoninletguardrailVersion=field_mapjson__"guardrailVersion"GuardrailVersion.of_jsoninletguardrailIdentifier=field_mapjson__"guardrailIdentifier"GuardrailIdentifier.of_jsoninlettrace=field_mapjson__"trace"Trace.of_jsoninletmodelId=field_map_exnjson__"modelId"InvokeModelIdentifier.of_jsoninletaccept=field_mapjson__"accept"MimeType.of_jsoninletcontentType=field_mapjson__"contentType"MimeType.of_jsoninletbody=field_mapjson__"body"Body.of_jsoninmake?serviceTier?performanceConfigLatency?guardrailVersion?guardrailIdentifier?trace~modelId?accept?contentType?body()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Invoke the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body. The response is returned in a stream. To see if a model supports streaming, call GetFoundationModel and check the responseStreamingSupported field in the response. The CLI doesn't support streaming operations in Amazon Bedrock, including InvokeModelWithResponseStream. For example code, see Invoke model with streaming code example in the Amazon Bedrock User Guide. This operation requires permissions to perform the bedrock:InvokeModelWithResponseStream action. To deny all inference access to resources that you specify in the modelId field, you need to deny access to the bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream actions. Doing this also denies access to the resource through the Converse API actions (Converse and ConverseStream). For more information see Deny access for inference on specific models. For troubleshooting some of the common errors you might encounter when using the InvokeModelWithResponseStream API, see Troubleshooting Amazon Bedrock API Error Codes in the Amazon Bedrock User Guide"]moduleInvokeModelWithBidirectionalStreamResponse=structtypenonrect={body:InvokeModelWithBidirectionalStreamOutput.toption[@ocaml.doc"Streaming response from the model in the format specified by the BidirectionalOutputPayloadPart header."]}typenonrecerror=[`AccessDeniedExceptionofAccessDeniedException.t|`InternalServerExceptionofInternalServerException.t|`ModelErrorExceptionofModelErrorException.t|`ModelNotReadyExceptionofModelNotReadyException.t|`ModelStreamErrorExceptionofModelStreamErrorException.t|`ModelTimeoutExceptionofModelTimeoutException.t|`ResourceNotFoundExceptionofResourceNotFoundException.t|`ServiceQuotaExceededExceptionofServiceQuotaExceededException.t|`ServiceUnavailableExceptionofServiceUnavailableException.t|`ThrottlingExceptionofThrottlingException.t|`ValidationExceptionofValidationException.t|`Unknown_operation_errorof(string*stringoption)]letmake?body=fun()->{body}leterror_of_jsonnamejson=matchnamewith|"AccessDeniedException"->`AccessDeniedException(AccessDeniedException.of_jsonjson)|"InternalServerException"->`InternalServerException(InternalServerException.of_jsonjson)|"ModelErrorException"->`ModelErrorException(ModelErrorException.of_jsonjson)|"ModelNotReadyException"->`ModelNotReadyException(ModelNotReadyException.of_jsonjson)|"ModelStreamErrorException"->`ModelStreamErrorException(ModelStreamErrorException.of_jsonjson)|"ModelTimeoutException"->`ModelTimeoutException(ModelTimeoutException.of_jsonjson)|"ResourceNotFoundException"->`ResourceNotFoundException(ResourceNotFoundException.of_jsonjson)|"ServiceQuotaExceededException"->`ServiceQuotaExceededException(ServiceQuotaExceededException.of_jsonjson)|"ServiceUnavailableException"->`ServiceUnavailableException(ServiceUnavailableException.of_jsonjson)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_jsonjson)|"ValidationException"->`ValidationException(ValidationException.of_jsonjson)|name->`Unknown_operation_error(name,(Some(Yojson.Safe.to_stringjson)))leterror_of_xmlnamexml=matchnamewith|"AccessDeniedException"->`AccessDeniedException(AccessDeniedException.of_xmlxml)|"InternalServerException"->`InternalServerException(InternalServerException.of_xmlxml)|"ModelErrorException"->`ModelErrorException(ModelErrorException.of_xmlxml)|"ModelNotReadyException"->`ModelNotReadyException(ModelNotReadyException.of_xmlxml)|"ModelStreamErrorException"->`ModelStreamErrorException(ModelStreamErrorException.of_xmlxml)|"ModelTimeoutException"->`ModelTimeoutException(ModelTimeoutException.of_xmlxml)|"ResourceNotFoundException"->`ResourceNotFoundException(ResourceNotFoundException.of_xmlxml)|"ServiceQuotaExceededException"->`ServiceQuotaExceededException(ServiceQuotaExceededException.of_xmlxml)|"ServiceUnavailableException"->`ServiceUnavailableException(ServiceUnavailableException.of_xmlxml)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_xmlxml)|"ValidationException"->`ValidationException(ValidationException.of_xmlxml)|name->`Unknown_operation_error(name,(Some(Awso.Xml.to_stringxml)))leterror_to_json:error->Yojson.Safe.t=function|`AccessDeniedExceptione->`Assoc[("error",(`String"AccessDeniedException"));("details",(AccessDeniedException.to_jsone))]|`InternalServerExceptione->`Assoc[("error",(`String"InternalServerException"));("details",(InternalServerException.to_jsone))]|`ModelErrorExceptione->`Assoc[("error",(`String"ModelErrorException"));("details",(ModelErrorException.to_jsone))]|`ModelNotReadyExceptione->`Assoc[("error",(`String"ModelNotReadyException"));("details",(ModelNotReadyException.to_jsone))]|`ModelStreamErrorExceptione->`Assoc[("error",(`String"ModelStreamErrorException"));("details",(ModelStreamErrorException.to_jsone))]|`ModelTimeoutExceptione->`Assoc[("error",(`String"ModelTimeoutException"));("details",(ModelTimeoutException.to_jsone))]|`ResourceNotFoundExceptione->`Assoc[("error",(`String"ResourceNotFoundException"));("details",(ResourceNotFoundException.to_jsone))]|`ServiceQuotaExceededExceptione->`Assoc[("error",(`String"ServiceQuotaExceededException"));("details",(ServiceQuotaExceededException.to_jsone))]|`ServiceUnavailableExceptione->`Assoc[("error",(`String"ServiceUnavailableException"));("details",(ServiceUnavailableException.to_jsone))]|`ThrottlingExceptione->`Assoc[("error",(`String"ThrottlingException"));("details",(ThrottlingException.to_jsone))]|`ValidationExceptione->`Assoc[("error",(`String"ValidationException"));("details",(ValidationException.to_jsone))]|`Unknown_operation_error(code,msg)->`Assoc(("error",(`Stringcode))::((matchmsgwith|None->[]|Somem->[("message",(`Stringm))])))letof_header_and_body=((fun(xs,pipe)->make?body:(Somepipe)())[@warning"-27"])letto_valuex=structure_to_value[("body",(Option.mapx.body~f:InvokeModelWithBidirectionalStreamOutput.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letbody=(Option.map~f:InvokeModelWithBidirectionalStreamOutput.of_xml)(Xml.childxml_arg0"body")inmake?body()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letbody=field_mapjson__"body"InvokeModelWithBidirectionalStreamOutput.of_jsoninmake?body()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Invoke the specified Amazon Bedrock model to run inference using the bidirectional stream. The response is returned in a stream that remains open for 8 minutes. A single session can contain multiple prompts and responses from the model. The prompts to the model are provided as audio files and the model's responses are spoken back to the user and transcribed. It is possible for users to interrupt the model's response with a new prompt, which will halt the response speech. The model will retain contextual awareness of the conversation while pivoting to respond to the new prompt."]moduleInvokeModelWithBidirectionalStreamRequest=structtypenonrect={modelId:InvokeModelIdentifier.t[@ocaml.doc"The model ID or ARN of the model ID to use. Currently, only amazon.nova-sonic-v1:0 is supported."];body:InvokeModelWithBidirectionalStreamInput.t[@ocaml.doc"The prompt and inference parameters in the format specified in the BidirectionalInputPayloadPart in the header. You must provide the body in JSON format. To see the format and content of the request and response bodies for different models, refer to Inference parameters. For more information, see Run inference in the Bedrock User Guide."]}letcontext_="InvokeModelWithBidirectionalStreamRequest"letmake~modelId=fun~body->fun()->{modelId;body}letof_header_and_body=((fun(xs,pipe)->make~modelId:(InvokeModelIdentifier.of_string((List.Assoc.find_exn~equal:String.Caseless.equal)xs"modelId"))~body:pipe())[@warning"-27"])letto_valuex=structure_to_value[("modelId",(Some(InvokeModelIdentifier.to_valuex.modelId)));("body",(Some(InvokeModelWithBidirectionalStreamInput.to_valuex.body)))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letbody=InvokeModelWithBidirectionalStreamInput.of_xml(Xml.child_exn~context:context_xml_arg0"body")inletmodelId=InvokeModelIdentifier.of_xml(Xml.child_exn~context:context_xml_arg0"modelId")inmake~body~modelId()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letbody=field_map_exnjson__"body"InvokeModelWithBidirectionalStreamInput.of_jsoninletmodelId=field_map_exnjson__"modelId"InvokeModelIdentifier.of_jsoninmake~body~modelId()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Invoke the specified Amazon Bedrock model to run inference using the bidirectional stream. The response is returned in a stream that remains open for 8 minutes. A single session can contain multiple prompts and responses from the model. The prompts to the model are provided as audio files and the model's responses are spoken back to the user and transcribed. It is possible for users to interrupt the model's response with a new prompt, which will halt the response speech. The model will retain contextual awareness of the conversation while pivoting to respond to the new prompt."]moduleInvokeModelResponse=structtypenonrect={body:Body.toption[@ocaml.doc"Inference response from the model in the format specified in the contentType header. To see the format and content of the request and response bodies for different models, refer to Inference parameters."];contentType:MimeType.toption[@ocaml.doc"The MIME type of the inference result."];performanceConfigLatency:PerformanceConfigLatency.toption[@ocaml.doc"Model performance settings for the request."];serviceTier:ServiceTierType.toption[@ocaml.doc"Specifies the processing tier type used for serving the request."]}typenonrecerror=[`AccessDeniedExceptionofAccessDeniedException.t|`InternalServerExceptionofInternalServerException.t|`ModelErrorExceptionofModelErrorException.t|`ModelNotReadyExceptionofModelNotReadyException.t|`ModelTimeoutExceptionofModelTimeoutException.t|`ResourceNotFoundExceptionofResourceNotFoundException.t|`ServiceQuotaExceededExceptionofServiceQuotaExceededException.t|`ServiceUnavailableExceptionofServiceUnavailableException.t|`ThrottlingExceptionofThrottlingException.t|`ValidationExceptionofValidationException.t|`Unknown_operation_errorof(string*stringoption)]letmake?body=fun?contentType->fun?performanceConfigLatency->fun?serviceTier->fun()->{body;contentType;performanceConfigLatency;serviceTier}leterror_of_jsonnamejson=matchnamewith|"AccessDeniedException"->`AccessDeniedException(AccessDeniedException.of_jsonjson)|"InternalServerException"->`InternalServerException(InternalServerException.of_jsonjson)|"ModelErrorException"->`ModelErrorException(ModelErrorException.of_jsonjson)|"ModelNotReadyException"->`ModelNotReadyException(ModelNotReadyException.of_jsonjson)|"ModelTimeoutException"->`ModelTimeoutException(ModelTimeoutException.of_jsonjson)|"ResourceNotFoundException"->`ResourceNotFoundException(ResourceNotFoundException.of_jsonjson)|"ServiceQuotaExceededException"->`ServiceQuotaExceededException(ServiceQuotaExceededException.of_jsonjson)|"ServiceUnavailableException"->`ServiceUnavailableException(ServiceUnavailableException.of_jsonjson)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_jsonjson)|"ValidationException"->`ValidationException(ValidationException.of_jsonjson)|name->`Unknown_operation_error(name,(Some(Yojson.Safe.to_stringjson)))leterror_of_xmlnamexml=matchnamewith|"AccessDeniedException"->`AccessDeniedException(AccessDeniedException.of_xmlxml)|"InternalServerException"->`InternalServerException(InternalServerException.of_xmlxml)|"ModelErrorException"->`ModelErrorException(ModelErrorException.of_xmlxml)|"ModelNotReadyException"->`ModelNotReadyException(ModelNotReadyException.of_xmlxml)|"ModelTimeoutException"->`ModelTimeoutException(ModelTimeoutException.of_xmlxml)|"ResourceNotFoundException"->`ResourceNotFoundException(ResourceNotFoundException.of_xmlxml)|"ServiceQuotaExceededException"->`ServiceQuotaExceededException(ServiceQuotaExceededException.of_xmlxml)|"ServiceUnavailableException"->`ServiceUnavailableException(ServiceUnavailableException.of_xmlxml)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_xmlxml)|"ValidationException"->`ValidationException(ValidationException.of_xmlxml)|name->`Unknown_operation_error(name,(Some(Awso.Xml.to_stringxml)))leterror_to_json:error->Yojson.Safe.t=function|`AccessDeniedExceptione->`Assoc[("error",(`String"AccessDeniedException"));("details",(AccessDeniedException.to_jsone))]|`InternalServerExceptione->`Assoc[("error",(`String"InternalServerException"));("details",(InternalServerException.to_jsone))]|`ModelErrorExceptione->`Assoc[("error",(`String"ModelErrorException"));("details",(ModelErrorException.to_jsone))]|`ModelNotReadyExceptione->`Assoc[("error",(`String"ModelNotReadyException"));("details",(ModelNotReadyException.to_jsone))]|`ModelTimeoutExceptione->`Assoc[("error",(`String"ModelTimeoutException"));("details",(ModelTimeoutException.to_jsone))]|`ResourceNotFoundExceptione->`Assoc[("error",(`String"ResourceNotFoundException"));("details",(ResourceNotFoundException.to_jsone))]|`ServiceQuotaExceededExceptione->`Assoc[("error",(`String"ServiceQuotaExceededException"));("details",(ServiceQuotaExceededException.to_jsone))]|`ServiceUnavailableExceptione->`Assoc[("error",(`String"ServiceUnavailableException"));("details",(ServiceUnavailableException.to_jsone))]|`ThrottlingExceptione->`Assoc[("error",(`String"ThrottlingException"));("details",(ThrottlingException.to_jsone))]|`ValidationExceptione->`Assoc[("error",(`String"ValidationException"));("details",(ValidationException.to_jsone))]|`Unknown_operation_error(code,msg)->`Assoc(("error",(`Stringcode))::((matchmsgwith|None->[]|Somem->[("message",(`Stringm))])))letof_header_and_body=((fun(xs,pipe)->make?body:(Somepipe)?contentType:(Option.map((List.Assoc.find~equal:String.Caseless.equal)xs"Content-Type")~f:MimeType.of_string)?performanceConfigLatency:(Option.map((List.Assoc.find~equal:String.Caseless.equal)xs"X-Amzn-Bedrock-PerformanceConfig-Latency")~f:PerformanceConfigLatency.of_string)?serviceTier:(Option.map((List.Assoc.find~equal:String.Caseless.equal)xs"X-Amzn-Bedrock-Service-Tier")~f:ServiceTierType.of_string)())[@warning"-27"])letto_valuex=structure_to_value[("body",(Option.mapx.body~f:Body.to_value));("Content-Type",(Option.mapx.contentType~f:MimeType.to_value));("X-Amzn-Bedrock-PerformanceConfig-Latency",(Option.mapx.performanceConfigLatency~f:PerformanceConfigLatency.to_value));("X-Amzn-Bedrock-Service-Tier",(Option.mapx.serviceTier~f:ServiceTierType.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letserviceTier=(Option.map~f:ServiceTierType.of_xml)(Xml.childxml_arg0"X-Amzn-Bedrock-Service-Tier")inletperformanceConfigLatency=(Option.map~f:PerformanceConfigLatency.of_xml)(Xml.childxml_arg0"X-Amzn-Bedrock-PerformanceConfig-Latency")inletcontentType=(Option.map~f:MimeType.of_xml)(Xml.childxml_arg0"Content-Type")inletbody=(Option.map~f:Body.of_xml)(Xml.childxml_arg0"body")inmake?serviceTier?performanceConfigLatency?contentType?body()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letserviceTier=field_mapjson__"serviceTier"ServiceTierType.of_jsoninletperformanceConfigLatency=field_mapjson__"performanceConfigLatency"PerformanceConfigLatency.of_jsoninletcontentType=field_mapjson__"contentType"MimeType.of_jsoninletbody=field_mapjson__"body"Body.of_jsoninmake?serviceTier?performanceConfigLatency?contentType?body()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Invokes the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body. You use model inference to generate text, images, and embeddings. For example code, see Invoke model code examples in the Amazon Bedrock User Guide. This operation requires permission for the bedrock:InvokeModel action. To deny all inference access to resources that you specify in the modelId field, you need to deny access to the bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream actions. Doing this also denies access to the resource through the Converse API actions (Converse and ConverseStream). For more information see Deny access for inference on specific models. For troubleshooting some of the common errors you might encounter when using the InvokeModel API, see Troubleshooting Amazon Bedrock API Error Codes in the Amazon Bedrock User Guide"]moduleInvokeModelRequest=structtypenonrect={body:Body.toption[@ocaml.doc"The prompt and inference parameters in the format specified in the contentType in the header. You must provide the body in JSON format. To see the format and content of the request and response bodies for different models, refer to Inference parameters. For more information, see Run inference in the Bedrock User Guide."];contentType:MimeType.toption[@ocaml.doc"The MIME type of the input data in the request. You must specify application/json."];accept:MimeType.toption[@ocaml.doc"The desired MIME type of the inference body in the response. The default value is application/json."];modelId:InvokeModelIdentifier.t[@ocaml.doc"The unique identifier of the model to invoke to run inference. The modelId to provide depends on the type of model or throughput that you use: If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see Amazon Bedrock base model IDs (on-demand throughput) in the Amazon Bedrock User Guide. If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see Supported Regions and models for cross-region inference in the Amazon Bedrock User Guide. If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see Run inference using a Provisioned Throughput in the Amazon Bedrock User Guide. If you use a custom model, specify the ARN of the custom model deployment (for on-demand inference) or the ARN of your provisioned model (for Provisioned Throughput). For more information, see Use a custom model in Amazon Bedrock in the Amazon Bedrock User Guide. If you use an imported model, specify the ARN of the imported model. You can get the model ARN from a successful call to CreateModelImportJob or from the Imported models page in the Amazon Bedrock console."];trace:Trace.toption[@ocaml.doc"Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace."];guardrailIdentifier:GuardrailIdentifier.toption[@ocaml.doc"The unique identifier of the guardrail that you want to use. If you don't provide a value, no guardrail is applied to the invocation. An error will be thrown in the following situations. You don't provide a guardrail identifier but you specify the amazon-bedrock-guardrailConfig field in the request body. You enable the guardrail but the contentType isn't application/json. You provide a guardrail identifier, but guardrailVersion isn't specified."];guardrailVersion:GuardrailVersion.toption[@ocaml.doc"The version number for the guardrail. The value can also be DRAFT."];performanceConfigLatency:PerformanceConfigLatency.toption[@ocaml.doc"Model performance settings for the request."];serviceTier:ServiceTierType.toption[@ocaml.doc"Specifies the processing tier type used for serving the request."]}letcontext_="InvokeModelRequest"letmake?body=fun?contentType->fun?accept->fun?trace->fun?guardrailIdentifier->fun?guardrailVersion->fun?performanceConfigLatency->fun?serviceTier->fun~modelId->fun()->{body;contentType;accept;trace;guardrailIdentifier;guardrailVersion;performanceConfigLatency;serviceTier;modelId}letof_header_and_body=((fun(xs,pipe)->make?body:(Somepipe)?contentType:(Option.map((List.Assoc.find~equal:String.Caseless.equal)xs"Content-Type")~f:MimeType.of_string)?accept:(Option.map((List.Assoc.find~equal:String.Caseless.equal)xs"Accept")~f:MimeType.of_string)~modelId:(InvokeModelIdentifier.of_string((List.Assoc.find_exn~equal:String.Caseless.equal)xs"modelId"))?trace:(Option.map((List.Assoc.find~equal:String.Caseless.equal)xs"X-Amzn-Bedrock-Trace")~f:Trace.of_string)?guardrailIdentifier:(Option.map((List.Assoc.find~equal:String.Caseless.equal)xs"X-Amzn-Bedrock-GuardrailIdentifier")~f:GuardrailIdentifier.of_string)?guardrailVersion:(Option.map((List.Assoc.find~equal:String.Caseless.equal)xs"X-Amzn-Bedrock-GuardrailVersion")~f:GuardrailVersion.of_string)?performanceConfigLatency:(Option.map((List.Assoc.find~equal:String.Caseless.equal)xs"X-Amzn-Bedrock-PerformanceConfig-Latency")~f:PerformanceConfigLatency.of_string)?serviceTier:(Option.map((List.Assoc.find~equal:String.Caseless.equal)xs"X-Amzn-Bedrock-Service-Tier")~f:ServiceTierType.of_string)())[@warning"-27"])letto_valuex=structure_to_value[("body",(Option.mapx.body~f:Body.to_value));("Content-Type",(Option.mapx.contentType~f:MimeType.to_value));("Accept",(Option.mapx.accept~f:MimeType.to_value));("modelId",(Some(InvokeModelIdentifier.to_valuex.modelId)));("X-Amzn-Bedrock-Trace",(Option.mapx.trace~f:Trace.to_value));("X-Amzn-Bedrock-GuardrailIdentifier",(Option.mapx.guardrailIdentifier~f:GuardrailIdentifier.to_value));("X-Amzn-Bedrock-GuardrailVersion",(Option.mapx.guardrailVersion~f:GuardrailVersion.to_value));("X-Amzn-Bedrock-PerformanceConfig-Latency",(Option.mapx.performanceConfigLatency~f:PerformanceConfigLatency.to_value));("X-Amzn-Bedrock-Service-Tier",(Option.mapx.serviceTier~f:ServiceTierType.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letserviceTier=(Option.map~f:ServiceTierType.of_xml)(Xml.childxml_arg0"X-Amzn-Bedrock-Service-Tier")inletperformanceConfigLatency=(Option.map~f:PerformanceConfigLatency.of_xml)(Xml.childxml_arg0"X-Amzn-Bedrock-PerformanceConfig-Latency")inletguardrailVersion=(Option.map~f:GuardrailVersion.of_xml)(Xml.childxml_arg0"X-Amzn-Bedrock-GuardrailVersion")inletguardrailIdentifier=(Option.map~f:GuardrailIdentifier.of_xml)(Xml.childxml_arg0"X-Amzn-Bedrock-GuardrailIdentifier")inlettrace=(Option.map~f:Trace.of_xml)(Xml.childxml_arg0"X-Amzn-Bedrock-Trace")inletmodelId=InvokeModelIdentifier.of_xml(Xml.child_exn~context:context_xml_arg0"modelId")inletaccept=(Option.map~f:MimeType.of_xml)(Xml.childxml_arg0"Accept")inletcontentType=(Option.map~f:MimeType.of_xml)(Xml.childxml_arg0"Content-Type")inletbody=(Option.map~f:Body.of_xml)(Xml.childxml_arg0"body")inmake?serviceTier?performanceConfigLatency?guardrailVersion?guardrailIdentifier?trace~modelId?accept?contentType?body()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letserviceTier=field_mapjson__"serviceTier"ServiceTierType.of_jsoninletperformanceConfigLatency=field_mapjson__"performanceConfigLatency"PerformanceConfigLatency.of_jsoninletguardrailVersion=field_mapjson__"guardrailVersion"GuardrailVersion.of_jsoninletguardrailIdentifier=field_mapjson__"guardrailIdentifier"GuardrailIdentifier.of_jsoninlettrace=field_mapjson__"trace"Trace.of_jsoninletmodelId=field_map_exnjson__"modelId"InvokeModelIdentifier.of_jsoninletaccept=field_mapjson__"accept"MimeType.of_jsoninletcontentType=field_mapjson__"contentType"MimeType.of_jsoninletbody=field_mapjson__"body"Body.of_jsoninmake?serviceTier?performanceConfigLatency?guardrailVersion?guardrailIdentifier?trace~modelId?accept?contentType?body()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Invokes the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body. You use model inference to generate text, images, and embeddings. For example code, see Invoke model code examples in the Amazon Bedrock User Guide. This operation requires permission for the bedrock:InvokeModel action. To deny all inference access to resources that you specify in the modelId field, you need to deny access to the bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream actions. Doing this also denies access to the resource through the Converse API actions (Converse and ConverseStream). For more information see Deny access for inference on specific models. For troubleshooting some of the common errors you might encounter when using the InvokeModel API, see Troubleshooting Amazon Bedrock API Error Codes in the Amazon Bedrock User Guide"]moduleGetAsyncInvokeResponse=structtypenonrect={invocationArn:InvocationArn.toption[@ocaml.doc"The invocation's ARN."];modelArn:AsyncInvokeArn.toption[@ocaml.doc"The invocation's model ARN."];clientRequestToken:AsyncInvokeIdempotencyToken.toption[@ocaml.doc"The invocation's idempotency token."];status:AsyncInvokeStatus.toption[@ocaml.doc"The invocation's status."];failureMessage:AsyncInvokeMessage.toption[@ocaml.doc"An error message."];submitTime:Timestamp.toption[@ocaml.doc"When the invocation request was submitted."];lastModifiedTime:Timestamp.toption[@ocaml.doc"The invocation's last modified time."];endTime:Timestamp.toption[@ocaml.doc"When the invocation ended."];outputDataConfig:AsyncInvokeOutputDataConfig.toption[@ocaml.doc"Output data settings."]}typenonrecerror=[`AccessDeniedExceptionofAccessDeniedException.t|`InternalServerExceptionofInternalServerException.t|`ThrottlingExceptionofThrottlingException.t|`ValidationExceptionofValidationException.t|`Unknown_operation_errorof(string*stringoption)]letmake?invocationArn=fun?modelArn->fun?clientRequestToken->fun?status->fun?failureMessage->fun?submitTime->fun?lastModifiedTime->fun?endTime->fun?outputDataConfig->fun()->{invocationArn;modelArn;clientRequestToken;status;failureMessage;submitTime;lastModifiedTime;endTime;outputDataConfig}leterror_of_jsonnamejson=matchnamewith|"AccessDeniedException"->`AccessDeniedException(AccessDeniedException.of_jsonjson)|"InternalServerException"->`InternalServerException(InternalServerException.of_jsonjson)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_jsonjson)|"ValidationException"->`ValidationException(ValidationException.of_jsonjson)|name->`Unknown_operation_error(name,(Some(Yojson.Safe.to_stringjson)))leterror_of_xmlnamexml=matchnamewith|"AccessDeniedException"->`AccessDeniedException(AccessDeniedException.of_xmlxml)|"InternalServerException"->`InternalServerException(InternalServerException.of_xmlxml)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_xmlxml)|"ValidationException"->`ValidationException(ValidationException.of_xmlxml)|name->`Unknown_operation_error(name,(Some(Awso.Xml.to_stringxml)))leterror_to_json:error->Yojson.Safe.t=function|`AccessDeniedExceptione->`Assoc[("error",(`String"AccessDeniedException"));("details",(AccessDeniedException.to_jsone))]|`InternalServerExceptione->`Assoc[("error",(`String"InternalServerException"));("details",(InternalServerException.to_jsone))]|`ThrottlingExceptione->`Assoc[("error",(`String"ThrottlingException"));("details",(ThrottlingException.to_jsone))]|`ValidationExceptione->`Assoc[("error",(`String"ValidationException"));("details",(ValidationException.to_jsone))]|`Unknown_operation_error(code,msg)->`Assoc(("error",(`Stringcode))::((matchmsgwith|None->[]|Somem->[("message",(`Stringm))])))letto_valuex=structure_to_value[("invocationArn",(Option.mapx.invocationArn~f:InvocationArn.to_value));("modelArn",(Option.mapx.modelArn~f:AsyncInvokeArn.to_value));("clientRequestToken",(Option.mapx.clientRequestToken~f:AsyncInvokeIdempotencyToken.to_value));("status",(Option.mapx.status~f:AsyncInvokeStatus.to_value));("failureMessage",(Option.mapx.failureMessage~f:AsyncInvokeMessage.to_value));("submitTime",(Option.mapx.submitTime~f:Timestamp.to_value));("lastModifiedTime",(Option.mapx.lastModifiedTime~f:Timestamp.to_value));("endTime",(Option.mapx.endTime~f:Timestamp.to_value));("outputDataConfig",(Option.mapx.outputDataConfig~f:AsyncInvokeOutputDataConfig.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letoutputDataConfig=(Option.map~f:AsyncInvokeOutputDataConfig.of_xml)(Xml.childxml_arg0"outputDataConfig")inletendTime=(Option.map~f:Timestamp.of_xml)(Xml.childxml_arg0"endTime")inletlastModifiedTime=(Option.map~f:Timestamp.of_xml)(Xml.childxml_arg0"lastModifiedTime")inletsubmitTime=(Option.map~f:Timestamp.of_xml)(Xml.childxml_arg0"submitTime")inletfailureMessage=(Option.map~f:AsyncInvokeMessage.of_xml)(Xml.childxml_arg0"failureMessage")inletstatus=(Option.map~f:AsyncInvokeStatus.of_xml)(Xml.childxml_arg0"status")inletclientRequestToken=(Option.map~f:AsyncInvokeIdempotencyToken.of_xml)(Xml.childxml_arg0"clientRequestToken")inletmodelArn=(Option.map~f:AsyncInvokeArn.of_xml)(Xml.childxml_arg0"modelArn")inletinvocationArn=(Option.map~f:InvocationArn.of_xml)(Xml.childxml_arg0"invocationArn")inmake?outputDataConfig?endTime?lastModifiedTime?submitTime?failureMessage?status?clientRequestToken?modelArn?invocationArn()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letoutputDataConfig=field_mapjson__"outputDataConfig"AsyncInvokeOutputDataConfig.of_jsoninletendTime=field_mapjson__"endTime"Timestamp.of_jsoninletlastModifiedTime=field_mapjson__"lastModifiedTime"Timestamp.of_jsoninletsubmitTime=field_mapjson__"submitTime"Timestamp.of_jsoninletfailureMessage=field_mapjson__"failureMessage"AsyncInvokeMessage.of_jsoninletstatus=field_mapjson__"status"AsyncInvokeStatus.of_jsoninletclientRequestToken=field_mapjson__"clientRequestToken"AsyncInvokeIdempotencyToken.of_jsoninletmodelArn=field_mapjson__"modelArn"AsyncInvokeArn.of_jsoninletinvocationArn=field_mapjson__"invocationArn"InvocationArn.of_jsoninmake?outputDataConfig?endTime?lastModifiedTime?submitTime?failureMessage?status?clientRequestToken?modelArn?invocationArn()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Retrieve information about an asynchronous invocation."]moduleGetAsyncInvokeRequest=structtypenonrect={invocationArn:InvocationArn.t[@ocaml.doc"The invocation's ARN."]}letcontext_="GetAsyncInvokeRequest"letmake~invocationArn=fun()->{invocationArn}letto_valuex=structure_to_value[("invocationArn",(Some(InvocationArn.to_valuex.invocationArn)))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letinvocationArn=InvocationArn.of_xml(Xml.child_exn~context:context_xml_arg0"invocationArn")inmake~invocationArn()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letinvocationArn=field_map_exnjson__"invocationArn"InvocationArn.of_jsoninmake~invocationArn()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Retrieve information about an asynchronous invocation."]moduleCountTokensResponse=structtypenonrect={inputTokens:Integer.toption[@ocaml.doc"The number of tokens in the provided input according to the specified model's tokenization rules. This count represents the number of input tokens that would be processed if the same input were sent to the model in an inference request. Use this value to estimate costs and ensure your inputs stay within model token limits."]}typenonrecerror=[`AccessDeniedExceptionofAccessDeniedException.t|`InternalServerExceptionofInternalServerException.t|`ResourceNotFoundExceptionofResourceNotFoundException.t|`ServiceUnavailableExceptionofServiceUnavailableException.t|`ThrottlingExceptionofThrottlingException.t|`ValidationExceptionofValidationException.t|`Unknown_operation_errorof(string*stringoption)]letmake?inputTokens=fun()->{inputTokens}leterror_of_jsonnamejson=matchnamewith|"AccessDeniedException"->`AccessDeniedException(AccessDeniedException.of_jsonjson)|"InternalServerException"->`InternalServerException(InternalServerException.of_jsonjson)|"ResourceNotFoundException"->`ResourceNotFoundException(ResourceNotFoundException.of_jsonjson)|"ServiceUnavailableException"->`ServiceUnavailableException(ServiceUnavailableException.of_jsonjson)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_jsonjson)|"ValidationException"->`ValidationException(ValidationException.of_jsonjson)|name->`Unknown_operation_error(name,(Some(Yojson.Safe.to_stringjson)))leterror_of_xmlnamexml=matchnamewith|"AccessDeniedException"->`AccessDeniedException(AccessDeniedException.of_xmlxml)|"InternalServerException"->`InternalServerException(InternalServerException.of_xmlxml)|"ResourceNotFoundException"->`ResourceNotFoundException(ResourceNotFoundException.of_xmlxml)|"ServiceUnavailableException"->`ServiceUnavailableException(ServiceUnavailableException.of_xmlxml)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_xmlxml)|"ValidationException"->`ValidationException(ValidationException.of_xmlxml)|name->`Unknown_operation_error(name,(Some(Awso.Xml.to_stringxml)))leterror_to_json:error->Yojson.Safe.t=function|`AccessDeniedExceptione->`Assoc[("error",(`String"AccessDeniedException"));("details",(AccessDeniedException.to_jsone))]|`InternalServerExceptione->`Assoc[("error",(`String"InternalServerException"));("details",(InternalServerException.to_jsone))]|`ResourceNotFoundExceptione->`Assoc[("error",(`String"ResourceNotFoundException"));("details",(ResourceNotFoundException.to_jsone))]|`ServiceUnavailableExceptione->`Assoc[("error",(`String"ServiceUnavailableException"));("details",(ServiceUnavailableException.to_jsone))]|`ThrottlingExceptione->`Assoc[("error",(`String"ThrottlingException"));("details",(ThrottlingException.to_jsone))]|`ValidationExceptione->`Assoc[("error",(`String"ValidationException"));("details",(ValidationException.to_jsone))]|`Unknown_operation_error(code,msg)->`Assoc(("error",(`Stringcode))::((matchmsgwith|None->[]|Somem->[("message",(`Stringm))])))letto_valuex=structure_to_value[("inputTokens",(Option.mapx.inputTokens~f:Integer.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letinputTokens=(Option.map~f:Integer.of_xml)(Xml.childxml_arg0"inputTokens")inmake?inputTokens()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letinputTokens=field_mapjson__"inputTokens"Integer.of_jsoninmake?inputTokens()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Returns the token count for a given inference request. This operation helps you estimate token usage before sending requests to foundation models by returning the token count that would be used if the same input were sent to the model in an inference request. Token counting is model-specific because different models use different tokenization strategies. The token count returned by this operation will match the token count that would be charged if the same input were sent to the model in an InvokeModel or Converse request. You can use this operation to: Estimate costs before sending inference requests. Optimize prompts to fit within token limits. Plan for token usage in your applications. This operation accepts the same input formats as InvokeModel and Converse, allowing you to count tokens for both raw text inputs and structured conversation formats. The following operations are related to CountTokens: InvokeModel - Sends inference requests to foundation models Converse - Sends conversation-based inference requests to foundation models"]moduleCountTokensRequest=structtypenonrect={modelId:FoundationModelVersionIdentifier.t[@ocaml.doc"The unique identifier or ARN of the foundation model to use for token counting. Each model processes tokens differently, so the token count is specific to the model you specify."];input:CountTokensInput.t[@ocaml.doc"The input for which to count tokens. The structure of this parameter depends on whether you're counting tokens for an InvokeModel or Converse request: For InvokeModel requests, provide the request body in the invokeModel field For Converse requests, provide the messages and system content in the converse field The input format must be compatible with the model specified in the modelId parameter."]}letcontext_="CountTokensRequest"letmake~modelId=fun~input->fun()->{modelId;input}letto_valuex=structure_to_value[("modelId",(Some(FoundationModelVersionIdentifier.to_valuex.modelId)));("input",(Some(CountTokensInput.to_valuex.input)))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letinput=CountTokensInput.of_xml(Xml.child_exn~context:context_xml_arg0"input")inletmodelId=FoundationModelVersionIdentifier.of_xml(Xml.child_exn~context:context_xml_arg0"modelId")inmake~input~modelId()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letinput=field_map_exnjson__"input"CountTokensInput.of_jsoninletmodelId=field_map_exnjson__"modelId"FoundationModelVersionIdentifier.of_jsoninmake~input~modelId()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Returns the token count for a given inference request. This operation helps you estimate token usage before sending requests to foundation models by returning the token count that would be used if the same input were sent to the model in an inference request. Token counting is model-specific because different models use different tokenization strategies. The token count returned by this operation will match the token count that would be charged if the same input were sent to the model in an InvokeModel or Converse request. You can use this operation to: Estimate costs before sending inference requests. Optimize prompts to fit within token limits. Plan for token usage in your applications. This operation accepts the same input formats as InvokeModel and Converse, allowing you to count tokens for both raw text inputs and structured conversation formats. The following operations are related to CountTokens: InvokeModel - Sends inference requests to foundation models Converse - Sends conversation-based inference requests to foundation models"]moduleConverseStreamResponse=structtypenonrect={stream:ConverseStreamOutput.toption[@ocaml.doc"The output stream that the model generated."]}typenonrecerror=[`AccessDeniedExceptionofAccessDeniedException.t|`InternalServerExceptionofInternalServerException.t|`ModelErrorExceptionofModelErrorException.t|`ModelNotReadyExceptionofModelNotReadyException.t|`ModelTimeoutExceptionofModelTimeoutException.t|`ResourceNotFoundExceptionofResourceNotFoundException.t|`ServiceUnavailableExceptionofServiceUnavailableException.t|`ThrottlingExceptionofThrottlingException.t|`ValidationExceptionofValidationException.t|`Unknown_operation_errorof(string*stringoption)]letmake?stream=fun()->{stream}leterror_of_jsonnamejson=matchnamewith|"AccessDeniedException"->`AccessDeniedException(AccessDeniedException.of_jsonjson)|"InternalServerException"->`InternalServerException(InternalServerException.of_jsonjson)|"ModelErrorException"->`ModelErrorException(ModelErrorException.of_jsonjson)|"ModelNotReadyException"->`ModelNotReadyException(ModelNotReadyException.of_jsonjson)|"ModelTimeoutException"->`ModelTimeoutException(ModelTimeoutException.of_jsonjson)|"ResourceNotFoundException"->`ResourceNotFoundException(ResourceNotFoundException.of_jsonjson)|"ServiceUnavailableException"->`ServiceUnavailableException(ServiceUnavailableException.of_jsonjson)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_jsonjson)|"ValidationException"->`ValidationException(ValidationException.of_jsonjson)|name->`Unknown_operation_error(name,(Some(Yojson.Safe.to_stringjson)))leterror_of_xmlnamexml=matchnamewith|"AccessDeniedException"->`AccessDeniedException(AccessDeniedException.of_xmlxml)|"InternalServerException"->`InternalServerException(InternalServerException.of_xmlxml)|"ModelErrorException"->`ModelErrorException(ModelErrorException.of_xmlxml)|"ModelNotReadyException"->`ModelNotReadyException(ModelNotReadyException.of_xmlxml)|"ModelTimeoutException"->`ModelTimeoutException(ModelTimeoutException.of_xmlxml)|"ResourceNotFoundException"->`ResourceNotFoundException(ResourceNotFoundException.of_xmlxml)|"ServiceUnavailableException"->`ServiceUnavailableException(ServiceUnavailableException.of_xmlxml)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_xmlxml)|"ValidationException"->`ValidationException(ValidationException.of_xmlxml)|name->`Unknown_operation_error(name,(Some(Awso.Xml.to_stringxml)))leterror_to_json:error->Yojson.Safe.t=function|`AccessDeniedExceptione->`Assoc[("error",(`String"AccessDeniedException"));("details",(AccessDeniedException.to_jsone))]|`InternalServerExceptione->`Assoc[("error",(`String"InternalServerException"));("details",(InternalServerException.to_jsone))]|`ModelErrorExceptione->`Assoc[("error",(`String"ModelErrorException"));("details",(ModelErrorException.to_jsone))]|`ModelNotReadyExceptione->`Assoc[("error",(`String"ModelNotReadyException"));("details",(ModelNotReadyException.to_jsone))]|`ModelTimeoutExceptione->`Assoc[("error",(`String"ModelTimeoutException"));("details",(ModelTimeoutException.to_jsone))]|`ResourceNotFoundExceptione->`Assoc[("error",(`String"ResourceNotFoundException"));("details",(ResourceNotFoundException.to_jsone))]|`ServiceUnavailableExceptione->`Assoc[("error",(`String"ServiceUnavailableException"));("details",(ServiceUnavailableException.to_jsone))]|`ThrottlingExceptione->`Assoc[("error",(`String"ThrottlingException"));("details",(ThrottlingException.to_jsone))]|`ValidationExceptione->`Assoc[("error",(`String"ValidationException"));("details",(ValidationException.to_jsone))]|`Unknown_operation_error(code,msg)->`Assoc(("error",(`Stringcode))::((matchmsgwith|None->[]|Somem->[("message",(`Stringm))])))letof_header_and_body=((fun(xs,pipe)->make?stream:(Somepipe)())[@warning"-27"])letto_valuex=structure_to_value[("stream",(Option.mapx.stream~f:ConverseStreamOutput.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letstream=(Option.map~f:ConverseStreamOutput.of_xml)(Xml.childxml_arg0"stream")inmake?stream()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letstream=field_mapjson__"stream"ConverseStreamOutput.of_jsoninmake?stream()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Sends messages to the specified Amazon Bedrock model and returns the response in a stream. ConverseStream provides a consistent API that works with all Amazon Bedrock models that support messages. This allows you to write code once and use it with different models. Should a model have unique inference parameters, you can also pass those unique parameters to the model. To find out if a model supports streaming, call GetFoundationModel and check the responseStreamingSupported field in the response. The CLI doesn't support streaming operations in Amazon Bedrock, including ConverseStream. Amazon Bedrock doesn't store any text, images, or documents that you provide as content. The data is only used to generate the response. You can submit a prompt by including it in the messages field, specifying the modelId of a foundation model or inference profile to run inference on it, and including any other fields that are relevant to your use case. You can also submit a prompt from Prompt management by specifying the ARN of the prompt version and including a map of variables to values in the promptVariables field. You can append more messages to the prompt by using the messages field. If you use a prompt from Prompt management, you can't include the following fields in the request: additionalModelRequestFields, inferenceConfig, system, or toolConfig. Instead, these fields must be defined through Prompt management. For more information, see Use a prompt from Prompt management. For information about the Converse API, see Use the Converse API in the Amazon Bedrock User Guide. To use a guardrail, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide. To use a tool with a model, see Tool use (Function calling) in the Amazon Bedrock User Guide For example code, see Conversation streaming example in the Amazon Bedrock User Guide. This operation requires permission for the bedrock:InvokeModelWithResponseStream action. To deny all inference access to resources that you specify in the modelId field, you need to deny access to the bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream actions. Doing this also denies access to the resource through the base inference actions (InvokeModel and InvokeModelWithResponseStream). For more information see Deny access for inference on specific models. For troubleshooting some of the common errors you might encounter when using the ConverseStream API, see Troubleshooting Amazon Bedrock API Error Codes in the Amazon Bedrock User Guide"]moduleConverseStreamRequest=structtypenonrect={modelId:ConversationalModelId.t[@ocaml.doc"Specifies the model or throughput with which to run inference, or the prompt resource to use in inference. The value depends on the resource that you use: If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see Amazon Bedrock base model IDs (on-demand throughput) in the Amazon Bedrock User Guide. If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see Supported Regions and models for cross-region inference in the Amazon Bedrock User Guide. If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see Run inference using a Provisioned Throughput in the Amazon Bedrock User Guide. If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see Use a custom model in Amazon Bedrock in the Amazon Bedrock User Guide. To include a prompt that was defined in Prompt management, specify the ARN of the prompt version to use. The Converse API doesn't support imported models."];messages:Messages.toption[@ocaml.doc"The messages that you want to send to the model."];system:SystemContentBlocks.toption[@ocaml.doc"A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation."];inferenceConfig:InferenceConfiguration.toption[@ocaml.doc"Inference parameters to pass to the model. Converse and ConverseStream support a base set of inference parameters. If you need to pass additional parameters that the model supports, use the additionalModelRequestFields request field."];toolConfig:ToolConfiguration.toption[@ocaml.doc"Configuration information for the tools that the model can use when generating a response. For information about models that support streaming tool use, see Supported models and model features."];guardrailConfig:GuardrailStreamConfiguration.toption[@ocaml.doc"Configuration information for a guardrail that you want to use in the request. If you include guardContent blocks in the content field in the messages field, the guardrail operates only on those messages. If you include no guardContent blocks, the guardrail operates on all messages in the request body and in any included prompt resource."];additionalModelRequestFields:Document.toption[@ocaml.doc"Additional inference parameters that the model supports, beyond the base set of inference parameters that Converse and ConverseStream support in the inferenceConfig field. For more information, see Model parameters."];promptVariables:PromptVariableMap.toption[@ocaml.doc"Contains a map of variables in a prompt from Prompt management to objects containing the values to fill in for them when running model invocation. This field is ignored if you don't specify a prompt resource in the modelId field."];additionalModelResponseFieldPaths:ConverseStreamRequestAdditionalModelResponseFieldPathsList.toption[@ocaml.doc"Additional model parameters field paths to return in the response. Converse and ConverseStream return the requested fields as a JSON Pointer object in the additionalModelResponseFields field. The following is example JSON for additionalModelResponseFieldPaths. \\[ \"/stop_sequence\" \\] For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation. Converse and ConverseStream reject an empty JSON Pointer or incorrectly structured JSON Pointer with a 400 error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by Converse."];requestMetadata:RequestMetadata.toption[@ocaml.doc"Key-value pairs that you can use to filter invocation logs."];performanceConfig:PerformanceConfiguration.toption[@ocaml.doc"Model performance settings for the request."];serviceTier:ServiceTier.toption[@ocaml.doc"Specifies the processing tier configuration used for serving the request."];outputConfig:OutputConfig.toption[@ocaml.doc"Output configuration for a model response."]}letcontext_="ConverseStreamRequest"letmake?messages=fun?system->fun?inferenceConfig->fun?toolConfig->fun?guardrailConfig->fun?additionalModelRequestFields->fun?promptVariables->fun?additionalModelResponseFieldPaths->fun?requestMetadata->fun?performanceConfig->fun?serviceTier->fun?outputConfig->fun~modelId->fun()->{messages;system;inferenceConfig;toolConfig;guardrailConfig;additionalModelRequestFields;promptVariables;additionalModelResponseFieldPaths;requestMetadata;performanceConfig;serviceTier;outputConfig;modelId}letto_valuex=structure_to_value[("modelId",(Some(ConversationalModelId.to_valuex.modelId)));("messages",(Option.mapx.messages~f:Messages.to_value));("system",(Option.mapx.system~f:SystemContentBlocks.to_value));("inferenceConfig",(Option.mapx.inferenceConfig~f:InferenceConfiguration.to_value));("toolConfig",(Option.mapx.toolConfig~f:ToolConfiguration.to_value));("guardrailConfig",(Option.mapx.guardrailConfig~f:GuardrailStreamConfiguration.to_value));("additionalModelRequestFields",(Option.mapx.additionalModelRequestFields~f:Document.to_value));("promptVariables",(Option.mapx.promptVariables~f:PromptVariableMap.to_value));("additionalModelResponseFieldPaths",(Option.mapx.additionalModelResponseFieldPaths~f:ConverseStreamRequestAdditionalModelResponseFieldPathsList.to_value));("requestMetadata",(Option.mapx.requestMetadata~f:RequestMetadata.to_value));("performanceConfig",(Option.mapx.performanceConfig~f:PerformanceConfiguration.to_value));("serviceTier",(Option.mapx.serviceTier~f:ServiceTier.to_value));("outputConfig",(Option.mapx.outputConfig~f:OutputConfig.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letoutputConfig=(Option.map~f:OutputConfig.of_xml)(Xml.childxml_arg0"outputConfig")inletserviceTier=(Option.map~f:ServiceTier.of_xml)(Xml.childxml_arg0"serviceTier")inletperformanceConfig=(Option.map~f:PerformanceConfiguration.of_xml)(Xml.childxml_arg0"performanceConfig")inletrequestMetadata=(Option.map~f:RequestMetadata.of_xml)(Xml.childxml_arg0"requestMetadata")inletadditionalModelResponseFieldPaths=(Option.map~f:ConverseStreamRequestAdditionalModelResponseFieldPathsList.of_xml)(Xml.childxml_arg0"additionalModelResponseFieldPaths")inletpromptVariables=(Option.map~f:PromptVariableMap.of_xml)(Xml.childxml_arg0"promptVariables")inletadditionalModelRequestFields=(Option.map~f:Document.of_xml)(Xml.childxml_arg0"additionalModelRequestFields")inletguardrailConfig=(Option.map~f:GuardrailStreamConfiguration.of_xml)(Xml.childxml_arg0"guardrailConfig")inlettoolConfig=(Option.map~f:ToolConfiguration.of_xml)(Xml.childxml_arg0"toolConfig")inletinferenceConfig=(Option.map~f:InferenceConfiguration.of_xml)(Xml.childxml_arg0"inferenceConfig")inletsystem=(Option.map~f:SystemContentBlocks.of_xml)(Xml.childxml_arg0"system")inletmessages=(Option.map~f:Messages.of_xml)(Xml.childxml_arg0"messages")inletmodelId=ConversationalModelId.of_xml(Xml.child_exn~context:context_xml_arg0"modelId")inmake?outputConfig?serviceTier?performanceConfig?requestMetadata?additionalModelResponseFieldPaths?promptVariables?additionalModelRequestFields?guardrailConfig?toolConfig?inferenceConfig?system?messages~modelId()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letoutputConfig=field_mapjson__"outputConfig"OutputConfig.of_jsoninletserviceTier=field_mapjson__"serviceTier"ServiceTier.of_jsoninletperformanceConfig=field_mapjson__"performanceConfig"PerformanceConfiguration.of_jsoninletrequestMetadata=field_mapjson__"requestMetadata"RequestMetadata.of_jsoninletadditionalModelResponseFieldPaths=field_mapjson__"additionalModelResponseFieldPaths"ConverseStreamRequestAdditionalModelResponseFieldPathsList.of_jsoninletpromptVariables=field_mapjson__"promptVariables"PromptVariableMap.of_jsoninletadditionalModelRequestFields=field_mapjson__"additionalModelRequestFields"Document.of_jsoninletguardrailConfig=field_mapjson__"guardrailConfig"GuardrailStreamConfiguration.of_jsoninlettoolConfig=field_mapjson__"toolConfig"ToolConfiguration.of_jsoninletinferenceConfig=field_mapjson__"inferenceConfig"InferenceConfiguration.of_jsoninletsystem=field_mapjson__"system"SystemContentBlocks.of_jsoninletmessages=field_mapjson__"messages"Messages.of_jsoninletmodelId=field_map_exnjson__"modelId"ConversationalModelId.of_jsoninmake?outputConfig?serviceTier?performanceConfig?requestMetadata?additionalModelResponseFieldPaths?promptVariables?additionalModelRequestFields?guardrailConfig?toolConfig?inferenceConfig?system?messages~modelId()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Sends messages to the specified Amazon Bedrock model and returns the response in a stream. ConverseStream provides a consistent API that works with all Amazon Bedrock models that support messages. This allows you to write code once and use it with different models. Should a model have unique inference parameters, you can also pass those unique parameters to the model. To find out if a model supports streaming, call GetFoundationModel and check the responseStreamingSupported field in the response. The CLI doesn't support streaming operations in Amazon Bedrock, including ConverseStream. Amazon Bedrock doesn't store any text, images, or documents that you provide as content. The data is only used to generate the response. You can submit a prompt by including it in the messages field, specifying the modelId of a foundation model or inference profile to run inference on it, and including any other fields that are relevant to your use case. You can also submit a prompt from Prompt management by specifying the ARN of the prompt version and including a map of variables to values in the promptVariables field. You can append more messages to the prompt by using the messages field. If you use a prompt from Prompt management, you can't include the following fields in the request: additionalModelRequestFields, inferenceConfig, system, or toolConfig. Instead, these fields must be defined through Prompt management. For more information, see Use a prompt from Prompt management. For information about the Converse API, see Use the Converse API in the Amazon Bedrock User Guide. To use a guardrail, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide. To use a tool with a model, see Tool use (Function calling) in the Amazon Bedrock User Guide For example code, see Conversation streaming example in the Amazon Bedrock User Guide. This operation requires permission for the bedrock:InvokeModelWithResponseStream action. To deny all inference access to resources that you specify in the modelId field, you need to deny access to the bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream actions. Doing this also denies access to the resource through the base inference actions (InvokeModel and InvokeModelWithResponseStream). For more information see Deny access for inference on specific models. For troubleshooting some of the common errors you might encounter when using the ConverseStream API, see Troubleshooting Amazon Bedrock API Error Codes in the Amazon Bedrock User Guide"]moduleConverseResponse=structtypenonrect={output:ConverseOutput.toption[@ocaml.doc"The result from the call to Converse."];stopReason:StopReason.toption[@ocaml.doc"The reason why the model stopped generating output."];usage:TokenUsage.toption[@ocaml.doc"The total number of tokens used in the call to Converse. The total includes the tokens input to the model and the tokens generated by the model."];metrics:ConverseMetrics.toption[@ocaml.doc"Metrics for the call to Converse."];additionalModelResponseFields:Document.toption[@ocaml.doc"Additional fields in the response that are unique to the model."];trace:ConverseTrace.toption[@ocaml.doc"A trace object that contains information about the Guardrail behavior."];performanceConfig:PerformanceConfiguration.toption[@ocaml.doc"Model performance settings for the request."];serviceTier:ServiceTier.toption[@ocaml.doc"Specifies the processing tier configuration used for serving the request."]}typenonrecerror=[`AccessDeniedExceptionofAccessDeniedException.t|`InternalServerExceptionofInternalServerException.t|`ModelErrorExceptionofModelErrorException.t|`ModelNotReadyExceptionofModelNotReadyException.t|`ModelTimeoutExceptionofModelTimeoutException.t|`ResourceNotFoundExceptionofResourceNotFoundException.t|`ServiceUnavailableExceptionofServiceUnavailableException.t|`ThrottlingExceptionofThrottlingException.t|`ValidationExceptionofValidationException.t|`Unknown_operation_errorof(string*stringoption)]letmake?output=fun?stopReason->fun?usage->fun?metrics->fun?additionalModelResponseFields->fun?trace->fun?performanceConfig->fun?serviceTier->fun()->{output;stopReason;usage;metrics;additionalModelResponseFields;trace;performanceConfig;serviceTier}leterror_of_jsonnamejson=matchnamewith|"AccessDeniedException"->`AccessDeniedException(AccessDeniedException.of_jsonjson)|"InternalServerException"->`InternalServerException(InternalServerException.of_jsonjson)|"ModelErrorException"->`ModelErrorException(ModelErrorException.of_jsonjson)|"ModelNotReadyException"->`ModelNotReadyException(ModelNotReadyException.of_jsonjson)|"ModelTimeoutException"->`ModelTimeoutException(ModelTimeoutException.of_jsonjson)|"ResourceNotFoundException"->`ResourceNotFoundException(ResourceNotFoundException.of_jsonjson)|"ServiceUnavailableException"->`ServiceUnavailableException(ServiceUnavailableException.of_jsonjson)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_jsonjson)|"ValidationException"->`ValidationException(ValidationException.of_jsonjson)|name->`Unknown_operation_error(name,(Some(Yojson.Safe.to_stringjson)))leterror_of_xmlnamexml=matchnamewith|"AccessDeniedException"->`AccessDeniedException(AccessDeniedException.of_xmlxml)|"InternalServerException"->`InternalServerException(InternalServerException.of_xmlxml)|"ModelErrorException"->`ModelErrorException(ModelErrorException.of_xmlxml)|"ModelNotReadyException"->`ModelNotReadyException(ModelNotReadyException.of_xmlxml)|"ModelTimeoutException"->`ModelTimeoutException(ModelTimeoutException.of_xmlxml)|"ResourceNotFoundException"->`ResourceNotFoundException(ResourceNotFoundException.of_xmlxml)|"ServiceUnavailableException"->`ServiceUnavailableException(ServiceUnavailableException.of_xmlxml)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_xmlxml)|"ValidationException"->`ValidationException(ValidationException.of_xmlxml)|name->`Unknown_operation_error(name,(Some(Awso.Xml.to_stringxml)))leterror_to_json:error->Yojson.Safe.t=function|`AccessDeniedExceptione->`Assoc[("error",(`String"AccessDeniedException"));("details",(AccessDeniedException.to_jsone))]|`InternalServerExceptione->`Assoc[("error",(`String"InternalServerException"));("details",(InternalServerException.to_jsone))]|`ModelErrorExceptione->`Assoc[("error",(`String"ModelErrorException"));("details",(ModelErrorException.to_jsone))]|`ModelNotReadyExceptione->`Assoc[("error",(`String"ModelNotReadyException"));("details",(ModelNotReadyException.to_jsone))]|`ModelTimeoutExceptione->`Assoc[("error",(`String"ModelTimeoutException"));("details",(ModelTimeoutException.to_jsone))]|`ResourceNotFoundExceptione->`Assoc[("error",(`String"ResourceNotFoundException"));("details",(ResourceNotFoundException.to_jsone))]|`ServiceUnavailableExceptione->`Assoc[("error",(`String"ServiceUnavailableException"));("details",(ServiceUnavailableException.to_jsone))]|`ThrottlingExceptione->`Assoc[("error",(`String"ThrottlingException"));("details",(ThrottlingException.to_jsone))]|`ValidationExceptione->`Assoc[("error",(`String"ValidationException"));("details",(ValidationException.to_jsone))]|`Unknown_operation_error(code,msg)->`Assoc(("error",(`Stringcode))::((matchmsgwith|None->[]|Somem->[("message",(`Stringm))])))letto_valuex=structure_to_value[("output",(Option.mapx.output~f:ConverseOutput.to_value));("stopReason",(Option.mapx.stopReason~f:StopReason.to_value));("usage",(Option.mapx.usage~f:TokenUsage.to_value));("metrics",(Option.mapx.metrics~f:ConverseMetrics.to_value));("additionalModelResponseFields",(Option.mapx.additionalModelResponseFields~f:Document.to_value));("trace",(Option.mapx.trace~f:ConverseTrace.to_value));("performanceConfig",(Option.mapx.performanceConfig~f:PerformanceConfiguration.to_value));("serviceTier",(Option.mapx.serviceTier~f:ServiceTier.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letserviceTier=(Option.map~f:ServiceTier.of_xml)(Xml.childxml_arg0"serviceTier")inletperformanceConfig=(Option.map~f:PerformanceConfiguration.of_xml)(Xml.childxml_arg0"performanceConfig")inlettrace=(Option.map~f:ConverseTrace.of_xml)(Xml.childxml_arg0"trace")inletadditionalModelResponseFields=(Option.map~f:Document.of_xml)(Xml.childxml_arg0"additionalModelResponseFields")inletmetrics=(Option.map~f:ConverseMetrics.of_xml)(Xml.childxml_arg0"metrics")inletusage=(Option.map~f:TokenUsage.of_xml)(Xml.childxml_arg0"usage")inletstopReason=(Option.map~f:StopReason.of_xml)(Xml.childxml_arg0"stopReason")inletoutput=(Option.map~f:ConverseOutput.of_xml)(Xml.childxml_arg0"output")inmake?serviceTier?performanceConfig?trace?additionalModelResponseFields?metrics?usage?stopReason?output()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letserviceTier=field_mapjson__"serviceTier"ServiceTier.of_jsoninletperformanceConfig=field_mapjson__"performanceConfig"PerformanceConfiguration.of_jsoninlettrace=field_mapjson__"trace"ConverseTrace.of_jsoninletadditionalModelResponseFields=field_mapjson__"additionalModelResponseFields"Document.of_jsoninletmetrics=field_mapjson__"metrics"ConverseMetrics.of_jsoninletusage=field_mapjson__"usage"TokenUsage.of_jsoninletstopReason=field_mapjson__"stopReason"StopReason.of_jsoninletoutput=field_mapjson__"output"ConverseOutput.of_jsoninmake?serviceTier?performanceConfig?trace?additionalModelResponseFields?metrics?usage?stopReason?output()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Sends messages to the specified Amazon Bedrock model. Converse provides a consistent interface that works with all models that support messages. This allows you to write code once and use it with different models. If a model has unique inference parameters, you can also pass those unique parameters to the model. Amazon Bedrock doesn't store any text, images, or documents that you provide as content. The data is only used to generate the response. You can submit a prompt by including it in the messages field, specifying the modelId of a foundation model or inference profile to run inference on it, and including any other fields that are relevant to your use case. You can also submit a prompt from Prompt management by specifying the ARN of the prompt version and including a map of variables to values in the promptVariables field. You can append more messages to the prompt by using the messages field. If you use a prompt from Prompt management, you can't include the following fields in the request: additionalModelRequestFields, inferenceConfig, system, or toolConfig. Instead, these fields must be defined through Prompt management. For more information, see Use a prompt from Prompt management. For information about the Converse API, see Use the Converse API in the Amazon Bedrock User Guide. To use a guardrail, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide. To use a tool with a model, see Tool use (Function calling) in the Amazon Bedrock User Guide For example code, see Converse API examples in the Amazon Bedrock User Guide. This operation requires permission for the bedrock:InvokeModel action. To deny all inference access to resources that you specify in the modelId field, you need to deny access to the bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream actions. Doing this also denies access to the resource through the base inference actions (InvokeModel and InvokeModelWithResponseStream). For more information see Deny access for inference on specific models. For troubleshooting some of the common errors you might encounter when using the Converse API, see Troubleshooting Amazon Bedrock API Error Codes in the Amazon Bedrock User Guide"]moduleConverseRequest=structtypenonrect={modelId:ConversationalModelId.t[@ocaml.doc"Specifies the model or throughput with which to run inference, or the prompt resource to use in inference. The value depends on the resource that you use: If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see Amazon Bedrock base model IDs (on-demand throughput) in the Amazon Bedrock User Guide. If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see Supported Regions and models for cross-region inference in the Amazon Bedrock User Guide. If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see Run inference using a Provisioned Throughput in the Amazon Bedrock User Guide. If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see Use a custom model in Amazon Bedrock in the Amazon Bedrock User Guide. To include a prompt that was defined in Prompt management, specify the ARN of the prompt version to use. The Converse API doesn't support imported models."];messages:Messages.toption[@ocaml.doc"The messages that you want to send to the model."];system:SystemContentBlocks.toption[@ocaml.doc"A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation."];inferenceConfig:InferenceConfiguration.toption[@ocaml.doc"Inference parameters to pass to the model. Converse and ConverseStream support a base set of inference parameters. If you need to pass additional parameters that the model supports, use the additionalModelRequestFields request field."];toolConfig:ToolConfiguration.toption[@ocaml.doc"Configuration information for the tools that the model can use when generating a response. For information about models that support tool use, see Supported models and model features."];guardrailConfig:GuardrailConfiguration.toption[@ocaml.doc"Configuration information for a guardrail that you want to use in the request. If you include guardContent blocks in the content field in the messages field, the guardrail operates only on those messages. If you include no guardContent blocks, the guardrail operates on all messages in the request body and in any included prompt resource."];additionalModelRequestFields:Document.toption[@ocaml.doc"Additional inference parameters that the model supports, beyond the base set of inference parameters that Converse and ConverseStream support in the inferenceConfig field. For more information, see Model parameters."];promptVariables:PromptVariableMap.toption[@ocaml.doc"Contains a map of variables in a prompt from Prompt management to objects containing the values to fill in for them when running model invocation. This field is ignored if you don't specify a prompt resource in the modelId field."];additionalModelResponseFieldPaths:ConverseRequestAdditionalModelResponseFieldPathsList.toption[@ocaml.doc"Additional model parameters field paths to return in the response. Converse and ConverseStream return the requested fields as a JSON Pointer object in the additionalModelResponseFields field. The following is example JSON for additionalModelResponseFieldPaths. \\[ \"/stop_sequence\" \\] For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation. Converse and ConverseStream reject an empty JSON Pointer or incorrectly structured JSON Pointer with a 400 error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by Converse."];requestMetadata:RequestMetadata.toption[@ocaml.doc"Key-value pairs that you can use to filter invocation logs."];performanceConfig:PerformanceConfiguration.toption[@ocaml.doc"Model performance settings for the request."];serviceTier:ServiceTier.toption[@ocaml.doc"Specifies the processing tier configuration used for serving the request."];outputConfig:OutputConfig.toption[@ocaml.doc"Output configuration for a model response."]}letcontext_="ConverseRequest"letmake?messages=fun?system->fun?inferenceConfig->fun?toolConfig->fun?guardrailConfig->fun?additionalModelRequestFields->fun?promptVariables->fun?additionalModelResponseFieldPaths->fun?requestMetadata->fun?performanceConfig->fun?serviceTier->fun?outputConfig->fun~modelId->fun()->{messages;system;inferenceConfig;toolConfig;guardrailConfig;additionalModelRequestFields;promptVariables;additionalModelResponseFieldPaths;requestMetadata;performanceConfig;serviceTier;outputConfig;modelId}letto_valuex=structure_to_value[("modelId",(Some(ConversationalModelId.to_valuex.modelId)));("messages",(Option.mapx.messages~f:Messages.to_value));("system",(Option.mapx.system~f:SystemContentBlocks.to_value));("inferenceConfig",(Option.mapx.inferenceConfig~f:InferenceConfiguration.to_value));("toolConfig",(Option.mapx.toolConfig~f:ToolConfiguration.to_value));("guardrailConfig",(Option.mapx.guardrailConfig~f:GuardrailConfiguration.to_value));("additionalModelRequestFields",(Option.mapx.additionalModelRequestFields~f:Document.to_value));("promptVariables",(Option.mapx.promptVariables~f:PromptVariableMap.to_value));("additionalModelResponseFieldPaths",(Option.mapx.additionalModelResponseFieldPaths~f:ConverseRequestAdditionalModelResponseFieldPathsList.to_value));("requestMetadata",(Option.mapx.requestMetadata~f:RequestMetadata.to_value));("performanceConfig",(Option.mapx.performanceConfig~f:PerformanceConfiguration.to_value));("serviceTier",(Option.mapx.serviceTier~f:ServiceTier.to_value));("outputConfig",(Option.mapx.outputConfig~f:OutputConfig.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letoutputConfig=(Option.map~f:OutputConfig.of_xml)(Xml.childxml_arg0"outputConfig")inletserviceTier=(Option.map~f:ServiceTier.of_xml)(Xml.childxml_arg0"serviceTier")inletperformanceConfig=(Option.map~f:PerformanceConfiguration.of_xml)(Xml.childxml_arg0"performanceConfig")inletrequestMetadata=(Option.map~f:RequestMetadata.of_xml)(Xml.childxml_arg0"requestMetadata")inletadditionalModelResponseFieldPaths=(Option.map~f:ConverseRequestAdditionalModelResponseFieldPathsList.of_xml)(Xml.childxml_arg0"additionalModelResponseFieldPaths")inletpromptVariables=(Option.map~f:PromptVariableMap.of_xml)(Xml.childxml_arg0"promptVariables")inletadditionalModelRequestFields=(Option.map~f:Document.of_xml)(Xml.childxml_arg0"additionalModelRequestFields")inletguardrailConfig=(Option.map~f:GuardrailConfiguration.of_xml)(Xml.childxml_arg0"guardrailConfig")inlettoolConfig=(Option.map~f:ToolConfiguration.of_xml)(Xml.childxml_arg0"toolConfig")inletinferenceConfig=(Option.map~f:InferenceConfiguration.of_xml)(Xml.childxml_arg0"inferenceConfig")inletsystem=(Option.map~f:SystemContentBlocks.of_xml)(Xml.childxml_arg0"system")inletmessages=(Option.map~f:Messages.of_xml)(Xml.childxml_arg0"messages")inletmodelId=ConversationalModelId.of_xml(Xml.child_exn~context:context_xml_arg0"modelId")inmake?outputConfig?serviceTier?performanceConfig?requestMetadata?additionalModelResponseFieldPaths?promptVariables?additionalModelRequestFields?guardrailConfig?toolConfig?inferenceConfig?system?messages~modelId()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letoutputConfig=field_mapjson__"outputConfig"OutputConfig.of_jsoninletserviceTier=field_mapjson__"serviceTier"ServiceTier.of_jsoninletperformanceConfig=field_mapjson__"performanceConfig"PerformanceConfiguration.of_jsoninletrequestMetadata=field_mapjson__"requestMetadata"RequestMetadata.of_jsoninletadditionalModelResponseFieldPaths=field_mapjson__"additionalModelResponseFieldPaths"ConverseRequestAdditionalModelResponseFieldPathsList.of_jsoninletpromptVariables=field_mapjson__"promptVariables"PromptVariableMap.of_jsoninletadditionalModelRequestFields=field_mapjson__"additionalModelRequestFields"Document.of_jsoninletguardrailConfig=field_mapjson__"guardrailConfig"GuardrailConfiguration.of_jsoninlettoolConfig=field_mapjson__"toolConfig"ToolConfiguration.of_jsoninletinferenceConfig=field_mapjson__"inferenceConfig"InferenceConfiguration.of_jsoninletsystem=field_mapjson__"system"SystemContentBlocks.of_jsoninletmessages=field_mapjson__"messages"Messages.of_jsoninletmodelId=field_map_exnjson__"modelId"ConversationalModelId.of_jsoninmake?outputConfig?serviceTier?performanceConfig?requestMetadata?additionalModelResponseFieldPaths?promptVariables?additionalModelRequestFields?guardrailConfig?toolConfig?inferenceConfig?system?messages~modelId()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Sends messages to the specified Amazon Bedrock model. Converse provides a consistent interface that works with all models that support messages. This allows you to write code once and use it with different models. If a model has unique inference parameters, you can also pass those unique parameters to the model. Amazon Bedrock doesn't store any text, images, or documents that you provide as content. The data is only used to generate the response. You can submit a prompt by including it in the messages field, specifying the modelId of a foundation model or inference profile to run inference on it, and including any other fields that are relevant to your use case. You can also submit a prompt from Prompt management by specifying the ARN of the prompt version and including a map of variables to values in the promptVariables field. You can append more messages to the prompt by using the messages field. If you use a prompt from Prompt management, you can't include the following fields in the request: additionalModelRequestFields, inferenceConfig, system, or toolConfig. Instead, these fields must be defined through Prompt management. For more information, see Use a prompt from Prompt management. For information about the Converse API, see Use the Converse API in the Amazon Bedrock User Guide. To use a guardrail, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide. To use a tool with a model, see Tool use (Function calling) in the Amazon Bedrock User Guide For example code, see Converse API examples in the Amazon Bedrock User Guide. This operation requires permission for the bedrock:InvokeModel action. To deny all inference access to resources that you specify in the modelId field, you need to deny access to the bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream actions. Doing this also denies access to the resource through the base inference actions (InvokeModel and InvokeModelWithResponseStream). For more information see Deny access for inference on specific models. For troubleshooting some of the common errors you might encounter when using the Converse API, see Troubleshooting Amazon Bedrock API Error Codes in the Amazon Bedrock User Guide"]moduleApplyGuardrailResponse=structtypenonrect={usage:GuardrailUsage.toption[@ocaml.doc"The usage details in the response from the guardrail."];action:GuardrailAction.toption[@ocaml.doc"The action taken in the response from the guardrail."];actionReason:String_.toption[@ocaml.doc"The reason for the action taken when harmful content is detected."];outputs:GuardrailOutputContentList.toption[@ocaml.doc"The output details in the response from the guardrail."];assessments:GuardrailAssessmentList.toption[@ocaml.doc"The assessment details in the response from the guardrail."];guardrailCoverage:GuardrailCoverage.toption[@ocaml.doc"The guardrail coverage details in the apply guardrail response."]}typenonrecerror=[`AccessDeniedExceptionofAccessDeniedException.t|`InternalServerExceptionofInternalServerException.t|`ResourceNotFoundExceptionofResourceNotFoundException.t|`ServiceQuotaExceededExceptionofServiceQuotaExceededException.t|`ServiceUnavailableExceptionofServiceUnavailableException.t|`ThrottlingExceptionofThrottlingException.t|`ValidationExceptionofValidationException.t|`Unknown_operation_errorof(string*stringoption)]letmake?usage=fun?action->fun?actionReason->fun?outputs->fun?assessments->fun?guardrailCoverage->fun()->{usage;action;actionReason;outputs;assessments;guardrailCoverage}leterror_of_jsonnamejson=matchnamewith|"AccessDeniedException"->`AccessDeniedException(AccessDeniedException.of_jsonjson)|"InternalServerException"->`InternalServerException(InternalServerException.of_jsonjson)|"ResourceNotFoundException"->`ResourceNotFoundException(ResourceNotFoundException.of_jsonjson)|"ServiceQuotaExceededException"->`ServiceQuotaExceededException(ServiceQuotaExceededException.of_jsonjson)|"ServiceUnavailableException"->`ServiceUnavailableException(ServiceUnavailableException.of_jsonjson)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_jsonjson)|"ValidationException"->`ValidationException(ValidationException.of_jsonjson)|name->`Unknown_operation_error(name,(Some(Yojson.Safe.to_stringjson)))leterror_of_xmlnamexml=matchnamewith|"AccessDeniedException"->`AccessDeniedException(AccessDeniedException.of_xmlxml)|"InternalServerException"->`InternalServerException(InternalServerException.of_xmlxml)|"ResourceNotFoundException"->`ResourceNotFoundException(ResourceNotFoundException.of_xmlxml)|"ServiceQuotaExceededException"->`ServiceQuotaExceededException(ServiceQuotaExceededException.of_xmlxml)|"ServiceUnavailableException"->`ServiceUnavailableException(ServiceUnavailableException.of_xmlxml)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_xmlxml)|"ValidationException"->`ValidationException(ValidationException.of_xmlxml)|name->`Unknown_operation_error(name,(Some(Awso.Xml.to_stringxml)))leterror_to_json:error->Yojson.Safe.t=function|`AccessDeniedExceptione->`Assoc[("error",(`String"AccessDeniedException"));("details",(AccessDeniedException.to_jsone))]|`InternalServerExceptione->`Assoc[("error",(`String"InternalServerException"));("details",(InternalServerException.to_jsone))]|`ResourceNotFoundExceptione->`Assoc[("error",(`String"ResourceNotFoundException"));("details",(ResourceNotFoundException.to_jsone))]|`ServiceQuotaExceededExceptione->`Assoc[("error",(`String"ServiceQuotaExceededException"));("details",(ServiceQuotaExceededException.to_jsone))]|`ServiceUnavailableExceptione->`Assoc[("error",(`String"ServiceUnavailableException"));("details",(ServiceUnavailableException.to_jsone))]|`ThrottlingExceptione->`Assoc[("error",(`String"ThrottlingException"));("details",(ThrottlingException.to_jsone))]|`ValidationExceptione->`Assoc[("error",(`String"ValidationException"));("details",(ValidationException.to_jsone))]|`Unknown_operation_error(code,msg)->`Assoc(("error",(`Stringcode))::((matchmsgwith|None->[]|Somem->[("message",(`Stringm))])))letto_valuex=structure_to_value[("usage",(Option.mapx.usage~f:GuardrailUsage.to_value));("action",(Option.mapx.action~f:GuardrailAction.to_value));("actionReason",(Option.mapx.actionReason~f:String_.to_value));("outputs",(Option.mapx.outputs~f:GuardrailOutputContentList.to_value));("assessments",(Option.mapx.assessments~f:GuardrailAssessmentList.to_value));("guardrailCoverage",(Option.mapx.guardrailCoverage~f:GuardrailCoverage.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letguardrailCoverage=(Option.map~f:GuardrailCoverage.of_xml)(Xml.childxml_arg0"guardrailCoverage")inletassessments=(Option.map~f:GuardrailAssessmentList.of_xml)(Xml.childxml_arg0"assessments")inletoutputs=(Option.map~f:GuardrailOutputContentList.of_xml)(Xml.childxml_arg0"outputs")inletactionReason=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"actionReason")inletaction=(Option.map~f:GuardrailAction.of_xml)(Xml.childxml_arg0"action")inletusage=(Option.map~f:GuardrailUsage.of_xml)(Xml.childxml_arg0"usage")inmake?guardrailCoverage?assessments?outputs?actionReason?action?usage()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letguardrailCoverage=field_mapjson__"guardrailCoverage"GuardrailCoverage.of_jsoninletassessments=field_mapjson__"assessments"GuardrailAssessmentList.of_jsoninletoutputs=field_mapjson__"outputs"GuardrailOutputContentList.of_jsoninletactionReason=field_mapjson__"actionReason"String_.of_jsoninletaction=field_mapjson__"action"GuardrailAction.of_jsoninletusage=field_mapjson__"usage"GuardrailUsage.of_jsoninmake?guardrailCoverage?assessments?outputs?actionReason?action?usage()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The action to apply a guardrail. For troubleshooting some of the common errors you might encounter when using the ApplyGuardrail API, see Troubleshooting Amazon Bedrock API Error Codes in the Amazon Bedrock User Guide"]moduleApplyGuardrailRequest=structtypenonrect={guardrailIdentifier:GuardrailIdentifier.t[@ocaml.doc"The guardrail identifier used in the request to apply the guardrail."];guardrailVersion:GuardrailVersion.t[@ocaml.doc"The guardrail version used in the request to apply the guardrail."];source:GuardrailContentSource.t[@ocaml.doc"The source of data used in the request to apply the guardrail."];content:GuardrailContentBlockList.t[@ocaml.doc"The content details used in the request to apply the guardrail."];outputScope:GuardrailOutputScope.toption[@ocaml.doc"Specifies the scope of the output that you get in the response. Set to FULL to return the entire output, including any detected and non-detected entries in the response for enhanced debugging. Note that the full output scope doesn't apply to word filters or regex in sensitive information filters. It does apply to all other filtering policies, including sensitive information with filters that can detect personally identifiable information (PII)."]}letcontext_="ApplyGuardrailRequest"letmake?outputScope=fun~guardrailIdentifier->fun~guardrailVersion->fun~source->fun~content->fun()->{outputScope;guardrailIdentifier;guardrailVersion;source;content}letto_valuex=structure_to_value[("guardrailIdentifier",(Some(GuardrailIdentifier.to_valuex.guardrailIdentifier)));("guardrailVersion",(Some(GuardrailVersion.to_valuex.guardrailVersion)));("source",(Some(GuardrailContentSource.to_valuex.source)));("content",(Some(GuardrailContentBlockList.to_valuex.content)));("outputScope",(Option.mapx.outputScope~f:GuardrailOutputScope.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letoutputScope=(Option.map~f:GuardrailOutputScope.of_xml)(Xml.childxml_arg0"outputScope")inletcontent=GuardrailContentBlockList.of_xml(Xml.child_exn~context:context_xml_arg0"content")inletsource=GuardrailContentSource.of_xml(Xml.child_exn~context:context_xml_arg0"source")inletguardrailVersion=GuardrailVersion.of_xml(Xml.child_exn~context:context_xml_arg0"guardrailVersion")inletguardrailIdentifier=GuardrailIdentifier.of_xml(Xml.child_exn~context:context_xml_arg0"guardrailIdentifier")inmake?outputScope~content~source~guardrailVersion~guardrailIdentifier()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letoutputScope=field_mapjson__"outputScope"GuardrailOutputScope.of_jsoninletcontent=field_map_exnjson__"content"GuardrailContentBlockList.of_jsoninletsource=field_map_exnjson__"source"GuardrailContentSource.of_jsoninletguardrailVersion=field_map_exnjson__"guardrailVersion"GuardrailVersion.of_jsoninletguardrailIdentifier=field_map_exnjson__"guardrailIdentifier"GuardrailIdentifier.of_jsoninmake?outputScope~content~source~guardrailVersion~guardrailIdentifier()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The action to apply a guardrail. For troubleshooting some of the common errors you might encounter when using the ApplyGuardrail API, see Troubleshooting Amazon Bedrock API Error Codes in the Amazon Bedrock User Guide"]