You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,8 @@
4
4
5
5
Commonbase allows developers to integrate with any popular LLM API provider
6
6
without needing to change any code. The SDK helps with collecting data and
7
-
feedback from the users and helps you fine-tune models for your specific use case.
7
+
feedback from the users and helps you fine-tune models for your specific use
8
+
case.
8
9
9
10
## Installation
10
11
@@ -14,9 +15,12 @@ pip install commonbase
14
15
15
16
## Usage
16
17
17
-
A Project ID and API Key are required for all Commonbase requests. You can find your project ID and generate an API key in the [Commonbase Dashboard](https://commonbase.com/).
18
+
A Project ID and API Key are required for all Commonbase requests. You can find
19
+
your project ID and generate an API key in the
20
+
[Commonbase Dashboard](https://commonbase.com/).
18
21
19
-
To create a completion, provide your Project ID, API Key, and prompt to `Completion.create`.
22
+
To create a text completion, provide your Project ID, API Key, and prompt to
23
+
`Completion.create`.
20
24
21
25
```py
22
26
import commonbase
@@ -27,9 +31,11 @@ result = commonbase.Completion.create(
27
31
prompt="Hello!"
28
32
)
29
33
30
-
print(result.best_result)
34
+
print(result.best_choice.text)
31
35
```
32
36
33
-
To stream a completion as it is generated, use `Completion.stream`.
37
+
To stream a completion as it is generated, use `ChatCompletion.stream`.
34
38
35
-
For more examples, see [/examples](https://github.com/commonbaseapp/commonbase-python/tree/main/examples) or check out our [Docs](https://docs.commonbase.com/quickstart/python).
0 commit comments