Skip to content

Commit 005309b

Browse files
Update README.md
1 parent 4f979ce commit 005309b

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,16 @@ The full API of this library can be found in [api.md](api.md).
2727
import os
2828
from gradientai import GradientAI
2929

30-
client = GradientAI(
30+
api_client = GradientAI(
3131
api_key=os.environ.get("GRADIENTAI_API_KEY"), # This is the default and can be omitted
3232
)
33+
inference_client = GradientAI(
34+
inference_key=os.environ.get("GRADIENTAI_INFERENCE_KEY"), # This is the default and can be omitted
35+
)
3336

34-
completion = client.agents.chat.completions.create(
37+
print(api_client.agents.list())
38+
39+
completion = inference_client.agents.chat.completions.create(
3540
messages=[
3641
{
3742
"content": "string",
@@ -40,12 +45,13 @@ completion = client.agents.chat.completions.create(
4045
],
4146
model="llama3-8b-instruct",
4247
)
43-
print(completion.id)
48+
print(completion.choices[0].message)
49+
4450
```
4551

46-
While you can provide an `api_key` keyword argument,
52+
While you can provide an `inference_key` keyword argument,
4753
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
48-
to add `GRADIENTAI_API_KEY="My API Key"` to your `.env` file
54+
to add `GRADIENTAI_INFERENCE_KEY="My API Key"` to your `.env` file
4955
so that your API Key is not stored in source control.
5056

5157
## Async usage

0 commit comments

Comments
 (0)