Skip to content

Commit 23cd780

Browse files
fix(dspy): adding LM connection parameter update to docs, resolving ruff issues and failing tests
1 parent 8dedd00 commit 23cd780

File tree

6 files changed

+228
-50
lines changed

6 files changed

+228
-50
lines changed

docs/api/language_model_clients/Snowflake.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ sidebar_position:
77
### Usage
88

99
```python
10+
import dspy
11+
import os
12+
13+
connection_parameters = {
14+
15+
"account": os.getenv('SNOWFLAKE_ACCOUNT'),
16+
"user": os.getenv('SNOWFLAKE_USER'),
17+
"password": os.getenv('SNOWFLAKE_PASSWORD'),
18+
"role": os.getenv('SNOWFLAKE_ROLE'),
19+
"warehouse": os.getenv('SNOWFLAKE_WAREHOUSE'),
20+
"database": os.getenv('SNOWFLAKE_DATABASE'),
21+
"schema": os.getenv('SNOWFLAKE_SCHEMA')}
22+
1023
lm = dspy.Snowflake(model="mixtral-8x7b",credentials=connection_parameters)
1124
```
1225

dsp/modules/snowflake.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ def __init__(self, model: str = "mixtral-8x7b", credentials=None, **kwargs):
4646
Which pre-trained model from Snowflake to use?
4747
Choices are 'snowflake-arctic','mistral-large','reka-flash','mixtral-8x7b','llama2-70b-chat','mistral-7b','gemma-7b'
4848
Full list of supported models is available here: https://docs.snowflake.com/en/user-guide/snowflake-cortex/llm-functions#complete
49+
credentials: dict
50+
Snowflake credentials required to initialize the session.
51+
Full list of requirements can be found here: https://docs.snowflake.com/en/developer-guide/snowpark/reference/python/latest/api/snowflake.snowpark.Session
4952
**kwargs: dict
5053
Additional arguments to pass to the API provider.
5154
"""

dspy/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from .signatures import *
88
from .utils.logging import logger, set_log_output
99

10-
1110
# Functional must be imported after primitives, predict and signatures
1211
from .functional import * # isort: skip
1312

dspy/retrieve/snowflake_rm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
try:
77
from snowflake.snowpark import Session
88
from snowflake.snowpark import functions as snow_fn
9-
from snowflake.snowpark.functions import lit, function, col
9+
from snowflake.snowpark.functions import col, function, lit
1010
from snowflake.snowpark.types import VectorType
1111

1212
except ImportError:

0 commit comments

Comments
 (0)