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
|
// @ts-ingore
|
||||||
export default function createProxyTable(target?: string) {
|
export default function createProxyTable(target?: string) {
|
||||||
|
|||||||
Generated
+28
-4
@@ -4249,7 +4249,7 @@ packages:
|
|||||||
dependencies:
|
dependencies:
|
||||||
'@babel/core': 7.24.5
|
'@babel/core': 7.24.5
|
||||||
postcss: 7.0.39
|
postcss: 7.0.39
|
||||||
postcss-syntax: 0.36.2(postcss@8.4.38)
|
postcss-syntax: 0.36.2(postcss@7.0.39)
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
dev: false
|
dev: false
|
||||||
@@ -4276,7 +4276,7 @@ packages:
|
|||||||
postcss-syntax: '>=0.36.2'
|
postcss-syntax: '>=0.36.2'
|
||||||
dependencies:
|
dependencies:
|
||||||
postcss: 7.0.39
|
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
|
remark: 13.0.0
|
||||||
unist-util-find-all-after: 3.0.2
|
unist-util-find-all-after: 3.0.2
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
@@ -12393,7 +12393,7 @@ packages:
|
|||||||
dependencies:
|
dependencies:
|
||||||
htmlparser2: 3.10.1
|
htmlparser2: 3.10.1
|
||||||
postcss: 7.0.39
|
postcss: 7.0.39
|
||||||
postcss-syntax: 0.36.2(postcss@8.4.38)
|
postcss-syntax: 0.36.2(postcss@7.0.39)
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/postcss-image-set-function@4.0.7(postcss@8.4.38):
|
/postcss-image-set-function@4.0.7(postcss@8.4.38):
|
||||||
@@ -12683,6 +12683,30 @@ packages:
|
|||||||
lodash: 4.17.21
|
lodash: 4.17.21
|
||||||
postcss: 8.4.38
|
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):
|
/postcss-syntax@0.36.2(postcss@8.4.38):
|
||||||
resolution: {integrity: sha512-nBRg/i7E3SOHWxF3PpF5WnJM/jQ1YpY9000OaVXlAQj6Zp/kIqJxEDWIZ67tAd7NLuk7zqN4yqe9nc0oNAOs1w==}
|
resolution: {integrity: sha512-nBRg/i7E3SOHWxF3PpF5WnJM/jQ1YpY9000OaVXlAQj6Zp/kIqJxEDWIZ67tAd7NLuk7zqN4yqe9nc0oNAOs1w==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
@@ -15759,7 +15783,7 @@ packages:
|
|||||||
postcss-sass: 0.4.4
|
postcss-sass: 0.4.4
|
||||||
postcss-scss: 2.1.1
|
postcss-scss: 2.1.1
|
||||||
postcss-selector-parser: 6.0.16
|
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
|
postcss-value-parser: 4.2.0
|
||||||
resolve-from: 5.0.0
|
resolve-from: 5.0.0
|
||||||
slash: 3.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';
|
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) {
|
export async function execChatCompletions(params: any) {
|
||||||
return request(`${CHAT_API}`, {
|
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) => {
|
export const fetchChatStream = async (params: any) => {
|
||||||
const response = await fetch(`/v1${CHAT_API}`, {
|
const response = await fetch(`${CHAT_API}`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(params),
|
body: JSON.stringify(params),
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ import FieldWrapper from '@/components/seal-form/field-wrapper';
|
|||||||
import SealInput from '@/components/seal-form/seal-input';
|
import SealInput from '@/components/seal-form/seal-input';
|
||||||
import SealSelect from '@/components/seal-form/seal-select';
|
import SealSelect from '@/components/seal-form/seal-select';
|
||||||
import { INPUT_WIDTH } from '@/constants';
|
import { INPUT_WIDTH } from '@/constants';
|
||||||
import { queryModelsList } from '@/pages/llmodels/apis';
|
|
||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
import { Button, Form, InputNumber, Slider } from 'antd';
|
import { Button, Form, InputNumber, Slider } from 'antd';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
import { queryModelsList } from '../apis';
|
||||||
import CustomLabelStyles from '../style/custom-label.less';
|
import CustomLabelStyles from '../style/custom-label.less';
|
||||||
|
|
||||||
type ParamsSettingsFormProps = {
|
type ParamsSettingsFormProps = {
|
||||||
@@ -44,15 +44,11 @@ const ParamsSettings: React.FC<ParamsSettingsProps> = ({
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const getModelList = async () => {
|
const getModelList = async () => {
|
||||||
try {
|
try {
|
||||||
const params = {
|
const res = await queryModelsList();
|
||||||
page: 1,
|
const list = _.map(res.data || [], (item: any) => {
|
||||||
perPage: 100
|
|
||||||
};
|
|
||||||
const res = await queryModelsList(params);
|
|
||||||
const list = _.map(res.items || [], (item: any) => {
|
|
||||||
return {
|
return {
|
||||||
value: item.name,
|
value: item.id,
|
||||||
label: item.name
|
label: item.id
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
setModelList(list);
|
setModelList(list);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { RequestConfig } from '@umijs/max';
|
import { RequestConfig } from '@umijs/max';
|
||||||
import { message } from 'antd';
|
import { message } from 'antd';
|
||||||
|
|
||||||
const NoBaseURLAPIs = ['/auth'];
|
const NoBaseURLAPIs = ['/auth', '/v1-openai'];
|
||||||
|
|
||||||
export const requestConfig: RequestConfig = {
|
export const requestConfig: RequestConfig = {
|
||||||
errorConfig: {
|
errorConfig: {
|
||||||
|
|||||||
Reference in New Issue
Block a user