DSPy: The framework for programming—not prompting—language models
Python
docs(dspy): Adding documentation for Snowflake LM
alejandroc663444fec6e
diff --git a/docs/api/language_model_clients/Snowflake.md b/docs/api/language_model_clients/Snowflake.mdnew file mode 100644index 000000000..b0eb5725f--- /dev/null+++ b/docs/api/language_model_clients/Snowflake.md@@ -0,0 +1,32 @@+---+sidebar_position:+---++# dspy.Snowflake++### Usage++```python+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.++```python+class Snowflake(LM):+ def __init__(+ self,+ model,+ credentials,+ **kwargs):+```++**Parameters:**+- `model` (_str_): model hosted by [Snowflake Cortex](https://docs.snowflake.com/en/user-guide/snowflake-cortex/llm-functions#availability).+- `credentials` (_dict_): connection parameters required to initialize a [snowflake snowpark session](https://docs.snowflake.com/en/developer-guide/snowpark/reference/python/latest/api/snowflake.snowpark.Session)++### Methods++Refer to [`dspy.Snowflake`](https://dspy-docs.vercel.app/api/language_model_clients/Snowflake) documentation.diff --git a/dsp/modules/snowflake.py b/dsp/modules/snowflake.pyindex 3cc7c4aa5..0d53ca8d3 100644--- a/dsp/modules/snowflake.py+++ b/dsp/modules/snowflake.py@@ -34,7 +34,7 @@ def giveup_hdlr(details) -> bool:class Snowflake(LM):"""Wrapper around Snowflake's CortexAPI.- Currently supported models include 'mistral-large','reka-flash','mixtral-8x7b',+ Currently supported models include 'snowflake-arctic','mistral-large','reka-flash','mixtral-8x7b','llama2-70b-chat','mistral-7b','gemma-7b'."""@@ -44,7 +44,7 @@ class Snowflake(LM):----------model : strWhich pre-trained model from Snowflake to use?- Choices are 'mistral-large','reka-flash','mixtral-8x7b','llama2-70b-chat','mistral-7b','gemma-7b'+ Choices are 'snowflake-arctic','mistral-large','reka-flash','mixtral-8x7b','llama2-70b-chat','mistral-7b','gemma-7b'Full list of supported models is available here: https://docs.snowflake.com/en/user-guide/snowflake-cortex/llm-functions#complete**kwargs: dictAdditional arguments to pass to the API provider.@@ -52,7 +52,7 @@ class Snowflake(LM):super().__init__(model)self.model = model- cortex_models = ["mistral-large", "reka-flash", "mixtral-8x7b", "llama2-70b-chat", "mistral-7b", "gemma-7b"]+ cortex_models = ["snowflake-arctic","mistral-large", "reka-flash", "mixtral-8x7b", "llama2-70b-chat", "mistral-7b", "gemma-7b"]if model in cortex_models:self.available_args = {