https://github.com/mirusu400/clova-x
Unofficial API for CLOVA X
https://github.com/mirusu400/clova-x
api clova clovaai hacktoberfest llm naver naver-api nlp
Last synced: about 1 month ago
JSON representation
Unofficial API for CLOVA X
- Host: GitHub
- URL: https://github.com/mirusu400/clova-x
- Owner: mirusu400
- License: mit
- Created: 2023-08-24T07:15:55.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-27T17:16:50.000Z (over 1 year ago)
- Last Synced: 2024-04-30T00:47:03.771Z (about 1 year ago)
- Topics: api, clova, clovaai, hacktoberfest, llm, naver, naver-api, nlp
- Language: Python
- Homepage:
- Size: 29.3 KB
- Stars: 35
- Watchers: 2
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Naver Clova X Unofficial API

Unofficial API for Naver Clova X, a Korean AI LLM (Language Model) service.
## Install
```
pip install clovax
```## How can I get cookie file?
1. Install [Get cookies.txt LOCALLY](https://chrome.google.com/webstore/detail/get-cookiestxt-locally/cclelndahbckbenkjhflpdbgdldlbecc)
2. Export cookie
3. Set cookie file path to `get_cookie` function## Usage
**Start a conversation**
```python
from clovax import ClovaXc = ClovaX()
c.get_cookie("[Your netscape cookie file]")
log = c.start("Hello world!")
print(log["text"])
```**Continue a conversation**
```python
from clovax import ClovaXc = ClovaX()
c.get_cookie("[Your netscape cookie file]")
log = c.start("Hello world!")
print(log["text"])
# At this time, you can continue the conversation using existed session (conversation ID)
log = c.conversation("Who are you?")
print(log["text"])
```**Regenerate a conversation**
```python
from clovax import ClovaXc = ClovaX()
c.get_cookie("[Your netscape cookie file]")
log = c.start("Hello world!")
log = c.regenerate()
print(log["text"])
```**Conversation with a skillset**
```python
from clovax import ClovaX
import jsonc = ClovaX()
c.get_cookie("clova-x.naver.com_cookies.txt")
log = c.start("가을에 입을만한 바지 추천해 줘", skillsets=["shopping", "travel"])
with open("./test.html", "w", encoding="utf-8") as f:
f.write(log["contents"][1]["content"])
print(log["text"])
```## TODO
* [ ] Login using given naver ID and password
* [ ] Get existed conversation using conversation ID
* [ ] Proxy support
* [ ] Support personas