Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ac11307f
authored
Jun 09, 2023
by
JustSong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: enable model configuration on default group (close #143)
parent
70370e40
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
3 deletions
+19
-3
README.md
+2
-0
bin/migration_v0.3-v0.4.sql
+17
-0
model/ability.go
+0
-3
No files found.
README.md
View file @
ac11307f
...
...
@@ -46,6 +46,8 @@ _✨ All in one 的 OpenAI 接口,整合各种 API 访问方式,开箱即用
> **Warning**:使用 Docker 拉取的最新镜像可能是 `alpha` 版本,如果追求稳定性请手动指定版本。
> **Warning**:从 `v0.3` 版本升级到 `v0.4` 版本需要手动迁移数据库,请手动执行[数据库迁移脚本](./bin/migration_v0.3-v0.4.sql)。
## 功能
1.
支持多种 API 访问渠道,欢迎 PR 或提 issue 添加更多渠道:
+
[
x
]
OpenAI 官方通道
...
...
bin/migration_v0.3-v0.4.sql
0 → 100644
View file @
ac11307f
INSERT
INTO
abilities
(
`group`
,
model
,
channel_id
,
enabled
)
SELECT
c
.
`group`
,
m
.
model
,
c
.
id
,
1
FROM
channels
c
CROSS
JOIN
(
SELECT
'gpt-3.5-turbo'
AS
model
UNION
ALL
SELECT
'gpt-3.5-turbo-0301'
AS
model
UNION
ALL
SELECT
'gpt-4'
AS
model
UNION
ALL
SELECT
'gpt-4-0314'
AS
model
)
AS
m
WHERE
c
.
status
=
1
AND
NOT
EXISTS
(
SELECT
1
FROM
abilities
a
WHERE
a
.
`group`
=
c
.
`group`
AND
a
.
model
=
m
.
model
AND
a
.
channel_id
=
c
.
id
);
model/ability.go
View file @
ac11307f
...
...
@@ -13,9 +13,6 @@ type Ability struct {
}
func
GetRandomSatisfiedChannel
(
group
string
,
model
string
)
(
*
Channel
,
error
)
{
if
group
==
"default"
{
return
GetRandomChannel
()
}
ability
:=
Ability
{}
var
err
error
=
nil
if
common
.
UsingSQLite
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment