@lobehub/chat 1.45.6 → 1.45.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/changelog/v1.json +9 -0
- package/locales/ar/modelProvider.json +1 -1
- package/locales/bg-BG/modelProvider.json +1 -1
- package/locales/de-DE/modelProvider.json +1 -1
- package/locales/en-US/modelProvider.json +1 -1
- package/locales/es-ES/modelProvider.json +1 -1
- package/locales/fa-IR/modelProvider.json +1 -1
- package/locales/fr-FR/modelProvider.json +1 -1
- package/locales/it-IT/modelProvider.json +1 -1
- package/locales/ja-JP/modelProvider.json +1 -1
- package/locales/ko-KR/modelProvider.json +1 -1
- package/locales/nl-NL/modelProvider.json +1 -1
- package/locales/pl-PL/modelProvider.json +1 -1
- package/locales/pt-BR/modelProvider.json +1 -1
- package/locales/ru-RU/modelProvider.json +1 -1
- package/locales/tr-TR/modelProvider.json +1 -1
- package/locales/vi-VN/modelProvider.json +1 -1
- package/locales/zh-CN/modelProvider.json +1 -1
- package/locales/zh-TW/modelProvider.json +1 -1
- package/package.json +1 -1
- package/src/app/(main)/chat/(workspace)/features/TelemetryNotification.tsx +1 -1
- package/src/app/(main)/settings/provider/features/CreateNewProvider/index.tsx +1 -1
- package/src/features/InitClientDB/PGliteIcon.tsx +1 -1
- package/src/libs/agent-runtime/openai/__snapshots__/index.test.ts.snap +6 -0
- package/src/libs/agent-runtime/utils/openaiCompatibleFactory/index.test.ts +94 -23
- package/src/libs/agent-runtime/utils/openaiCompatibleFactory/index.ts +20 -6
- package/src/locales/default/modelProvider.ts +1 -1
- package/src/utils/fetch/__tests__/fetchSSE.test.ts +1 -1
- package/tests/setup-db.ts +0 -3
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,31 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.45.7](https://github.com/lobehub/lobe-chat/compare/v1.45.6...v1.45.7)
|
6
|
+
|
7
|
+
<sup>Released on **2025-01-13**</sup>
|
8
|
+
|
9
|
+
#### 🐛 Bug Fixes
|
10
|
+
|
11
|
+
- **misc**: Fix released at for undefined condition.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### What's fixed
|
19
|
+
|
20
|
+
- **misc**: Fix released at for undefined condition, closes [#5391](https://github.com/lobehub/lobe-chat/issues/5391) ([9c5822a](https://github.com/lobehub/lobe-chat/commit/9c5822a))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
5
30
|
### [Version 1.45.6](https://github.com/lobehub/lobe-chat/compare/v1.45.5...v1.45.6)
|
6
31
|
|
7
32
|
<sup>Released on **2025-01-10**</sup>
|
package/changelog/v1.json
CHANGED
@@ -79,7 +79,7 @@
|
|
79
79
|
},
|
80
80
|
"id": {
|
81
81
|
"desc": "معرف فريد لمزود الخدمة، لا يمكن تعديله بعد الإنشاء",
|
82
|
-
"format": "يمكن أن يحتوي فقط على أحرف صغيرة،
|
82
|
+
"format": "يمكن أن يحتوي فقط على أرقام، أحرف صغيرة، شرطات (-) وشرطات سفلية (_) ",
|
83
83
|
"placeholder": "يفضل أن يكون بالكامل بحروف صغيرة، مثل openai، لن يمكن تعديله بعد الإنشاء",
|
84
84
|
"required": "يرجى إدخال معرف المزود",
|
85
85
|
"title": "معرف المزود"
|
@@ -79,7 +79,7 @@
|
|
79
79
|
},
|
80
80
|
"id": {
|
81
81
|
"desc": "Уникален идентификатор за доставчика на услуги, който не може да бъде променян след създаването му",
|
82
|
-
"format": "Може да съдържа само малки букви, тирета (-) и долни черти (_)",
|
82
|
+
"format": "Може да съдържа само цифри, малки букви, тирета (-) и долни черти (_) ",
|
83
83
|
"placeholder": "Препоръчително изцяло с малки букви, например openai, след създаването не може да се промени",
|
84
84
|
"required": "Моля, въведете ID на доставчика",
|
85
85
|
"title": "ID на доставчика"
|
@@ -79,7 +79,7 @@
|
|
79
79
|
},
|
80
80
|
"id": {
|
81
81
|
"desc": "Eindeutige Kennung des Anbieters, die nach der Erstellung nicht mehr geändert werden kann",
|
82
|
-
"format": "Darf nur aus Kleinbuchstaben, Bindestrichen (-) und Unterstrichen (_) bestehen",
|
82
|
+
"format": "Darf nur aus Zahlen, Kleinbuchstaben, Bindestrichen (-) und Unterstrichen (_) bestehen",
|
83
83
|
"placeholder": "Empfohlen in Kleinbuchstaben, z.B. openai, nach der Erstellung nicht mehr änderbar",
|
84
84
|
"required": "Bitte geben Sie die Anbieter-ID ein",
|
85
85
|
"title": "Anbieter-ID"
|
@@ -79,7 +79,7 @@
|
|
79
79
|
},
|
80
80
|
"id": {
|
81
81
|
"desc": "Unique identifier for the service provider, which cannot be modified after creation",
|
82
|
-
"format": "Can only contain lowercase letters, hyphens (-), and underscores (_) ",
|
82
|
+
"format": "Can only contain numbers, lowercase letters, hyphens (-), and underscores (_) ",
|
83
83
|
"placeholder": "Suggested all lowercase, e.g., openai, cannot be modified after creation",
|
84
84
|
"required": "Please enter the provider ID",
|
85
85
|
"title": "Provider ID"
|
@@ -79,7 +79,7 @@
|
|
79
79
|
},
|
80
80
|
"id": {
|
81
81
|
"desc": "Identificador único del proveedor de servicios, no se puede modificar una vez creado",
|
82
|
-
"format": "Solo puede contener letras minúsculas, guiones (-) y guiones bajos (_)",
|
82
|
+
"format": "Solo puede contener números, letras minúsculas, guiones (-) y guiones bajos (_) ",
|
83
83
|
"placeholder": "Se recomienda en minúsculas, por ejemplo openai, no se puede modificar después de crear",
|
84
84
|
"required": "Por favor, introduce el ID del proveedor",
|
85
85
|
"title": "ID del proveedor"
|
@@ -79,7 +79,7 @@
|
|
79
79
|
},
|
80
80
|
"id": {
|
81
81
|
"desc": "به عنوان شناسه منحصر به فرد ارائهدهنده خدمات، پس از ایجاد قابل ویرایش نخواهد بود",
|
82
|
-
"format": "فقط میتواند شامل حروف کوچک، خط تیره (-) و زیرخط (_) باشد",
|
82
|
+
"format": "فقط میتواند شامل اعداد، حروف کوچک، خط تیره (-) و زیرخط (_) باشد",
|
83
83
|
"placeholder": "توصیه میشود تماماً با حروف کوچک باشد، مانند openai، پس از ایجاد قابل ویرایش نخواهد بود",
|
84
84
|
"required": "لطفاً شناسه ارائهدهنده را وارد کنید",
|
85
85
|
"title": "شناسه ارائهدهنده"
|
@@ -79,7 +79,7 @@
|
|
79
79
|
},
|
80
80
|
"id": {
|
81
81
|
"desc": "Identifiant unique du fournisseur de services, qui ne peut pas être modifié après sa création",
|
82
|
-
"format": "Ne peut contenir que des lettres minuscules, des tirets (-) et des underscores (_) ",
|
82
|
+
"format": "Ne peut contenir que des chiffres, des lettres minuscules, des tirets (-) et des underscores (_) ",
|
83
83
|
"placeholder": "Utilisez uniquement des lettres minuscules, par exemple openai, non modifiable après création",
|
84
84
|
"required": "Veuillez entrer l'ID du fournisseur",
|
85
85
|
"title": "ID du fournisseur"
|
@@ -79,7 +79,7 @@
|
|
79
79
|
},
|
80
80
|
"id": {
|
81
81
|
"desc": "Identificatore unico del fornitore di servizi, non modificabile dopo la creazione",
|
82
|
-
"format": "Può contenere solo lettere minuscole, trattini (-) e underscore (_)",
|
82
|
+
"format": "Può contenere solo numeri, lettere minuscole, trattini (-) e underscore (_) ",
|
83
83
|
"placeholder": "Si consiglia di utilizzare solo lettere minuscole, ad esempio openai, non modificabile dopo la creazione",
|
84
84
|
"required": "Inserisci l'ID del fornitore",
|
85
85
|
"title": "ID del fornitore"
|
@@ -79,7 +79,7 @@
|
|
79
79
|
},
|
80
80
|
"id": {
|
81
81
|
"desc": "サービスプロバイダーの一意の識別子であり、作成後は変更できません",
|
82
|
-
"format": "
|
82
|
+
"format": "数字、小文字のアルファベット、ハイフン(-)、およびアンダースコア(_)のみを含むことができます",
|
83
83
|
"placeholder": "小文字で入力してください(例: openai)。作成後は変更できません",
|
84
84
|
"required": "サービスプロバイダー ID を入力してください",
|
85
85
|
"title": "サービスプロバイダー ID"
|
@@ -79,7 +79,7 @@
|
|
79
79
|
},
|
80
80
|
"id": {
|
81
81
|
"desc": "서비스 제공자의 고유 식별자로, 생성 후에는 수정할 수 없습니다.",
|
82
|
-
"format": "소문자, 하이픈(-), 및 언더스코어(_)만 포함할 수 있습니다.",
|
82
|
+
"format": "숫자, 소문자, 하이픈(-), 및 언더스코어(_)만 포함할 수 있습니다.",
|
83
83
|
"placeholder": "소문자로 입력하세요, 예: openai, 생성 후 수정할 수 없습니다",
|
84
84
|
"required": "서비스 제공자 ID를 입력하세요",
|
85
85
|
"title": "서비스 제공자 ID"
|
@@ -79,7 +79,7 @@
|
|
79
79
|
},
|
80
80
|
"id": {
|
81
81
|
"desc": "Een unieke identificatie voor de dienstverlener, kan na creatie niet meer worden gewijzigd",
|
82
|
-
"format": "Mag alleen kleine letters, koppeltekens (-) en
|
82
|
+
"format": "Mag alleen cijfers, kleine letters, koppeltekens (-) en onderstrepingstekens (_) bevatten",
|
83
83
|
"placeholder": "Gebruik alleen kleine letters, bijvoorbeeld openai, kan niet worden gewijzigd na aanmaak",
|
84
84
|
"required": "Vul de provider ID in",
|
85
85
|
"title": "Provider ID"
|
@@ -79,7 +79,7 @@
|
|
79
79
|
},
|
80
80
|
"id": {
|
81
81
|
"desc": "Unikalny identyfikator dostawcy usług, po utworzeniu nie można go zmienić",
|
82
|
-
"format": "Może zawierać tylko małe litery, myślniki (-) i podkreślenia (_)",
|
82
|
+
"format": "Może zawierać tylko cyfry, małe litery, myślniki (-) i podkreślenia (_) ",
|
83
83
|
"placeholder": "Zaleca się użycie małych liter, np. openai, po utworzeniu nie można edytować",
|
84
84
|
"required": "Proszę wpisać identyfikator dostawcy",
|
85
85
|
"title": "Identyfikator dostawcy"
|
@@ -79,7 +79,7 @@
|
|
79
79
|
},
|
80
80
|
"id": {
|
81
81
|
"desc": "Identificador único do provedor de serviços, não pode ser modificado após a criação",
|
82
|
-
"format": "
|
82
|
+
"format": "Só pode conter números, letras minúsculas, hífens (-) e sublinhados (_) ",
|
83
83
|
"placeholder": "Sugestão: tudo em minúsculas, por exemplo, openai, não poderá ser modificado após a criação",
|
84
84
|
"required": "Por favor, insira o ID do provedor",
|
85
85
|
"title": "ID do Provedor"
|
@@ -79,7 +79,7 @@
|
|
79
79
|
},
|
80
80
|
"id": {
|
81
81
|
"desc": "Уникальный идентификатор для поставщика услуг, который нельзя изменить после создания",
|
82
|
-
"format": "Может содержать только строчные буквы, дефисы (-) и подчеркивания (_)",
|
82
|
+
"format": "Может содержать только цифры, строчные буквы, дефисы (-) и подчеркивания (_) ",
|
83
83
|
"placeholder": "Рекомендуется использовать строчные буквы, например, openai, после создания изменить нельзя",
|
84
84
|
"required": "Пожалуйста, введите ID провайдера",
|
85
85
|
"title": "ID провайдера"
|
@@ -79,7 +79,7 @@
|
|
79
79
|
},
|
80
80
|
"id": {
|
81
81
|
"desc": "Hizmet sağlayıcının benzersiz kimliği, oluşturulduktan sonra değiştirilemez",
|
82
|
-
"format": "Sadece küçük harfler, tire (-) ve alt çizgi (_) içerebilir",
|
82
|
+
"format": "Sadece rakamlar, küçük harfler, tire (-) ve alt çizgi (_) içerebilir",
|
83
83
|
"placeholder": "Küçük harflerle yazılması önerilir, örneğin openai, oluşturduktan sonra değiştirilemez",
|
84
84
|
"required": "Lütfen hizmet sağlayıcı ID'sini girin",
|
85
85
|
"title": "Hizmet Sağlayıcı ID"
|
@@ -79,7 +79,7 @@
|
|
79
79
|
},
|
80
80
|
"id": {
|
81
81
|
"desc": "Là định danh duy nhất của nhà cung cấp dịch vụ, không thể sửa đổi sau khi tạo",
|
82
|
-
"format": "Chỉ có thể chứa chữ cái thường, dấu gạch ngang (-) và dấu gạch dưới (_)",
|
82
|
+
"format": "Chỉ có thể chứa số, chữ cái thường, dấu gạch ngang (-) và dấu gạch dưới (_) ",
|
83
83
|
"placeholder": "Nên viết toàn bộ bằng chữ thường, ví dụ openai, không thể sửa sau khi tạo",
|
84
84
|
"required": "Vui lòng nhập ID nhà cung cấp",
|
85
85
|
"title": "ID nhà cung cấp"
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.45.
|
3
|
+
"version": "1.45.7",
|
4
4
|
"description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
|
5
5
|
"keywords": [
|
6
6
|
"framework",
|
@@ -51,7 +51,7 @@ const CreateNewProvider = memo<CreateNewProviderProps>(({ onClose, open }) => {
|
|
51
51
|
{ message: t('createNewAiProvider.id.required'), required: true },
|
52
52
|
{
|
53
53
|
message: t('createNewAiProvider.id.format'),
|
54
|
-
pattern: /^[
|
54
|
+
pattern: /^[\d_a-z-]+$/,
|
55
55
|
},
|
56
56
|
],
|
57
57
|
},
|
@@ -20,7 +20,7 @@ const PGliteIcon: IconType = forwardRef(({ size = '1em', style, ...rest }, ref)
|
|
20
20
|
<path
|
21
21
|
clip-rule="evenodd"
|
22
22
|
d="M941.581 335.737v460.806c0 15.926-12.913 28.836-28.832 28.818l-115.283-.137c-15.243-.018-27.706-11.88-28.703-26.877.011-.569.018-1.138.018-1.711l-.004-172.904c0-47.745-38.736-86.451-86.454-86.451-46.245 0-84.052-36.359-86.342-82.068V191.496l201.708.149c79.484.058 143.892 64.553 143.892 144.092zm-576-144.281v201.818c0 47.746 38.682 86.456 86.4 86.456h86.4v-5.796c0 66.816 54.13 120.98 120.902 120.98 28.617 0 51.815 23.213 51.815 51.848v149.644c0 .688.011 1.372.025 2.057-.943 15.065-13.453 26.992-28.746 26.992l-144.982-.007.986-201.586c.079-15.915-12.755-28.88-28.66-28.959-15.904-.079-28.861 12.763-28.94 28.678l-.986 201.741v.118l-172.174-.01V623.722c0-15.915-12.895-28.819-28.8-28.819-15.906 0-28.8 12.904-28.8 28.819v201.704l-143.642-.007c-15.905-.004-28.798-12.904-28.798-28.819V335.547c0-79.58 64.471-144.093 144.001-144.092l143.999.001zm446.544 173.693c0-23.874-19.343-43.228-43.2-43.228-23.861 0-43.2 19.354-43.2 43.228 0 23.875 19.339 43.226 43.2 43.226 23.857 0 43.2-19.351 43.2-43.226z"
|
23
|
-
|
23
|
+
/>
|
24
24
|
</svg>
|
25
25
|
);
|
26
26
|
});
|
@@ -16,15 +16,19 @@ exports[`LobeOpenAI > models > should get models 1`] = `
|
|
16
16
|
},
|
17
17
|
{
|
18
18
|
"id": "gpt-3.5-turbo-16k",
|
19
|
+
"releasedAt": "2023-05-10",
|
19
20
|
},
|
20
21
|
{
|
21
22
|
"id": "gpt-3.5-turbo-16k-0613",
|
23
|
+
"releasedAt": "2023-05-30",
|
22
24
|
},
|
23
25
|
{
|
24
26
|
"id": "gpt-4-1106-vision-preview",
|
27
|
+
"releasedAt": "2024-03-26",
|
25
28
|
},
|
26
29
|
{
|
27
30
|
"id": "gpt-3.5-turbo-instruct-0914",
|
31
|
+
"releasedAt": "2023-09-07",
|
28
32
|
},
|
29
33
|
{
|
30
34
|
"contextWindowTokens": 128000,
|
@@ -63,9 +67,11 @@ exports[`LobeOpenAI > models > should get models 1`] = `
|
|
63
67
|
},
|
64
68
|
{
|
65
69
|
"id": "gpt-3.5-turbo-0301",
|
70
|
+
"releasedAt": "2023-03-01",
|
66
71
|
},
|
67
72
|
{
|
68
73
|
"id": "gpt-3.5-turbo-0613",
|
74
|
+
"releasedAt": "2023-06-12",
|
69
75
|
},
|
70
76
|
{
|
71
77
|
"contextWindowTokens": 16385,
|
@@ -1,7 +1,6 @@
|
|
1
1
|
// @vitest-environment node
|
2
2
|
import OpenAI from 'openai';
|
3
3
|
import type { Stream } from 'openai/streaming';
|
4
|
-
|
5
4
|
import { Mock, afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
6
5
|
|
7
6
|
import {
|
@@ -11,6 +10,7 @@ import {
|
|
11
10
|
LobeOpenAICompatibleRuntime,
|
12
11
|
ModelProvider,
|
13
12
|
} from '@/libs/agent-runtime';
|
13
|
+
import officalOpenAIModels from '@/libs/agent-runtime/openai/fixtures/openai-models.json';
|
14
14
|
import { sleep } from '@/utils/sleep';
|
15
15
|
|
16
16
|
import * as debugStreamModule from '../debugStream';
|
@@ -802,26 +802,29 @@ describe('LobeOpenAICompatibleFactory', () => {
|
|
802
802
|
|
803
803
|
it('should use custom stream handler when provided', async () => {
|
804
804
|
// Create a custom stream handler that handles both ReadableStream and OpenAI Stream
|
805
|
-
const customStreamHandler = vi.fn(
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
805
|
+
const customStreamHandler = vi.fn(
|
806
|
+
(stream: ReadableStream | Stream<OpenAI.ChatCompletionChunk>) => {
|
807
|
+
const readableStream =
|
808
|
+
stream instanceof ReadableStream ? stream : stream.toReadableStream();
|
809
|
+
return new ReadableStream({
|
810
|
+
start(controller) {
|
811
|
+
const reader = readableStream.getReader();
|
812
|
+
const process = async () => {
|
813
|
+
try {
|
814
|
+
while (true) {
|
815
|
+
const { done, value } = await reader.read();
|
816
|
+
if (done) break;
|
817
|
+
controller.enqueue(value);
|
818
|
+
}
|
819
|
+
} finally {
|
820
|
+
controller.close();
|
816
821
|
}
|
817
|
-
}
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
});
|
824
|
-
});
|
822
|
+
};
|
823
|
+
process();
|
824
|
+
},
|
825
|
+
});
|
826
|
+
},
|
827
|
+
);
|
825
828
|
|
826
829
|
const LobeMockProvider = LobeOpenAICompatibleFactory({
|
827
830
|
baseURL: 'https://api.test.com/v1',
|
@@ -897,10 +900,10 @@ describe('LobeOpenAICompatibleFactory', () => {
|
|
897
900
|
choices: [
|
898
901
|
{
|
899
902
|
index: 0,
|
900
|
-
message: {
|
901
|
-
role: 'assistant',
|
903
|
+
message: {
|
904
|
+
role: 'assistant',
|
902
905
|
content: 'Test response',
|
903
|
-
refusal: null
|
906
|
+
refusal: null,
|
904
907
|
},
|
905
908
|
logprobs: null,
|
906
909
|
finish_reason: 'stop',
|
@@ -969,4 +972,72 @@ describe('LobeOpenAICompatibleFactory', () => {
|
|
969
972
|
});
|
970
973
|
});
|
971
974
|
});
|
975
|
+
|
976
|
+
describe('models', () => {
|
977
|
+
it('should get models with third party model list', async () => {
|
978
|
+
vi.spyOn(instance['client'].models, 'list').mockResolvedValue({
|
979
|
+
data: [
|
980
|
+
{ id: 'gpt-4o', object: 'model', created: 1698218177 },
|
981
|
+
{ id: 'claude-3-haiku-20240307', object: 'model' },
|
982
|
+
{ id: 'gpt-4o-mini', object: 'model', created: 1698318177 * 1000 },
|
983
|
+
{ id: 'gemini', object: 'model', created: 1736499509125 },
|
984
|
+
],
|
985
|
+
} as any);
|
986
|
+
|
987
|
+
const list = await instance.models();
|
988
|
+
|
989
|
+
expect(list).toEqual([
|
990
|
+
{
|
991
|
+
contextWindowTokens: 128000,
|
992
|
+
releasedAt: '2023-10-25',
|
993
|
+
description:
|
994
|
+
'ChatGPT-4o 是一款动态模型,实时更新以保持当前最新版本。它结合了强大的语言理解与生成能力,适合于大规模应用场景,包括客户服务、教育和技术支持。',
|
995
|
+
displayName: 'GPT-4o',
|
996
|
+
enabled: true,
|
997
|
+
functionCall: true,
|
998
|
+
id: 'gpt-4o',
|
999
|
+
pricing: {
|
1000
|
+
input: 2.5,
|
1001
|
+
output: 10,
|
1002
|
+
},
|
1003
|
+
vision: true,
|
1004
|
+
},
|
1005
|
+
{
|
1006
|
+
contextWindowTokens: 200000,
|
1007
|
+
description:
|
1008
|
+
'Claude 3 Haiku 是 Anthropic 的最快且最紧凑的模型,旨在实现近乎即时的响应。它具有快速且准确的定向性能。',
|
1009
|
+
displayName: 'Claude 3 Haiku',
|
1010
|
+
functionCall: true,
|
1011
|
+
id: 'claude-3-haiku-20240307',
|
1012
|
+
maxOutput: 4096,
|
1013
|
+
pricing: {
|
1014
|
+
input: 0.25,
|
1015
|
+
output: 1.25,
|
1016
|
+
},
|
1017
|
+
releasedAt: '2024-03-07',
|
1018
|
+
vision: true,
|
1019
|
+
},
|
1020
|
+
{
|
1021
|
+
contextWindowTokens: 128000,
|
1022
|
+
description:
|
1023
|
+
'GPT-4o mini是OpenAI在GPT-4 Omni之后推出的最新模型,支持图文输入并输出文本。作为他们最先进的小型模型,它比其他近期的前沿模型便宜很多,并且比GPT-3.5 Turbo便宜超过60%。它保持了最先进的智能,同时具有显著的性价比。GPT-4o mini在MMLU测试中获得了 82% 的得分,目前在聊天偏好上排名高于 GPT-4。',
|
1024
|
+
displayName: 'GPT-4o mini',
|
1025
|
+
enabled: true,
|
1026
|
+
functionCall: true,
|
1027
|
+
id: 'gpt-4o-mini',
|
1028
|
+
maxOutput: 16385,
|
1029
|
+
pricing: {
|
1030
|
+
input: 0.15,
|
1031
|
+
output: 0.6,
|
1032
|
+
},
|
1033
|
+
releasedAt: '2023-10-26',
|
1034
|
+
vision: true,
|
1035
|
+
},
|
1036
|
+
{
|
1037
|
+
id: 'gemini',
|
1038
|
+
releasedAt: '2025-01-10',
|
1039
|
+
},
|
1040
|
+
]);
|
1041
|
+
});
|
1042
|
+
});
|
972
1043
|
});
|
@@ -279,20 +279,34 @@ export const LobeOpenAICompatibleFactory = <T extends Record<string, any> = any>
|
|
279
279
|
return models.transformModel(item);
|
280
280
|
}
|
281
281
|
|
282
|
+
const toReleasedAt = () => {
|
283
|
+
if (!item.created) return;
|
284
|
+
|
285
|
+
// guarantee item.created in Date String format
|
286
|
+
if (
|
287
|
+
typeof (item.created as any) === 'string' ||
|
288
|
+
// or in milliseconds
|
289
|
+
item.created.toFixed(0).length === 13
|
290
|
+
) {
|
291
|
+
return dayjs.utc(item.created).format('YYYY-MM-DD');
|
292
|
+
}
|
293
|
+
|
294
|
+
// by default, the created time is in seconds
|
295
|
+
return dayjs.utc(item.created * 1000).format('YYYY-MM-DD');
|
296
|
+
};
|
297
|
+
|
282
298
|
// TODO: should refactor after remove v1 user/modelList code
|
283
299
|
const knownModel = LOBE_DEFAULT_MODEL_LIST.find((model) => model.id === item.id);
|
284
300
|
|
285
301
|
if (knownModel) {
|
286
302
|
dayjs.extend(utc);
|
287
303
|
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
knownModel.releasedAt ?? dayjs.utc(item.created * 1000).format('YYYY-MM-DD'),
|
292
|
-
};
|
304
|
+
const releasedAt = knownModel.releasedAt ?? toReleasedAt();
|
305
|
+
|
306
|
+
return { ...knownModel, releasedAt };
|
293
307
|
}
|
294
308
|
|
295
|
-
return { id: item.id };
|
309
|
+
return { id: item.id, releasedAt: toReleasedAt() };
|
296
310
|
})
|
297
311
|
|
298
312
|
.filter(Boolean) as ChatModelCard[];
|