clovax


Nameclovax JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/mirusu400/CLOVA-X-API
SummaryUnofficial CLOVA X API
upload_time2023-12-27 17:15:19
maintainer
docs_urlNone
authormirusu400
requires_python>=3.7
license
keywords clovax naver clova clova x clova x api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Naver Clova X Unofficial API


![clova-logo](https://raw.githubusercontent.com/mirusu400/CLOVA-X/main/doc/clova-logo.png)

<a href="https://pypi.org/project/clovax/"><img alt="PyPI package" src="https://img.shields.io/badge/pypi-clovax-green"></a>
<a href="https://github.com/mirusu400/CLOVA-X/stargazers"><img src="https://img.shields.io/github/stars/mirusu400/CLOVA-X?style=social"></a>
<a href="https://pypi.org/project/clovax/"><img alt="PyPI" src="https://img.shields.io/pypi/v/clovax"></a>

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 ClovaX

c = ClovaX()
c.get_cookie("[Your netscape cookie file]")
log = c.start("Hello world!")
print(log["text"])
```

**Continue a conversation**
```python
from clovax import ClovaX

c = 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 ClovaX

c = 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 json

c = 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


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mirusu400/CLOVA-X-API",
    "name": "clovax",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "ClovaX,Naver,CLOVA,CLOVA X,CLOVA X API",
    "author": "mirusu400",
    "author_email": "mirusu400@naver.com",
    "download_url": "https://files.pythonhosted.org/packages/c7/29/da33a62f4559f5bc9f72ce7a979dca9ff1ea404e10230690a745edb852fb/clovax-0.1.1.tar.gz",
    "platform": null,
    "description": "# Naver Clova X Unofficial API\r\n\r\n\r\n![clova-logo](https://raw.githubusercontent.com/mirusu400/CLOVA-X/main/doc/clova-logo.png)\r\n\r\n<a href=\"https://pypi.org/project/clovax/\"><img alt=\"PyPI package\" src=\"https://img.shields.io/badge/pypi-clovax-green\"></a>\r\n<a href=\"https://github.com/mirusu400/CLOVA-X/stargazers\"><img src=\"https://img.shields.io/github/stars/mirusu400/CLOVA-X?style=social\"></a>\r\n<a href=\"https://pypi.org/project/clovax/\"><img alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/clovax\"></a>\r\n\r\nUnofficial API for Naver Clova X, a Korean AI LLM (Language Model) service.\r\n\r\n## Install\r\n\r\n```\r\npip install clovax\r\n```\r\n\r\n## How can I get cookie file?\r\n\r\n1. Install [Get cookies.txt LOCALLY](https://chrome.google.com/webstore/detail/get-cookiestxt-locally/cclelndahbckbenkjhflpdbgdldlbecc)\r\n2. Export cookie\r\n3. Set cookie file path to `get_cookie` function\r\n\r\n## Usage\r\n**Start a conversation**\r\n```python\r\nfrom clovax import ClovaX\r\n\r\nc = ClovaX()\r\nc.get_cookie(\"[Your netscape cookie file]\")\r\nlog = c.start(\"Hello world!\")\r\nprint(log[\"text\"])\r\n```\r\n\r\n**Continue a conversation**\r\n```python\r\nfrom clovax import ClovaX\r\n\r\nc = ClovaX()\r\nc.get_cookie(\"[Your netscape cookie file]\")\r\nlog = c.start(\"Hello world!\")\r\nprint(log[\"text\"])\r\n# At this time, you can continue the conversation using existed session (conversation ID)\r\nlog = c.conversation(\"Who are you?\")\r\nprint(log[\"text\"])\r\n```\r\n\r\n**Regenerate a conversation**\r\n```python\r\nfrom clovax import ClovaX\r\n\r\nc = ClovaX()\r\nc.get_cookie(\"[Your netscape cookie file]\")\r\nlog = c.start(\"Hello world!\")\r\nlog = c.regenerate()\r\nprint(log[\"text\"])\r\n```\r\n\r\n**Conversation with a skillset**\r\n```python\r\nfrom clovax import ClovaX\r\nimport json\r\n\r\nc = ClovaX()\r\nc.get_cookie(\"clova-x.naver.com_cookies.txt\")\r\nlog = c.start(\"\uac00\uc744\uc5d0 \uc785\uc744\ub9cc\ud55c \ubc14\uc9c0 \ucd94\ucc9c\ud574 \uc918\", skillsets=[\"shopping\", \"travel\"])\r\nwith open(\"./test.html\", \"w\", encoding=\"utf-8\") as f:\r\n    f.write(log[\"contents\"][1][\"content\"])\r\nprint(log[\"text\"])\r\n```\r\n\r\n\r\n\r\n\r\n## TODO\r\n\r\n* [ ] Login using given naver ID and password\r\n* [ ] Get existed conversation using conversation ID\r\n* [ ] Proxy support\r\n* [ ] Support personas\r\n\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Unofficial CLOVA X API",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/mirusu400/CLOVA-X-API"
    },
    "split_keywords": [
        "clovax",
        "naver",
        "clova",
        "clova x",
        "clova x api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c729da33a62f4559f5bc9f72ce7a979dca9ff1ea404e10230690a745edb852fb",
                "md5": "852d4c2c8537f75f6cd0cb8d54309726",
                "sha256": "23245a0874528fbeacf488b248851277fef1e1f6d26b9b65b344a659de3d45fe"
            },
            "downloads": -1,
            "filename": "clovax-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "852d4c2c8537f75f6cd0cb8d54309726",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 17376,
            "upload_time": "2023-12-27T17:15:19",
            "upload_time_iso_8601": "2023-12-27T17:15:19.763102Z",
            "url": "https://files.pythonhosted.org/packages/c7/29/da33a62f4559f5bc9f72ce7a979dca9ff1ea404e10230690a745edb852fb/clovax-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-27 17:15:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mirusu400",
    "github_project": "CLOVA-X-API",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "clovax"
}
        
Elapsed time: 2.05933s