chore: completion api change
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
const proxyTableList = ['cli', 'v1', 'auth'];
|
||||
const proxyTableList = ['cli', 'v1', 'auth', 'v1-openai'];
|
||||
|
||||
// @ts-ingore
|
||||
export default function createProxyTable(target?: string) {
|
||||
|
||||
Generated
+28
-4
@@ -4249,7 +4249,7 @@ packages:
|
||||
dependencies:
|
||||
'@babel/core': 7.24.5
|
||||
postcss: 7.0.39
|
||||
postcss-syntax: 0.36.2(postcss@8.4.38)
|
||||
postcss-syntax: 0.36.2(postcss@7.0.39)
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: false
|
||||
@@ -4276,7 +4276,7 @@ packages:
|
||||
postcss-syntax: '>=0.36.2'
|
||||
dependencies:
|
||||
postcss: 7.0.39
|
||||
postcss-syntax: 0.36.2(postcss@8.4.38)
|
||||
postcss-syntax: 0.36.2(postcss@7.0.39)
|
||||
remark: 13.0.0
|
||||
unist-util-find-all-after: 3.0.2
|
||||
transitivePeerDependencies:
|
||||
@@ -12393,7 +12393,7 @@ packages:
|
||||
dependencies:
|
||||
htmlparser2: 3.10.1
|
||||
postcss: 7.0.39
|
||||
postcss-syntax: 0.36.2(postcss@8.4.38)
|
||||
postcss-syntax: 0.36.2(postcss@7.0.39)
|
||||
dev: false
|
||||
|
||||
/postcss-image-set-function@4.0.7(postcss@8.4.38):
|
||||
@@ -12683,6 +12683,30 @@ packages:
|
||||
lodash: 4.17.21
|
||||
postcss: 8.4.38
|
||||
|
||||
/postcss-syntax@0.36.2(postcss@7.0.39):
|
||||
resolution: {integrity: sha512-nBRg/i7E3SOHWxF3PpF5WnJM/jQ1YpY9000OaVXlAQj6Zp/kIqJxEDWIZ67tAd7NLuk7zqN4yqe9nc0oNAOs1w==}
|
||||
peerDependencies:
|
||||
postcss: '>=5.0.0'
|
||||
postcss-html: '*'
|
||||
postcss-jsx: '*'
|
||||
postcss-less: '*'
|
||||
postcss-markdown: '*'
|
||||
postcss-scss: '*'
|
||||
peerDependenciesMeta:
|
||||
postcss-html:
|
||||
optional: true
|
||||
postcss-jsx:
|
||||
optional: true
|
||||
postcss-less:
|
||||
optional: true
|
||||
postcss-markdown:
|
||||
optional: true
|
||||
postcss-scss:
|
||||
optional: true
|
||||
dependencies:
|
||||
postcss: 7.0.39
|
||||
dev: false
|
||||
|
||||
/postcss-syntax@0.36.2(postcss@8.4.38):
|
||||
resolution: {integrity: sha512-nBRg/i7E3SOHWxF3PpF5WnJM/jQ1YpY9000OaVXlAQj6Zp/kIqJxEDWIZ67tAd7NLuk7zqN4yqe9nc0oNAOs1w==}
|
||||
peerDependencies:
|
||||
@@ -15759,7 +15783,7 @@ packages:
|
||||
postcss-sass: 0.4.4
|
||||
postcss-scss: 2.1.1
|
||||
postcss-selector-parser: 6.0.16
|
||||
postcss-syntax: 0.36.2(postcss@8.4.38)
|
||||
postcss-syntax: 0.36.2(postcss@7.0.39)
|
||||
postcss-value-parser: 4.2.0
|
||||
resolve-from: 5.0.0
|
||||
slash: 3.0.0
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
export default {
|
||||
Create: ['ctrl+n', 'cmd+n'],
|
||||
Save: ['ctrl+s', 'cmd+s'],
|
||||
SaveAs: ['ctrl+shift+s', 'cmd+shift+s'],
|
||||
Open: ['ctrl+o', 'cmd+o'],
|
||||
Cancel: ['ctrl+w', 'cmd+w'],
|
||||
Delete: ['delete'],
|
||||
Copy: ['ctrl+c', 'cmd+c'],
|
||||
Refresh: ['ctrl+r', 'cmd+r'],
|
||||
Edit: ['ctrl+e', 'cmd+e'],
|
||||
Search: ['ctrl+f', 'cmd+f'],
|
||||
Reset: ['ctrl+shift+r', 'cmd+shift+r']
|
||||
};
|
||||
@@ -1,6 +1,8 @@
|
||||
import { request } from '@umijs/max';
|
||||
|
||||
export const CHAT_API = '/chat/completions';
|
||||
export const CHAT_API = '/v1-openai/chat/completions';
|
||||
|
||||
export const OPENAI_MODELS = '/v1-openai/models';
|
||||
|
||||
export async function execChatCompletions(params: any) {
|
||||
return request(`${CHAT_API}`, {
|
||||
@@ -9,8 +11,12 @@ export async function execChatCompletions(params: any) {
|
||||
});
|
||||
}
|
||||
|
||||
export const queryModelsList = async () => {
|
||||
return request(`${OPENAI_MODELS}`);
|
||||
};
|
||||
|
||||
export const fetchChatStream = async (params: any) => {
|
||||
const response = await fetch(`/v1${CHAT_API}`, {
|
||||
const response = await fetch(`${CHAT_API}`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(params),
|
||||
headers: {
|
||||
|
||||
@@ -2,11 +2,11 @@ import FieldWrapper from '@/components/seal-form/field-wrapper';
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import SealSelect from '@/components/seal-form/seal-select';
|
||||
import { INPUT_WIDTH } from '@/constants';
|
||||
import { queryModelsList } from '@/pages/llmodels/apis';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button, Form, InputNumber, Slider } from 'antd';
|
||||
import _ from 'lodash';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { queryModelsList } from '../apis';
|
||||
import CustomLabelStyles from '../style/custom-label.less';
|
||||
|
||||
type ParamsSettingsFormProps = {
|
||||
@@ -44,15 +44,11 @@ const ParamsSettings: React.FC<ParamsSettingsProps> = ({
|
||||
useEffect(() => {
|
||||
const getModelList = async () => {
|
||||
try {
|
||||
const params = {
|
||||
page: 1,
|
||||
perPage: 100
|
||||
};
|
||||
const res = await queryModelsList(params);
|
||||
const list = _.map(res.items || [], (item: any) => {
|
||||
const res = await queryModelsList();
|
||||
const list = _.map(res.data || [], (item: any) => {
|
||||
return {
|
||||
value: item.name,
|
||||
label: item.name
|
||||
value: item.id,
|
||||
label: item.id
|
||||
};
|
||||
});
|
||||
setModelList(list);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { RequestConfig } from '@umijs/max';
|
||||
import { message } from 'antd';
|
||||
|
||||
const NoBaseURLAPIs = ['/auth'];
|
||||
const NoBaseURLAPIs = ['/auth', '/v1-openai'];
|
||||
|
||||
export const requestConfig: RequestConfig = {
|
||||
errorConfig: {
|
||||
|
||||
Reference in New Issue
Block a user