dspy.Snowflake
Usage
import dspy
import os
connection_parameters = {
"account": os.getenv('SNOWFLAKE_ACCOUNT'),
"user": os.getenv('SNOWFLAKE_USER'),
"password": os.getenv('SNOWFLAKE_PASSWORD'),
"role": os.getenv('SNOWFLAKE_ROLE'),
"warehouse": os.getenv('SNOWFLAKE_WAREHOUSE'),
"database": os.getenv('SNOWFLAKE_DATABASE'),
"schema": os.getenv('SNOWFLAKE_SCHEMA')}
lm = dspy.Snowflake(model="mixtral-8x7b",credentials=connection_parameters)
Constructor
The constructor inherits from the base class LM
and verifies the credentials
for using Snowflake API.
class Snowflake(LM):
def __init__(
self,
model,
credentials,
**kwargs):
Parameters:
model
(str): model hosted by Snowflake Cortex.credentials
(dict): connection parameters required to initialize a snowflake snowpark session
Methods
Refer to dspy.Snowflake
documentation.