@stacksjs/ai 0.72.38 → 0.72.40

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 +1 @@
1
- import process from"node:process";let _client=null;async function getClient(){if(_client)return _client;const mod=await import("@stacksjs/ts-cloud/aws");if(!mod?.BedrockRuntimeClient)throw Error("@stacksjs/ts-cloud/aws does not export BedrockRuntimeClient \u2014 rebuild ts-cloud or remove the AI dependency.");_client=new mod.BedrockRuntimeClient(process.env.REGION||"us-east-1");return _client}export async function invokeModel(params){return(await getClient()).invokeModel(params)}export async function invokeModelWithResponseStream(params){return(await getClient()).invokeModelWithResponseStream(params)}
1
+ import process from"node:process";let _client=null;async function getClient(){if(_client)return _client;const mod=await import("@stacksjs/ts-cloud/aws");if(!mod?.BedrockRuntimeClient)throw Error("@stacksjs/ts-cloud/aws does not export BedrockRuntimeClient - rebuild ts-cloud or remove the AI dependency.");_client=new mod.BedrockRuntimeClient(process.env.REGION||"us-east-1");return _client}export async function invokeModel(params){return(await getClient()).invokeModel(params)}export async function invokeModelWithResponseStream(params){return(await getClient()).invokeModelWithResponseStream(params)}
@@ -1 +1 @@
1
- import process from"node:process";let _client=null;async function getClient(){if(_client)return _client;const mod=await import("@stacksjs/ts-cloud/aws");if(!mod?.BedrockClient)throw Error("@stacksjs/ts-cloud/aws does not export BedrockClient \u2014 rebuild ts-cloud or remove the AI dependency.");_client=new mod.BedrockClient(process.env.REGION||"us-east-1");return _client}export async function createModelCustomizationJob(param){return(await getClient()).createModelCustomizationJob(param)}export async function getModelCustomizationJob(params){return(await getClient()).getModelCustomizationJob(params)}export async function listFoundationModels(params){return(await getClient()).listFoundationModels(params)}
1
+ import process from"node:process";let _client=null;async function getClient(){if(_client)return _client;const mod=await import("@stacksjs/ts-cloud/aws");if(!mod?.BedrockClient)throw Error("@stacksjs/ts-cloud/aws does not export BedrockClient - rebuild ts-cloud or remove the AI dependency.");_client=new mod.BedrockClient(process.env.REGION||"us-east-1");return _client}export async function createModelCustomizationJob(param){return(await getClient()).createModelCustomizationJob(param)}export async function getModelCustomizationJob(params){return(await getClient()).getModelCustomizationJob(params)}export async function listFoundationModels(params){return(await getClient()).listFoundationModels(params)}
@@ -1 +1 @@
1
- import{log}from"@stacksjs/cli";import{ai}from"@stacksjs/config";async function getBedrockClient(){const mod=await import("@stacksjs/ts-cloud/aws");if(!mod?.BedrockClient)throw Error("@stacksjs/ts-cloud/aws does not export BedrockClient \u2014 rebuild ts-cloud or remove the AI dependency.");return new mod.BedrockClient("us-east-1")}export async function requestModelAccess(){const client=await getBedrockClient(),models=ai.models;if(!models)throw Error("No AI models found. Please set ./config/ai.ts values.");for(const model of models)try{log.info(`Requesting access to model ${model}`);const data=await client.requestModelAccess({modelId:model});log.info(`Response for model ${model}:`,data)}catch(error){log.error(`Error requesting access to model ${model}:`,error)}}
1
+ import{log}from"@stacksjs/cli";import{ai}from"@stacksjs/config";async function getBedrockClient(){const mod=await import("@stacksjs/ts-cloud/aws");if(!mod?.BedrockClient)throw Error("@stacksjs/ts-cloud/aws does not export BedrockClient - rebuild ts-cloud or remove the AI dependency.");return new mod.BedrockClient("us-east-1")}export async function requestModelAccess(){const client=await getBedrockClient(),models=ai.models;if(!models)throw Error("No AI models found. Please set ./config/ai.ts values.");for(const model of models)try{log.info(`Requesting access to model ${model}`);const data=await client.requestModelAccess({modelId:model});log.info(`Response for model ${model}:`,data)}catch(error){log.error(`Error requesting access to model ${model}:`,error)}}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/ai",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.72.38",
5
+ "version": "0.72.40",
6
6
  "description": "Stacks Artificial Intelligence.",
7
7
  "author": "Chris Breuer",
8
8
  "contributors": [