Skip to content

Commit 51c389d

Browse files
Fix README.md
1 parent 20c20ad commit 51c389d

File tree

3 files changed

+54
-41
lines changed

3 files changed

+54
-41
lines changed

.fernignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
4.0.0-5.0.0-migration-guide.md
1+
4.0.0-5.0.0-migration-guide.md
2+
banner.png
3+
README.md

README.md

Lines changed: 51 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,73 @@
1-
<!-- Begin Title, generated by Fern -->
2-
# Cohere Python Library
1+
# Cohere Python SDK
32

3+
![](banner.png)
4+
5+
![version badge](https://img.shields.io/pypi/v/cohere)
6+
![license badge](https://img.shields.io/github/license/cohere-ai/cohere-python)
47
[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen)](https://github.com/fern-api/fern)
58

6-
The Cohere Python Library provides convenient access to the Cohere API from applications written in Python.
7-
<!-- End Title -->
9+
The Cohere Python SDK provides access to the Cohere API from Python.
10+
11+
## ✨🪩✨ Announcing Cohere's new Python SDK ✨🪩✨
12+
13+
We are very excited to publish this brand new Python SDK. We will continuously update this library with all of the latest features in our API. Please create issues where you have feedback so that we can continue to improve the developer experience!
14+
15+
## Documentation
816

9-
<!-- Begin Installation, generated by Fern -->
10-
# Installation
17+
Cohere documentation and API reference is available [here](https://docs.cohere.com/).
1118

12-
```sh
13-
pip install --upgrade cohere
19+
## Installation
20+
21+
```
22+
pip install --pre --upgrade cohere
1423
```
15-
<!-- End Installation -->
1624

17-
<!-- Begin Usage, generated by Fern -->
18-
# Usage
25+
## Usage
26+
27+
```Python
28+
import cohere
29+
from cohere.client import ClassifyExample, ParseInfo
1930

20-
```python
21-
from cohere.client import Client
31+
co = cohere.Client(
32+
api_key="YOUR_API_KEY",
33+
)
2234

23-
client = Client(
24-
client_name="YOUR_CLIENT_NAME",
25-
token="YOUR_TOKEN",
35+
chat = co.chat(
36+
message="hello world!",
37+
model="command"
2638
)
39+
40+
print(chat)
2741
```
28-
<!-- End Usage -->
2942

30-
<!-- Begin Async Usage, generated by Fern -->
31-
# Async Client
43+
## Streaming
3244

33-
```python
34-
from cohere.client import AsyncClient
45+
The SDK supports streaming endpoints. To take advantage of this feature for chat,
46+
use `chat_stream`.
3547

36-
client = AsyncClient(
37-
client_name="YOUR_CLIENT_NAME",
38-
token="YOUR_TOKEN",
48+
```Python
49+
import cohere
50+
from cohere.client import ClassifyExample, ParseInfo
51+
52+
co = cohere.Client(
53+
api_key="YOUR_API_KEY",
3954
)
55+
56+
stream = co.chat_stream(
57+
message="Tell me a short story"
58+
)
59+
60+
for event in stream:
61+
if event.event_type == "text-generation":
62+
print(event.text, end='')
4063
```
41-
<!-- End Async Usage -->
4264

43-
<!-- Begin Status, generated by Fern -->
44-
# Beta Status
65+
## Alpha status
4566

46-
This SDK is in beta, and there may be breaking changes between versions without a major
47-
version update. Therefore, we recommend pinning the package version to a specific version.
48-
This way, you can install the same version each time without breaking changes.
49-
<!-- End Status -->
67+
This SDK is in alpha, and while we will try to avoid it, there may be breaking changes between versions without a major version update. Therefore, we recommend pinning the package version to a specific version in your package.json file. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
5068

51-
<!-- Begin Contributing, generated by Fern -->
52-
# Contributing
69+
## Contributing
5370

54-
While we value open-source contributions to this SDK, this library is generated programmatically.
55-
Additions made directly to this library would have to be moved over to our generation code,
56-
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
57-
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
58-
an issue first to discuss with us!
71+
While we value open-source contributions to this SDK, the code is generated programmatically. Additions made directly would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!
5972

6073
On the other hand, contributions to the README are always very welcome!
61-
<!-- End Contributing -->
62-

banner.png

1.47 MB
Loading

0 commit comments

Comments
 (0)