Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

Update language_models.md - Add Gemini (AIS) instructions (#8127)

xinyij-goo37feb1d8c49b
diff --git a/docs/docs/learn/programming/language_models.md b/docs/docs/learn/programming/language_models.md
index 77231c8dd..81c5bfcc7 100644
--- a/docs/docs/learn/programming/language_models.md
+++ b/docs/docs/learn/programming/language_models.md
@@ -23,6 +23,15 @@ dspy.configure(lm=lm)
dspy.configure(lm=lm)
```
+ === "Gemini (AI Studio)"
+ You can authenticate by setting the GEMINI_API_KEY env variable or passing `api_key` below.
+
+ ```python linenums="1"
+ import dspy
+ lm = dspy.LM('gemini/gemini-2.5-pro-preview-03-25', api_key='GEMINI_API_KEY')
+ dspy.configure(lm=lm)
+ ```
+
=== "Anthropic"
You can authenticate by setting the ANTHROPIC_API_KEY env variable or passing `api_key` below.