@crewai-ts/core 0.1.10 → 0.1.11

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.
package/dist/index.cjs CHANGED
@@ -46996,7 +46996,7 @@ var BedrockCompletion = class _BedrockCompletion extends ConfiguredLLM {
46996
46996
  maxTokens: options.maxTokens ?? options.max_tokens ?? null,
46997
46997
  timeout: options.timeout ?? null
46998
46998
  }));
46999
- this.regionName = options.regionName ?? options.region_name ?? null;
46999
+ this.regionName = options.regionName ?? options.region_name ?? process.env.AWS_DEFAULT_REGION ?? process.env.AWS_REGION_NAME ?? process.env.AWS_REGION ?? "us-east-1";
47000
47000
  this.region_name = this.regionName;
47001
47001
  this.session = options.session ?? null;
47002
47002
  this.timeout = options.timeout ?? null;
@@ -47117,7 +47117,14 @@ var BedrockCompletion = class _BedrockCompletion extends ConfiguredLLM {
47117
47117
  return this.getFileUploader();
47118
47118
  }
47119
47119
  toConfigDict() {
47120
- return super.toConfigDict();
47120
+ return {
47121
+ ...super.toConfigDict(),
47122
+ ...this.regionName && this.regionName !== "us-east-1" ? { region_name: this.regionName } : {},
47123
+ ...this.maxTokens === null ? {} : { max_tokens: this.maxTokens },
47124
+ ...this.topP === null ? {} : { top_p: this.topP },
47125
+ ...this.topK === null ? {} : { top_k: this.topK },
47126
+ ...this.guardrailConfig ? { guardrail_config: this.guardrailConfig } : {}
47127
+ };
47121
47128
  }
47122
47129
  to_config_dict() {
47123
47130
  return this.toConfigDict();
@@ -47531,8 +47538,8 @@ var GeminiCompletion = class _GeminiCompletion extends ConfiguredLLM {
47531
47538
  timeout: options.timeout ?? null
47532
47539
  }));
47533
47540
  this.project = options.project ?? process.env.GOOGLE_CLOUD_PROJECT ?? null;
47534
- this.location = options.location ?? "us-central1";
47535
- this.useVertexai = options.useVertexai ?? options.use_vertexai ?? false;
47541
+ this.location = options.location ?? process.env.GOOGLE_CLOUD_LOCATION ?? "us-central1";
47542
+ this.useVertexai = options.useVertexai ?? options.use_vertexai ?? process.env.GOOGLE_GENAI_USE_VERTEXAI?.toLowerCase() === "true";
47536
47543
  this.use_vertexai = this.useVertexai;
47537
47544
  this.timeout = options.timeout ?? null;
47538
47545
  this.maxRetries = options.maxRetries ?? options.max_retries ?? 2;
@@ -48806,7 +48813,11 @@ var AzureCompletion = class _AzureCompletion extends ConfiguredLLM {
48806
48813
  }
48807
48814
  return {
48808
48815
  endpoint,
48809
- api_key: apiKey,
48816
+ ...apiKey ? { api_key: apiKey } : {
48817
+ credential: {
48818
+ provider: "DefaultAzureCredential"
48819
+ }
48820
+ },
48810
48821
  api_version: this.apiVersion,
48811
48822
  ...credentialScopes ? { credential_scopes: credentialScopes } : {}
48812
48823
  };
@@ -48822,9 +48833,6 @@ var AzureCompletion = class _AzureCompletion extends ConfiguredLLM {
48822
48833
  if (!kwargs.endpoint) {
48823
48834
  throw new Error("Azure endpoint is required");
48824
48835
  }
48825
- if (!kwargs.api_key) {
48826
- throw new Error("Azure API key is required");
48827
- }
48828
48836
  this._client = {
48829
48837
  provider: "azure",
48830
48838
  model: this.model,
package/dist/index.js CHANGED
@@ -30657,7 +30657,7 @@ var BedrockCompletion = class _BedrockCompletion extends ConfiguredLLM {
30657
30657
  maxTokens: options.maxTokens ?? options.max_tokens ?? null,
30658
30658
  timeout: options.timeout ?? null
30659
30659
  }));
30660
- this.regionName = options.regionName ?? options.region_name ?? null;
30660
+ this.regionName = options.regionName ?? options.region_name ?? process.env.AWS_DEFAULT_REGION ?? process.env.AWS_REGION_NAME ?? process.env.AWS_REGION ?? "us-east-1";
30661
30661
  this.region_name = this.regionName;
30662
30662
  this.session = options.session ?? null;
30663
30663
  this.timeout = options.timeout ?? null;
@@ -30778,7 +30778,14 @@ var BedrockCompletion = class _BedrockCompletion extends ConfiguredLLM {
30778
30778
  return this.getFileUploader();
30779
30779
  }
30780
30780
  toConfigDict() {
30781
- return super.toConfigDict();
30781
+ return {
30782
+ ...super.toConfigDict(),
30783
+ ...this.regionName && this.regionName !== "us-east-1" ? { region_name: this.regionName } : {},
30784
+ ...this.maxTokens === null ? {} : { max_tokens: this.maxTokens },
30785
+ ...this.topP === null ? {} : { top_p: this.topP },
30786
+ ...this.topK === null ? {} : { top_k: this.topK },
30787
+ ...this.guardrailConfig ? { guardrail_config: this.guardrailConfig } : {}
30788
+ };
30782
30789
  }
30783
30790
  to_config_dict() {
30784
30791
  return this.toConfigDict();
@@ -31192,8 +31199,8 @@ var GeminiCompletion = class _GeminiCompletion extends ConfiguredLLM {
31192
31199
  timeout: options.timeout ?? null
31193
31200
  }));
31194
31201
  this.project = options.project ?? process.env.GOOGLE_CLOUD_PROJECT ?? null;
31195
- this.location = options.location ?? "us-central1";
31196
- this.useVertexai = options.useVertexai ?? options.use_vertexai ?? false;
31202
+ this.location = options.location ?? process.env.GOOGLE_CLOUD_LOCATION ?? "us-central1";
31203
+ this.useVertexai = options.useVertexai ?? options.use_vertexai ?? process.env.GOOGLE_GENAI_USE_VERTEXAI?.toLowerCase() === "true";
31197
31204
  this.use_vertexai = this.useVertexai;
31198
31205
  this.timeout = options.timeout ?? null;
31199
31206
  this.maxRetries = options.maxRetries ?? options.max_retries ?? 2;
@@ -32467,7 +32474,11 @@ var AzureCompletion = class _AzureCompletion extends ConfiguredLLM {
32467
32474
  }
32468
32475
  return {
32469
32476
  endpoint,
32470
- api_key: apiKey,
32477
+ ...apiKey ? { api_key: apiKey } : {
32478
+ credential: {
32479
+ provider: "DefaultAzureCredential"
32480
+ }
32481
+ },
32471
32482
  api_version: this.apiVersion,
32472
32483
  ...credentialScopes ? { credential_scopes: credentialScopes } : {}
32473
32484
  };
@@ -32483,9 +32494,6 @@ var AzureCompletion = class _AzureCompletion extends ConfiguredLLM {
32483
32494
  if (!kwargs.endpoint) {
32484
32495
  throw new Error("Azure endpoint is required");
32485
32496
  }
32486
- if (!kwargs.api_key) {
32487
- throw new Error("Azure API key is required");
32488
- }
32489
32497
  this._client = {
32490
32498
  provider: "azure",
32491
32499
  model: this.model,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewai-ts/core",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "Unofficial TypeScript port of CrewAI (not affiliated with crewAI, Inc.).",
5
5
  "keywords": [
6
6
  "crewai",