Metadata-Version: 2.1
Name: openai-kira
Version: 0.0.3
Summary: A chat client
Home-page: https://github.com/sudoskys/openai-kira
License: GPL-2.0-or-later
Author: sudoskys
Author-email: coldlando@hotmail.com
Maintainer: sudoskys
Maintainer-email: coldlando@hotmail.com
Requires-Python: >=3.7,<4.0
Classifier: License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: beautifulsoup4 (>=4.11.1,<5.0.0)
Requires-Dist: elara (>=0.5.4,<0.6.0)
Requires-Dist: httpx (>=0.23.1,<0.24.0)
Requires-Dist: jieba (>=0.42.1,<0.43.0)
Requires-Dist: loguru (>=0.6.0,<0.7.0)
Requires-Dist: nltk (>=3.8,<4.0)
Requires-Dist: openai-async (>=0.0.2,<0.0.3)
Requires-Dist: pillow (>=9.3.0,<10.0.0)
Requires-Dist: pydantic (>=1.10.4,<2.0.0)
Requires-Dist: redis (>=4.4.0,<5.0.0)
Requires-Dist: transformers (>=4.25.1,<5.0.0)
Project-URL: Repository, https://github.com/sudoskys/openai-kira
Description-Content-Type: text/markdown

# openai-kira

Openai GPT3 ChatBot 框架包，在未公开前快速实现类 ChatGPT接入（公开后就接入chatGPT），打包成依赖的玩具。提供 redis 和 文件数据库
两个选择，非常好工作。

## 使用

**init**

```python
redis = RedisConfig()
filedb = "openai_msg.db"
api_key = None
proxy_url = ""
webServerUrlFilter = False
webServerStopSentence = ["小编", "一起来看一下"]
```

## 实例

```python
from openai_kira import Chat
receiver = Chat.Chatbot(
    conversation_id=10086,
    call_func=None,  # Api_keys.pop_api_key,
    start_sequ=None,
    restart_sequ=None,
)
response = await receiver.get_chat_response(model="text-davinci-003",
                                            prompt="你好",
                                            max_tokens=500,
                                            role="你扮演...",
                                            web_enhance_server={"time": ""}
                                            )
```
```python
import openai_kira

response = await openai_kira.Completion(call_func=None).create(
    model="text-davinci-003",
    prompt=str("你好"),
    temperature=0.2,
    frequency_penalty=1,
    max_tokens=500
)
```
## 结构

```markdown
.
└── openai_kira
├── api
│ ├── api_url.json
│ ├── api_utils.py
│ ├── network.py
├── Chat
│ ├── __init__.py
│ ├── module
│ ├── Summer.py
│ ├── test_module.py
│ ├── text_analysis_tools
│ └── vocab.json
├── __init__.py
├── requirements.txt
├── resouce
│ ├── completion.py
│ ├── __init__.py
└── utils
├── data.py
├── Network.py
└── Talk.py
```
