Skip to content

Commit 47b051a

Browse files
chore(docs): use environment variables for authentication in code snippets
1 parent 03b2f54 commit 47b051a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,17 @@ pip install gradient[aiohttp]
140140
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
141141

142142
```python
143+
import os
143144
import asyncio
144145
from gradient import DefaultAioHttpClient
145146
from gradient import AsyncGradient
146147

147148

148149
async def main() -> None:
149150
async with AsyncGradient(
151+
model_access_key=os.environ.get(
152+
"GRADIENT_MODEL_ACCESS_KEY"
153+
), # This is the default and can be omitted
150154
http_client=DefaultAioHttpClient(),
151155
) as client:
152156
completion = await client.chat.completions.create(

0 commit comments

Comments
 (0)