@crewai-ts/snowflake
v0.2.1
Published
Snowflake Cortex native provider for CrewAI TypeScript.
Readme
@crewai-ts/snowflake
Snowflake Cortex native provider for CrewAI TypeScript.
Provides SnowflakeCompletion for calling models through Snowflake Cortex, extending the OpenAI-compatible provider with Snowflake-specific authentication and configuration.
Install
npm install @crewai-ts/snowflakeRequirements:
- Node.js 22 or later
@crewai-ts/core0.2.0 or later- Snowflake account and credentials
Quick Start
import { Agent } from "@crewai-ts/core";
import { SnowflakeCompletion, registerSnowflakeProvider } from "@crewai-ts/snowflake";
registerSnowflakeProvider();
const agent = new Agent({
role: "Analyst",
goal: "Analyze data",
backstory: "A data-driven analyst.",
llm: new SnowflakeCompletion({
model: "claude-3-5-sonnet",
accountUrl: "https://my-account.snowflakecomputing.com",
apiKey: process.env.SNOWFLAKE_PAT,
}),
});Or use the registered provider name:
const agent = new Agent({
role: "Analyst",
goal: "Analyze data",
backstory: "A data-driven analyst.",
llm: "snowflake/claude-3-5-sonnet",
});Authentication
The provider looks for API keys in this order:
apiKey/api_keyoptionSNOWFLAKE_PATenvironment variableSNOWFLAKE_TOKENenvironment variableSNOWFLAKE_JWTenvironment variable
Configuration
const llm = new SnowflakeCompletion({
model: "claude-3-5-sonnet",
accountUrl: "https://my-account.snowflakecomputing.com",
accountIdentifier: "my-account",
database: "my_db",
schemaName: "public",
warehouse: "my_warehouse",
role: "my_role",
apiKey: process.env.SNOWFLAKE_PAT,
});Exports
SnowflakeCompletion— main LLM provider classSNOWFLAKE_CORTEX_PATH— Cortex API path constantSNOWFLAKE_TOKEN_ENV_VARS— token environment variable namesregisterSnowflakeProvider— register the provider with the core runtime
License
MIT
