Skip to content

Commit

Permalink
Some minor updates (#8)
Browse files Browse the repository at this point in the history
* Update README

* Rename function
  • Loading branch information
KenyonY authored Apr 25, 2023
1 parent 72d0efc commit a621097
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Test access: https://caloi.top/v1/chat/completions is equivalent to https://api.
- [Usage](#Usage)
- [Service Deployment](#Service-Deployment)
- [Service Usage](#Service-Usage)
- [Configuration](#Configuration)

# Features
- [x] Supports forwarding of all OpenAI interfaces
Expand Down Expand Up @@ -140,7 +141,7 @@ Replace with
http://{ip}:{port}/v1/chat/completions
```

# Configuration Options
# Configuration

**`openai-forward run` Parameter Configuration Options**

Expand Down
1 change: 1 addition & 0 deletions README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ api的服务器上,通过该服务转发OpenAI的请求。即搭建反向代
- [Usage](#Usage)
- [安装部署](#安装部署)
- [服务调用](#服务调用)
- [配置选项](#配置选项)

# Features

Expand Down
4 changes: 2 additions & 2 deletions openai_forward/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import httpx
from starlette.background import BackgroundTask
import os
from .content.chat import log_chat_completions, ChatSaver
from .content.chat import parse_chat_completions, ChatSaver


class OpenaiBase:
Expand Down Expand Up @@ -37,7 +37,7 @@ def validate_request_host(self, ip):

@classmethod
def log_chat_completions(cls, bytes_: bytes):
target_info = log_chat_completions(bytes_)
target_info = parse_chat_completions(bytes_)
cls.chatsaver.add_chat({target_info['role']: target_info['content']})

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion openai_forward/content/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def _parse_iter_line_content(line: str):
return ""


def log_chat_completions(bytes_: bytes):
def parse_chat_completions(bytes_: bytes):
txt_lines = decoder.decode(bytes_.decode('utf-8'))
line0 = txt_lines[0]
target_info = dict()
Expand Down

0 comments on commit a621097

Please sign in to comment.