Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
6c8997fc
Commit
6c8997fc
authored
May 25, 2024
by
Timothy J. Baek
Browse files
fix
parent
9ad4a938
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
src/lib/apis/models/index.ts
src/lib/apis/models/index.ts
+10
-10
No files found.
src/lib/apis/models/index.ts
View file @
6c8997fc
...
...
@@ -32,7 +32,7 @@ export const addNewModel = async (token: string, model: object) => {
export
const
getModelInfos
=
async
(
token
:
string
=
''
)
=>
{
let
error
=
null
;
const
res
=
await
fetch
(
`
${
WEBUI_API_BASE_URL
}
/models
/
`
,
{
const
res
=
await
fetch
(
`
${
WEBUI_API_BASE_URL
}
/models`
,
{
method
:
'
GET
'
,
headers
:
{
Accept
:
'
application/json
'
,
...
...
@@ -63,10 +63,10 @@ export const getModelInfos = async (token: string = '') => {
export
const
getModelById
=
async
(
token
:
string
,
id
:
string
)
=>
{
let
error
=
null
;
const
url
=
new
URL
(
`
${
WEBUI_API_BASE_URL
}
/models`
);
url
.
searchParams
.
append
(
'
id
'
,
id
);
const
searchParams
=
new
URLSearchParams
(
);
searchParams
.
append
(
'
id
'
,
id
);
const
res
=
await
fetch
(
url
.
toString
(),
{
const
res
=
await
fetch
(
`
${
WEBUI_API_BASE_URL
}
/models?
${
searchParams
.
toString
()
}
`
,
{
method
:
'
GET
'
,
headers
:
{
Accept
:
'
application/json
'
,
...
...
@@ -98,10 +98,10 @@ export const getModelById = async (token: string, id: string) => {
export
const
updateModelById
=
async
(
token
:
string
,
id
:
string
,
model
:
object
)
=>
{
let
error
=
null
;
const
url
=
new
URL
(
`
${
WEBUI_API_BASE_URL
}
/models/update`
);
url
.
searchParams
.
append
(
'
id
'
,
id
);
const
searchParams
=
new
URLSearchParams
(
);
searchParams
.
append
(
'
id
'
,
id
);
const
res
=
await
fetch
(
url
.
toString
(),
{
const
res
=
await
fetch
(
`
${
WEBUI_API_BASE_URL
}
/models/update?
${
searchParams
.
toString
()
}
`
,
{
method
:
'
POST
'
,
headers
:
{
Accept
:
'
application/json
'
,
...
...
@@ -134,10 +134,10 @@ export const updateModelById = async (token: string, id: string, model: object)
export
const
deleteModelById
=
async
(
token
:
string
,
id
:
string
)
=>
{
let
error
=
null
;
const
url
=
new
URL
(
`
${
WEBUI_API_BASE_URL
}
/models/delete`
);
url
.
searchParams
.
append
(
'
id
'
,
id
);
const
searchParams
=
new
URLSearchParams
(
);
searchParams
.
append
(
'
id
'
,
id
);
const
res
=
await
fetch
(
url
.
toString
(),
{
const
res
=
await
fetch
(
`
${
WEBUI_API_BASE_URL
}
/models/delete?
${
searchParams
.
toString
()
}
`
,
{
method
:
'
DELETE
'
,
headers
:
{
Accept
:
'
application/json
'
,
...
...
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