Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
RexWzh committed Mar 25, 2023
1 parent ff9e531 commit ed1542d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ export OPENAI_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
### Set Proxy (Optional)

```py
from openai_api_call import proxy_on, proxy_off, show_proxy
from openai_api_call import proxy_on, proxy_off, proxy_status
# Check the current proxy
show_proxy()
proxy_status()

# Set local proxy, port number is 7890 by default
proxy_on("127.0.0.1", port=7890)

# Check the updated proxy
show_proxy()
proxy_status()

# Turn off proxy
proxy_off()
Expand All @@ -57,13 +57,13 @@ proxy_off()
Example 1, send prompt and return information:

```python
from openai_api_call import prompt2response, show_apikey
from openai_api_call import Chat, show_apikey

# Check if API key is set
show_apikey()

# Check if proxy is enabled
show_proxy()
proxy_status()

# Send prompt and return response
chat = Chat("Hello, GPT-3.5!")
Expand Down
10 changes: 5 additions & 5 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ export OPENAI_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
### 设置代理(可选)

```py
from openai_api_call import proxy_on, proxy_off, show_proxy
from openai_api_call import proxy_on, proxy_off, proxy_status
# 查看当前代理
show_proxy()
proxy_status()

# 设置本地代理,端口号默认为 7890
proxy_on("127.0.0.1", port=7890)

# 查看更新后的代理
show_proxy()
proxy_status()

# 关闭代理
proxy_off()
Expand All @@ -54,13 +54,13 @@ proxy_off()

示例一,发送 prompt 并返回信息:
```python
from openai_api_call import Chat, show_apikey, show_proxy
from openai_api_call import Chat, show_apikey, proxy_status

# 检查 API 密钥是否设置
show_apikey()

# 查看是否开启代理
show_proxy()
proxy_status()

# 发送 prompt 并返回 response
chat = Chat("Hello, GPT-3.5!")
Expand Down
2 changes: 1 addition & 1 deletion openai_api_call/chattool.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def getresponse( self
assert openai.api_key is not None, "API key is not set!"

# initialize prompt message
msg = self.chat_log()
msg = self.chat_log

# default options
if not len(options):
Expand Down

0 comments on commit ed1542d

Please sign in to comment.