"use strict";(self.webpackChunk_postman_app_scratchpad=self.webpackChunk_postman_app_scratchpad||[]).push([[41],{7517:function(e,a,t){t.r(a),t.d(a,{VERSION:function(){return d},createDeepSeek:function(){return h},deepseek:function(){return m}});var s=t(7514),n=t(7395),r=t(7396),o=t(7399),l=e=>{var a,t;return null==e?void 0:{deepseek:{promptCacheHitTokens:null!=(a=e.prompt_cache_hit_tokens)?a:NaN,promptCacheMissTokens:null!=(t=e.prompt_cache_miss_tokens)?t:NaN}}},i={extractMetadata:async({parsedBody:e})=>{const a=await(0,r.safeValidateTypes)({value:e,schema:c});return a.success&&null!=a.value.usage?l(a.value.usage):void 0},createStreamExtractor:()=>{let e;return{processChunk:async a=>{var t,s;const n=await(0,r.safeValidateTypes)({value:a,schema:p});n.success&&"stop"===(null==(s=null==(t=n.value.choices)?void 0:t[0])?void 0:s.finish_reason)&&n.value.usage&&(e=n.value.usage)},buildMetadata:()=>l(e)}}},u=o.z.object({prompt_cache_hit_tokens:o.z.number().nullish(),prompt_cache_miss_tokens:o.z.number().nullish()}),c=o.z.object({usage:u.nullish()}),p=o.z.object({choices:o.z.array(o.z.object({finish_reason:o.z.string().nullish()})).nullish(),usage:u.nullish()}),d="1.0.23";function h(e={}){var a;const t=(0,r.withoutTrailingSlash)(null!=(a=e.baseURL)?a:"https://api.deepseek.com/v1"),o=()=>(0,r.withUserAgentSuffix)({Authorization:`Bearer ${(0,r.loadApiKey)({apiKey:e.apiKey,environmentVariableName:"DEEPSEEK_API_KEY",description:"DeepSeek API key"})}`,...e.headers},`ai-sdk/deepseek/${d}`),l=a=>new s.OpenAICompatibleChatLanguageModel(a,{provider:"deepseek.chat",url:({path:e})=>`${t}${e}`,headers:o,fetch:e.fetch,metadataExtractor:i}),u=e=>l(e);return u.languageModel=l,u.chat=l,u.textEmbeddingModel=e=>{throw new n.NoSuchModelError({modelId:e,modelType:"textEmbeddingModel"})},u.imageModel=e=>{throw new n.NoSuchModelError({modelId:e,modelType:"imageModel"})},u}var m=h()}}]);