@acosmi/sdk-ts 2.19.1 → 2.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- import { a as AnthropicResponse } from './openai-CMrvATF_.cjs';
2
- export { A as AnthropicContentBlock, b as AnthropicUsage, O as OpenAIAdapter, d as anthropicResponseTextContent, e as anthropicResponseThinkingContent, f as anthropicResponseToolUseBlocks } from './openai-CMrvATF_.cjs';
3
- import { M as ManagedModel, Q as QuotaSummary, U as WindowResetSummary, n as ModelCapabilities, e as ChatRequest, P as ProviderAdapter, f as ChatResponse, I as ImageGenerationRequest, k as ImageGenerationResponse, V as VideoGenerationRequest, K as VideoTaskResponse, i as EmbeddingRequest, j as EmbeddingResponse, r as RerankRequest, s as RerankResponse, y as StreamEvent, v as SourcesEvent, z as StreamSettlement, l as InputModality } from './index-C2oh157O.cjs';
4
- export { B as BucketClassCommercial, a as BucketClassGeneric, b as BucketInfo, c as BucketRow, C as ChatContentBlock, d as ChatMessage, g as ChatUsage, E as EffortConfig, h as EmbeddingData, G as GeoLoc, m as InputModalityTag, o as MultimodalContent, O as OutputConfig, p as ProviderFormat, R as RerankDocument, q as RerankQuery, t as RerankResult, S as ServerTool, u as ServerToolTypeWebSearch, w as SourcesEventIssueCode, x as SourcesEventParseResult, T as ThinkingConfig, A as ThinkingHigh, D as ThinkingHighMinMaxTokens, F as ThinkingMax, H as ThinkingMaxFallbackMaxTokens, J as ThinkingOff, W as WebSearchConfig, L as WebSearchSource, N as WindowLimitStatus, X as bucketInfoIsCommercial, Y as bucketRowIsCommercial, Z as classifySourcesEvent, _ as getAdapter, $ as getAdapterForModel, a0 as newThinkingConfig, a1 as newWebSearchTool, a2 as parseSettlement, a3 as parseSourcesEvent } from './index-C2oh157O.cjs';
1
+ import { a as AnthropicResponse } from './openai-Ce85qh14.cjs';
2
+ export { A as AnthropicContentBlock, b as AnthropicUsage, O as OpenAIAdapter, d as anthropicResponseTextContent, e as anthropicResponseThinkingContent, f as anthropicResponseToolUseBlocks } from './openai-Ce85qh14.cjs';
3
+ import { M as ManagedModel, Q as QuotaSummary, X as WindowResetSummary, n as ModelCapabilities, e as ChatRequest, P as ProviderAdapter, f as ChatResponse, I as ImageGenerationRequest, k as ImageGenerationResponse, V as VideoGenerationRequest, L as VideoTaskResponse, i as EmbeddingRequest, j as EmbeddingResponse, r as RerankRequest, s as RerankResponse, y as StreamEvent, v as SourcesEvent, z as StreamSettlement, l as InputModality } from './index-CqxPqbsl.cjs';
4
+ export { B as BucketClassCommercial, a as BucketClassGeneric, b as BucketInfo, c as BucketRow, C as ChatContentBlock, d as ChatMessage, g as ChatUsage, E as EffortConfig, h as EmbeddingData, G as GeoLoc, m as InputModalityTag, o as MultimodalContent, O as OutputConfig, p as ProviderFormat, R as RerankDocument, q as RerankQuery, t as RerankResult, S as ServerTool, u as ServerToolTypeWebSearch, w as SourcesEventIssueCode, x as SourcesEventParseResult, T as ThinkingConfig, A as ThinkingHigh, D as ThinkingHighMinMaxTokens, F as ThinkingLow, H as ThinkingMax, J as ThinkingMaxFallbackMaxTokens, K as ThinkingOff, W as WebSearchConfig, N as WebSearchSource, U as WindowLimitStatus, Y as bucketInfoIsCommercial, Z as bucketRowIsCommercial, _ as classifySourcesEvent, $ as getAdapter, a0 as getAdapterForModel, a1 as newThinkingConfig, a2 as newWebSearchTool, a3 as parseSettlement, a4 as parseSourcesEvent } from './index-CqxPqbsl.cjs';
5
5
  import { M as MinimalSanitizeConfig } from './index-Bah9A83R.cjs';
6
6
  export { A as sanitize } from './index-Bah9A83R.cjs';
7
7
  export { AnthropicAdapter } from './adapters/anthropic.cjs';
@@ -1,7 +1,7 @@
1
- import { a as AnthropicResponse } from './openai-BbCQOMNY.js';
2
- export { A as AnthropicContentBlock, b as AnthropicUsage, O as OpenAIAdapter, d as anthropicResponseTextContent, e as anthropicResponseThinkingContent, f as anthropicResponseToolUseBlocks } from './openai-BbCQOMNY.js';
3
- import { M as ManagedModel, Q as QuotaSummary, U as WindowResetSummary, n as ModelCapabilities, e as ChatRequest, P as ProviderAdapter, f as ChatResponse, I as ImageGenerationRequest, k as ImageGenerationResponse, V as VideoGenerationRequest, K as VideoTaskResponse, i as EmbeddingRequest, j as EmbeddingResponse, r as RerankRequest, s as RerankResponse, y as StreamEvent, v as SourcesEvent, z as StreamSettlement, l as InputModality } from './index-C2oh157O.js';
4
- export { B as BucketClassCommercial, a as BucketClassGeneric, b as BucketInfo, c as BucketRow, C as ChatContentBlock, d as ChatMessage, g as ChatUsage, E as EffortConfig, h as EmbeddingData, G as GeoLoc, m as InputModalityTag, o as MultimodalContent, O as OutputConfig, p as ProviderFormat, R as RerankDocument, q as RerankQuery, t as RerankResult, S as ServerTool, u as ServerToolTypeWebSearch, w as SourcesEventIssueCode, x as SourcesEventParseResult, T as ThinkingConfig, A as ThinkingHigh, D as ThinkingHighMinMaxTokens, F as ThinkingMax, H as ThinkingMaxFallbackMaxTokens, J as ThinkingOff, W as WebSearchConfig, L as WebSearchSource, N as WindowLimitStatus, X as bucketInfoIsCommercial, Y as bucketRowIsCommercial, Z as classifySourcesEvent, _ as getAdapter, $ as getAdapterForModel, a0 as newThinkingConfig, a1 as newWebSearchTool, a2 as parseSettlement, a3 as parseSourcesEvent } from './index-C2oh157O.js';
1
+ import { a as AnthropicResponse } from './openai-mkTSir6E.js';
2
+ export { A as AnthropicContentBlock, b as AnthropicUsage, O as OpenAIAdapter, d as anthropicResponseTextContent, e as anthropicResponseThinkingContent, f as anthropicResponseToolUseBlocks } from './openai-mkTSir6E.js';
3
+ import { M as ManagedModel, Q as QuotaSummary, X as WindowResetSummary, n as ModelCapabilities, e as ChatRequest, P as ProviderAdapter, f as ChatResponse, I as ImageGenerationRequest, k as ImageGenerationResponse, V as VideoGenerationRequest, L as VideoTaskResponse, i as EmbeddingRequest, j as EmbeddingResponse, r as RerankRequest, s as RerankResponse, y as StreamEvent, v as SourcesEvent, z as StreamSettlement, l as InputModality } from './index-CqxPqbsl.js';
4
+ export { B as BucketClassCommercial, a as BucketClassGeneric, b as BucketInfo, c as BucketRow, C as ChatContentBlock, d as ChatMessage, g as ChatUsage, E as EffortConfig, h as EmbeddingData, G as GeoLoc, m as InputModalityTag, o as MultimodalContent, O as OutputConfig, p as ProviderFormat, R as RerankDocument, q as RerankQuery, t as RerankResult, S as ServerTool, u as ServerToolTypeWebSearch, w as SourcesEventIssueCode, x as SourcesEventParseResult, T as ThinkingConfig, A as ThinkingHigh, D as ThinkingHighMinMaxTokens, F as ThinkingLow, H as ThinkingMax, J as ThinkingMaxFallbackMaxTokens, K as ThinkingOff, W as WebSearchConfig, N as WebSearchSource, U as WindowLimitStatus, Y as bucketInfoIsCommercial, Z as bucketRowIsCommercial, _ as classifySourcesEvent, $ as getAdapter, a0 as getAdapterForModel, a1 as newThinkingConfig, a2 as newWebSearchTool, a3 as parseSettlement, a4 as parseSourcesEvent } from './index-CqxPqbsl.js';
5
5
  import { M as MinimalSanitizeConfig } from './index-Bah9A83R.js';
6
6
  export { A as sanitize } from './index-Bah9A83R.js';
7
7
  export { AnthropicAdapter } from './adapters/anthropic.js';
@@ -132,12 +132,13 @@ function parseSettlement(ev) {
132
132
  callRemaining: s.callRemaining ?? -1
133
133
  };
134
134
  }
135
- var BucketClassCommercial, BucketClassGeneric, ThinkingOff, ThinkingHigh, ThinkingMax, ThinkingHighMinMaxTokens, ThinkingMaxFallbackMaxTokens, ServerToolTypeWebSearch;
135
+ var BucketClassCommercial, BucketClassGeneric, ThinkingOff, ThinkingLow, ThinkingHigh, ThinkingMax, ThinkingHighMinMaxTokens, ThinkingMaxFallbackMaxTokens, ServerToolTypeWebSearch;
136
136
  var init_types = __esm({
137
137
  "src/models/types.ts"() {
138
138
  BucketClassCommercial = "COMMERCIAL";
139
139
  BucketClassGeneric = "GENERIC";
140
140
  ThinkingOff = "off";
141
+ ThinkingLow = "low";
141
142
  ThinkingHigh = "high";
142
143
  ThinkingMax = "max";
143
144
  ThinkingHighMinMaxTokens = 32e3;
@@ -504,6 +505,8 @@ function resolveThinkingLevel(body, req, caps) {
504
505
  }
505
506
  if (caps.supports_effort) {
506
507
  let effortLevel = "high";
508
+ if (level === "low") effortLevel = "low";
509
+ if (level === "medium" || level === "xhigh") effortLevel = level;
507
510
  if (level === ThinkingMax && caps.supports_max_effort) {
508
511
  effortLevel = "max";
509
512
  }
@@ -681,23 +684,28 @@ __export(openai_exports, {
681
684
  resolveOpenAIReasoningEffort: () => resolveOpenAIReasoningEffort,
682
685
  resolveOpenAIResponseFormat: () => resolveOpenAIResponseFormat
683
686
  });
684
- function resolveOpenAIReasoningEffort(req) {
687
+ function resolveOpenAIReasoningEffort(req, supportsMax = false) {
685
688
  if (req.effort && req.effort.level !== "") {
686
689
  switch (req.effort.level) {
687
690
  case "low":
688
691
  case "medium":
689
692
  case "high":
693
+ case "xhigh":
690
694
  return req.effort.level;
691
695
  case "max":
692
- return "high";
696
+ return supportsMax ? "max" : "high";
693
697
  }
694
698
  }
695
699
  if (req.thinking) {
696
700
  switch (req.thinking.level) {
701
+ case "low":
702
+ case "medium":
703
+ case "xhigh":
704
+ return req.thinking.level;
697
705
  case ThinkingHigh:
698
706
  return "high";
699
707
  case ThinkingMax:
700
- return "high";
708
+ return supportsMax ? "max" : "high";
701
709
  case ThinkingOff:
702
710
  return "";
703
711
  }
@@ -901,10 +909,13 @@ var init_openai = __esm({
901
909
  if (req.tools != null) {
902
910
  body["tools"] = req.tools;
903
911
  }
904
- const eff = resolveOpenAIReasoningEffort(req);
912
+ const eff = resolveOpenAIReasoningEffort(req, _caps.supports_max_effort);
905
913
  if (eff !== "") {
906
914
  body["reasoning_effort"] = eff;
907
915
  }
916
+ if (_caps.supports_thinking && req.thinking?.level === ThinkingOff) {
917
+ body["thinking"] = { type: "disabled" };
918
+ }
908
919
  if (req.speed && req.speed !== "") {
909
920
  body["speed"] = req.speed;
910
921
  }
@@ -8869,6 +8880,6 @@ function brandCredential(c) {
8869
8880
  return c;
8870
8881
  }
8871
8882
 
8872
- export { AGENT_RUN_META_TITLE, AGENT_RUN_META_WORKSPACE, ALL_INTEGRATION_STATUS, ALL_PLATFORMS, ALL_REGIONS, AgentRunStreamError, AgentRunsClient, AnthropicAdapter, AudienceEnum, BillingModeEnum, BucketClassCommercial, BucketClassGeneric, BusinessError, CHAT_REQUEST_TIMEOUT_MS, ChatBridgeClient, Client, ComplianceClient, CompliancePollError, CrabCodeByokClient, DEFAULT_API_TIMEOUT_MS, DEFAULT_GATEWAY_BASE_URL, DefaultRetryPolicy, ErrAuthDenied, ErrBillingCallbackCannotCommit, ErrBillingCommitRequiresLocalVerify, ErrBillingS2sForbidden, ErrBrowserOpen, ErrComplianceStepUpRequired, ErrDiscovery, ErrEnvelopeGateClosed, ErrOAuthCORSBlocked, ErrProviderNotConfigured, ErrProviderUnknownNoRetry, ErrRefreshProxyFailed, ErrRegistration, ErrSSLProxy, ErrSealApprovalContractHashMismatch, ErrSealApprovalExpired, ErrSealApprovalLocationMismatch, ErrSealApprovalNonceUsed, ErrSealApprovalNotApproved, ErrSealApprovalSealMismatch, ErrSealApprovalTransactorMismatch, ErrSealUseAlreadyConsumed, ErrStateMismatch, ErrTimeout, ErrTokenExchange, ErrTokenExpired, EventAuthURL, EventComplete, EventError, FileTokenStore, FilterStatusAdminBypass, FilterStatusDisabledByFlag, FilterStatusFallbackMissingUser, FilterStatusFallbackNoBuckets, FilterStatusFallbackTkdistError, FilterStatusFallbackTkdistSkew, FilterStatusInternalBypass, FilterStatusOK, FilterStatusUnknown, GATEWAY_REQUEST_ID_HEADER, HTTPError, IdempotencyKeyHeader, InMemoryTokenStore, LocalStorageTokenStore, ModelNotFoundError, NetworkError, OAuthTokenEndpointError, OpenAIAdapter, OrderTerminalError, ProductFamilyEnum, ProviderFormat, RETRY_ADVICE_REASONS, RateLimitError, RegionScopeEnum, ScopeAI, ScopeAccount, ScopeAgentAccessManage, ScopeChatBridge, ScopeChatBridgeRead, ScopeChatBridgeRotate, ScopeChatBridgeWrite, ScopeComplianceContractSigningRead, ScopeComplianceContractSigningWrite, ScopeComplianceContractTemplateRead, ScopeComplianceContractTemplateWrite, ScopeComplianceEvidenceRead, ScopeComplianceEvidenceWrite, ScopeComplianceReportsPublish, ScopeComplianceReportsRead, ScopeComplianceReportsWrite, ScopeComplianceSealApprovalApprove, ScopeComplianceSealApprovalRequest, ScopeComplianceSealManage, ScopeComplianceSealUseExecute, ScopeComplianceTimestampIssue, ScopeComplianceTimestampVerify, ScopeEntitlements, ScopeModels, ScopeModelsChat, ScopeProfile, ScopeRemoteControl, ScopeRemoteControlAgentRun, ScopeRemoteControlPermissionResponse, ScopeRemoteControlSessionControl, ScopeSkillStore, ScopeSkills, ScopeTokenPackages, ScopeTools, ScopeToolsExecute, ScopeWallet, ScopeWalletReadonly, ServerToolTypeWebSearch, StreamError, ThinkingHigh, ThinkingHighMinMaxTokens, ThinkingMax, ThinkingMaxFallbackMaxTokens, ThinkingOff, agentAccessScopes, allScopes, anthropicResponseTextContent, anthropicResponseThinkingContent, anthropicResponseToolUseBlocks, apiResponseBusinessError, apiResponseGetMessage, asCredentialRef, authorize, bucketInfoIsCommercial, bucketRowIsCommercial, buildBetas, chatBridgeScopes, classifyComplianceError, classifySourcesEvent, commerceScopes, completeWebAuthorizationRequest, complianceErrorToRetryAdvice, complianceScopes, computeBackoff, createWebAuthorizationRequest, defaultRetryable, defaultSafeToRetry, discover, discoverWebOAuthMetadata, discoverWithProfile, effectivePolicy, exchangeCode, extractAnthropicBlockMeta, fileLockDefaults, findDesktopVisualUnderstandingModel, findFirstModelByInputModality, generateState, getAdapter, getAdapterForModel, getWindowLimitStreamDetails, isBillingConfirmable, isChannelInboundEvent, isComplianceBusinessError, isComplianceTerminalError, isContinuableWindowLimitError, isIntegrationStatus, isInvalidGrantError, isPlatform, isRegion, isSSECommentLine, isSSLError, isTerminalRemoteEvent, isUserAccessTokenRejected, isValidTokenSet, isWindowLimitError, isWindowLimitStreamError, maxEndUserIdLength, modelScopes, modelSupportsImageInput, modelSupportsInputModality, newFileTokenStore, newThinkingConfig, newTokenSet, newWebSearchTool, normalizeGatewayBaseURL, normalizeOverrideBaseURL, parseNotificationEvent, parseRemoteControlEvent, parseSettlement, parseSourcesEvent, readGatewayErrorContract, refreshToken, register, registerWebOAuthClient, remoteControlScopes, retryReasonForComplianceKey, retryReasonForOAuthError, revokeToken, sanitize_exports as sanitize, skillScopes, tokenSetIsExpired, uniqueMerge, validateEndUserId };
8883
+ export { AGENT_RUN_META_TITLE, AGENT_RUN_META_WORKSPACE, ALL_INTEGRATION_STATUS, ALL_PLATFORMS, ALL_REGIONS, AgentRunStreamError, AgentRunsClient, AnthropicAdapter, AudienceEnum, BillingModeEnum, BucketClassCommercial, BucketClassGeneric, BusinessError, CHAT_REQUEST_TIMEOUT_MS, ChatBridgeClient, Client, ComplianceClient, CompliancePollError, CrabCodeByokClient, DEFAULT_API_TIMEOUT_MS, DEFAULT_GATEWAY_BASE_URL, DefaultRetryPolicy, ErrAuthDenied, ErrBillingCallbackCannotCommit, ErrBillingCommitRequiresLocalVerify, ErrBillingS2sForbidden, ErrBrowserOpen, ErrComplianceStepUpRequired, ErrDiscovery, ErrEnvelopeGateClosed, ErrOAuthCORSBlocked, ErrProviderNotConfigured, ErrProviderUnknownNoRetry, ErrRefreshProxyFailed, ErrRegistration, ErrSSLProxy, ErrSealApprovalContractHashMismatch, ErrSealApprovalExpired, ErrSealApprovalLocationMismatch, ErrSealApprovalNonceUsed, ErrSealApprovalNotApproved, ErrSealApprovalSealMismatch, ErrSealApprovalTransactorMismatch, ErrSealUseAlreadyConsumed, ErrStateMismatch, ErrTimeout, ErrTokenExchange, ErrTokenExpired, EventAuthURL, EventComplete, EventError, FileTokenStore, FilterStatusAdminBypass, FilterStatusDisabledByFlag, FilterStatusFallbackMissingUser, FilterStatusFallbackNoBuckets, FilterStatusFallbackTkdistError, FilterStatusFallbackTkdistSkew, FilterStatusInternalBypass, FilterStatusOK, FilterStatusUnknown, GATEWAY_REQUEST_ID_HEADER, HTTPError, IdempotencyKeyHeader, InMemoryTokenStore, LocalStorageTokenStore, ModelNotFoundError, NetworkError, OAuthTokenEndpointError, OpenAIAdapter, OrderTerminalError, ProductFamilyEnum, ProviderFormat, RETRY_ADVICE_REASONS, RateLimitError, RegionScopeEnum, ScopeAI, ScopeAccount, ScopeAgentAccessManage, ScopeChatBridge, ScopeChatBridgeRead, ScopeChatBridgeRotate, ScopeChatBridgeWrite, ScopeComplianceContractSigningRead, ScopeComplianceContractSigningWrite, ScopeComplianceContractTemplateRead, ScopeComplianceContractTemplateWrite, ScopeComplianceEvidenceRead, ScopeComplianceEvidenceWrite, ScopeComplianceReportsPublish, ScopeComplianceReportsRead, ScopeComplianceReportsWrite, ScopeComplianceSealApprovalApprove, ScopeComplianceSealApprovalRequest, ScopeComplianceSealManage, ScopeComplianceSealUseExecute, ScopeComplianceTimestampIssue, ScopeComplianceTimestampVerify, ScopeEntitlements, ScopeModels, ScopeModelsChat, ScopeProfile, ScopeRemoteControl, ScopeRemoteControlAgentRun, ScopeRemoteControlPermissionResponse, ScopeRemoteControlSessionControl, ScopeSkillStore, ScopeSkills, ScopeTokenPackages, ScopeTools, ScopeToolsExecute, ScopeWallet, ScopeWalletReadonly, ServerToolTypeWebSearch, StreamError, ThinkingHigh, ThinkingHighMinMaxTokens, ThinkingLow, ThinkingMax, ThinkingMaxFallbackMaxTokens, ThinkingOff, agentAccessScopes, allScopes, anthropicResponseTextContent, anthropicResponseThinkingContent, anthropicResponseToolUseBlocks, apiResponseBusinessError, apiResponseGetMessage, asCredentialRef, authorize, bucketInfoIsCommercial, bucketRowIsCommercial, buildBetas, chatBridgeScopes, classifyComplianceError, classifySourcesEvent, commerceScopes, completeWebAuthorizationRequest, complianceErrorToRetryAdvice, complianceScopes, computeBackoff, createWebAuthorizationRequest, defaultRetryable, defaultSafeToRetry, discover, discoverWebOAuthMetadata, discoverWithProfile, effectivePolicy, exchangeCode, extractAnthropicBlockMeta, fileLockDefaults, findDesktopVisualUnderstandingModel, findFirstModelByInputModality, generateState, getAdapter, getAdapterForModel, getWindowLimitStreamDetails, isBillingConfirmable, isChannelInboundEvent, isComplianceBusinessError, isComplianceTerminalError, isContinuableWindowLimitError, isIntegrationStatus, isInvalidGrantError, isPlatform, isRegion, isSSECommentLine, isSSLError, isTerminalRemoteEvent, isUserAccessTokenRejected, isValidTokenSet, isWindowLimitError, isWindowLimitStreamError, maxEndUserIdLength, modelScopes, modelSupportsImageInput, modelSupportsInputModality, newFileTokenStore, newThinkingConfig, newTokenSet, newWebSearchTool, normalizeGatewayBaseURL, normalizeOverrideBaseURL, parseNotificationEvent, parseRemoteControlEvent, parseSettlement, parseSourcesEvent, readGatewayErrorContract, refreshToken, register, registerWebOAuthClient, remoteControlScopes, retryReasonForComplianceKey, retryReasonForOAuthError, revokeToken, sanitize_exports as sanitize, skillScopes, tokenSetIsExpired, uniqueMerge, validateEndUserId };
8873
8884
  //# sourceMappingURL=index.mjs.map
8874
8885
  //# sourceMappingURL=index.mjs.map