YoanSallami
commited on
Commit
·
45d9b08
1
Parent(s):
fa1e750
Avoid setting the env variables
Browse files
code_examples/1_basics/2_first_programs.py
CHANGED
@@ -247,10 +247,10 @@ def _(mo):
|
|
247 |
|
248 |
|
249 |
@app.cell(hide_code=True)
|
250 |
-
def _(mo, openai_api_key):
|
251 |
-
import
|
252 |
mo.stop(not openai_api_key.value)
|
253 |
-
|
254 |
return
|
255 |
|
256 |
|
|
|
247 |
|
248 |
|
249 |
@app.cell(hide_code=True)
|
250 |
+
def _(mo, openai_api_key, litellm):
|
251 |
+
import litellm
|
252 |
mo.stop(not openai_api_key.value)
|
253 |
+
litellm.openai_key = openai_api_key.value
|
254 |
return
|
255 |
|
256 |
|
code_examples/1_basics/4_conversational_applications.py
CHANGED
@@ -99,9 +99,9 @@ def _(mo):
|
|
99 |
|
100 |
@app.cell(hide_code=True)
|
101 |
def _(mo, openai_api_key):
|
102 |
-
import
|
103 |
mo.stop(not openai_api_key.value)
|
104 |
-
|
105 |
return
|
106 |
|
107 |
|
|
|
99 |
|
100 |
@app.cell(hide_code=True)
|
101 |
def _(mo, openai_api_key):
|
102 |
+
import litellm
|
103 |
mo.stop(not openai_api_key.value)
|
104 |
+
litellm.openai_key = openai_api_key.value
|
105 |
return
|
106 |
|
107 |
|
code_examples/1_basics/6_training_programs.py
CHANGED
@@ -200,9 +200,9 @@ def _(mo):
|
|
200 |
|
201 |
@app.cell(hide_code=True)
|
202 |
def _(mo, openai_api_key):
|
203 |
-
import
|
204 |
mo.stop(not openai_api_key.value)
|
205 |
-
|
206 |
return
|
207 |
|
208 |
|
|
|
200 |
|
201 |
@app.cell(hide_code=True)
|
202 |
def _(mo, openai_api_key):
|
203 |
+
import litellm
|
204 |
mo.stop(not openai_api_key.value)
|
205 |
+
litellm.openai_key = openai_api_key.value
|
206 |
return
|
207 |
|
208 |
|