// @bun
import{sh as Z,th as D}from"./chunk-gvdy1ra6.js";import{uh as B}from"./chunk-ff7fhdap.js";import"./chunk-35vyf0nt.js";import{Li as Q,Zi as X,cj as Y,ri as P}from"./chunk-weegedds.js";import"./chunk-0dcnzv90.js";import{LG as y}from"./chunk-xyhgvt88.js";var $=y(B(),1);function j(q){let J=new $.GoogleAuth({scopes:["https://www.googleapis.com/auth/cloud-platform"],...q});return async function(){var f;let F=await(await J.getClient()).getAccessToken();return(f=F==null?void 0:F.token)!=null?f:null}}var E={bash_20241022:D.bash_20241022,bash_20250124:D.bash_20250124,textEditor_20241022:D.textEditor_20241022,textEditor_20250124:D.textEditor_20250124,textEditor_20250429:D.textEditor_20250429,textEditor_20250728:D.textEditor_20250728,computer_20241022:D.computer_20241022,webSearch_20250305:D.webSearch_20250305,toolSearchRegex_20251119:D.toolSearchRegex_20251119,toolSearchBm25_20251119:D.toolSearchBm25_20251119};function G(q={}){let J=()=>{var z;let F=Q({settingValue:q.location,environmentVariableName:"GOOGLE_VERTEX_LOCATION"}),K=Q({settingValue:q.project,environmentVariableName:"GOOGLE_VERTEX_PROJECT"});return(z=Y(q.baseURL))!=null?z:`https://${F==="global"?"":F+"-"}aiplatform.googleapis.com/v1/projects/${K}/locations/${F}/publishers/anthropic/models`},H=(z)=>{var F;return new Z(z,{provider:"vertex.anthropic.messages",baseURL:J(),headers:(F=q.headers)!=null?F:{},fetch:q.fetch,buildRequestUrl:(K,W)=>`${K}/${z}:${W?"streamRawPredict":"rawPredict"}`,transformRequestBody:(K)=>{let{model:W,...w}=K;return{...w,anthropic_version:"vertex-2023-10-16"}},supportedUrls:()=>({}),supportsNativeStructuredOutput:!1,supportsStrictTools:!1})},f=function(z){if(new.target)throw Error("The Anthropic model function cannot be called with the new keyword.");return H(z)};return f.specificationVersion="v3",f.languageModel=H,f.chat=H,f.messages=H,f.embeddingModel=(z)=>{throw new P({modelId:z,modelType:"embeddingModel"})},f.textEmbeddingModel=f.embeddingModel,f.imageModel=(z)=>{throw new P({modelId:z,modelType:"imageModel"})},f.tools=E,f}function N(q={}){var J;let H=(J=q.generateAuthToken)!=null?J:j(q.googleAuthOptions);return G({...q,headers:async()=>({Authorization:`Bearer ${await H()}`,...await X(q.headers)})})}var R=N();export{R as vertexAnthropic,N as createVertexAnthropic};
