Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/lobehub/lobe-chat
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Nov 25, 2024
2 parents 2925c45 + b04f599 commit 3e0bc27
Show file tree
Hide file tree
Showing 20 changed files with 501 additions and 30 deletions.
100 changes: 100 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,106 @@

# Changelog

### [Version 1.33.3](https://github.com/lobehub/lobe-chat/compare/v1.33.2...v1.33.3)

<sup>Released on **2024-11-25**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix `fetchOnClient` functional for Moonshot.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

- **misc**: Fix `fetchOnClient` functional for Moonshot, closes [#4787](https://github.com/lobehub/lobe-chat/issues/4787) ([bef89a7](https://github.com/lobehub/lobe-chat/commit/bef89a7))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

### [Version 1.33.2](https://github.com/lobehub/lobe-chat/compare/v1.33.1...v1.33.2)

<sup>Released on **2024-11-25**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix multi-turns tools calling.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

- **misc**: Fix multi-turns tools calling, closes [#4789](https://github.com/lobehub/lobe-chat/issues/4789) ([9d8845f](https://github.com/lobehub/lobe-chat/commit/9d8845f))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

### [Version 1.33.1](https://github.com/lobehub/lobe-chat/compare/v1.33.0...v1.33.1)

<sup>Released on **2024-11-25**</sup>

#### 💄 Styles

- **misc**: Add gemini-exp-1121 model.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### Styles

- **misc**: Add gemini-exp-1121 model, closes [#4783](https://github.com/lobehub/lobe-chat/issues/4783) ([3b2cd88](https://github.com/lobehub/lobe-chat/commit/3b2cd88))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

## [Version 1.33.0](https://github.com/lobehub/lobe-chat/compare/v1.32.9...v1.33.0)

<sup>Released on **2024-11-25**</sup>

#### ✨ Features

- **misc**: Add Gitee AI model provider.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's improved

- **misc**: Add Gitee AI model provider, closes [#4716](https://github.com/lobehub/lobe-chat/issues/4716) ([f1cb0af](https://github.com/lobehub/lobe-chat/commit/f1cb0af))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

### [Version 1.32.9](https://github.com/lobehub/lobe-chat/compare/v1.32.8...v1.32.9)

<sup>Released on **2024-11-24**</sup>
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ ENV \
DEEPSEEK_API_KEY="" DEEPSEEK_MODEL_LIST="" \
# Fireworks AI
FIREWORKSAI_API_KEY="" FIREWORKSAI_MODEL_LIST="" \
# Gitee AI
GITEE_AI_API_KEY="" GITEE_AI_MODEL_LIST="" \
# GitHub
GITHUB_TOKEN="" GITHUB_MODEL_LIST="" \
# Google
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile.database
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ ENV \
DEEPSEEK_API_KEY="" DEEPSEEK_MODEL_LIST="" \
# Fireworks AI
FIREWORKSAI_API_KEY="" FIREWORKSAI_MODEL_LIST="" \
# Gitee AI
GITEE_AI_API_KEY="" GITEE_AI_MODEL_LIST="" \
# GitHub
GITHUB_TOKEN="" GITHUB_MODEL_LIST="" \
# Google
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lobehub/chat",
"version": "1.32.9",
"version": "1.33.3",
"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.",
"keywords": [
"framework",
Expand Down
2 changes: 2 additions & 0 deletions src/app/(main)/settings/llm/ProviderList/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
BaichuanProviderCard,
DeepSeekProviderCard,
FireworksAIProviderCard,
GiteeAIProviderCard,
GoogleProviderCard,
GroqProviderCard,
HunyuanProviderCard,
Expand Down Expand Up @@ -88,6 +89,7 @@ export const useProviderList = (): ProviderItem[] => {
TaichuProviderCard,
InternLMProviderCard,
SiliconCloudProviderCard,
GiteeAIProviderCard,
],
[
AzureProvider,
Expand Down
6 changes: 6 additions & 0 deletions src/config/llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ export const getLLMConfig = () => {
ENABLED_SILICONCLOUD: z.boolean(),
SILICONCLOUD_API_KEY: z.string().optional(),

ENABLED_GITEE_AI: z.boolean(),
GITEE_AI_API_KEY: z.string().optional(),

ENABLED_UPSTAGE: z.boolean(),
UPSTAGE_API_KEY: z.string().optional(),

Expand Down Expand Up @@ -210,6 +213,9 @@ export const getLLMConfig = () => {
ENABLED_SILICONCLOUD: !!process.env.SILICONCLOUD_API_KEY,
SILICONCLOUD_API_KEY: process.env.SILICONCLOUD_API_KEY,

ENABLED_GITEE_AI: !!process.env.GITEE_AI_API_KEY,
GITEE_AI_API_KEY: process.env.GITEE_AI_API_KEY,

ENABLED_UPSTAGE: !!process.env.UPSTAGE_API_KEY,
UPSTAGE_API_KEY: process.env.UPSTAGE_API_KEY,

Expand Down
66 changes: 66 additions & 0 deletions src/config/modelProviders/giteeai.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { ModelProviderCard } from '@/types/llm';

// ref: https://ai.gitee.com/serverless-api/packages/1493
const GiteeAI: ModelProviderCard = {
chatModels: [
{
description: 'Qwen2.5-72B-Instruct 支持 16k 上下文, 生成长文本超过 8K 。支持 function call 与外部系统无缝交互,极大提升了灵活性和扩展性。模型知识明显增加,并且大大提高了编码和数学能力, 多语言支持超过 29 种',
displayName: 'Qwen2.5 72B Instruct',
enabled: true,
functionCall: true,
id: 'Qwen2.5-72B-Instruct',
tokens: 16_000,
},
{
description: 'Qwen2 是 Qwen 模型的最新系列,支持 128k 上下文,对比当前最优的开源模型,Qwen2-72B 在自然语言理解、知识、代码、数学及多语言等多项能力上均显著超越当前领先的模型。',
displayName: 'Qwen2 72B Instruct',
id: 'Qwen2-72B-Instruct',
tokens: 6000,
},
{
description: 'Qwen2 是 Qwen 模型的最新系列,能够超越同等规模的最优开源模型甚至更大规模的模型,Qwen2 7B 在多个评测上取得显著的优势,尤其是代码及中文理解上。',
displayName: 'Qwen2 7B Instruct',
id: 'Qwen2-7B-Instruct',
tokens: 32_000,
},
{
description: 'GLM-4-9B-Chat 在语义、数学、推理、代码和知识等多方面均表现出较高性能。还具备网页浏览、代码执行、自定义工具调用和长文本推理。 支持包括日语,韩语,德语在内的 26 种语言。',
displayName: 'GLM4 9B Chat',
enabled: true,
id: 'glm-4-9b-chat',
tokens: 32_000,
},
{
description: 'Yi-1.5-34B 在保持原系列模型优秀的通用语言能力的前提下,通过增量训练 5 千亿高质量 token,大幅提高了数学逻辑、代码能力。',
displayName: 'Yi 34B Chat',
enabled: true,
id: 'Yi-34B-Chat',
tokens: 4000,
},
{
description: 'DeepSeek Coder 33B 是一个代码语言模型, 基于 2 万亿数据训练而成,其中 87% 为代码, 13% 为中英文语言。模型引入 16K 窗口大小和填空任务,提供项目级别的代码补全和片段填充功能。',
displayName: 'DeepSeek Coder 33B Instruct',
enabled: true,
id: 'deepseek-coder-33B-instruct',
tokens: 8000,
},
{
description: 'CodeGeeX4-ALL-9B 是一个多语言代码生成模型,支持包括代码补全和生成、代码解释器、网络搜索、函数调用、仓库级代码问答在内的全面功能,覆盖软件开发的各种场景。是参数少于 10B 的顶尖代码生成模型。',
displayName: 'CodeGeeX4 All 9B',
enabled: true,
id: 'codegeex4-all-9b',
tokens: 40_000,
},
],
checkModel: 'Qwen2-7B-Instruct',
description:
'Gitee AI 的 Serverless API 为 AI 开发者提供开箱即用的大模型推理 API 服务。',
disableBrowserRequest: true,
id: 'giteeai',
modelList: { showModelFetcher: true },
modelsUrl: 'https://ai.gitee.com/docs/openapi/v1#tag/serverless/POST/chat/completions',
name: 'Gitee AI',
url: 'https://ai.gitee.com',
};

export default GiteeAI;
17 changes: 17 additions & 0 deletions src/config/modelProviders/google.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@ import { ModelProviderCard } from '@/types/llm';
// ref: https://ai.google.dev/gemini-api/docs/models/gemini
const Google: ModelProviderCard = {
chatModels: [
{
description:
'Gemini Exp 1121 是Google最新的实验性多模态AI模型,具备快速处理能力,支持文本、图像和视频输入,适用于多种任务的高效扩展。',
displayName: 'Gemini Experimental 1121',
enabled: true,
functionCall: true,
id: 'gemini-exp-1121',
maxOutput: 8192,
pricing: {
cachedInput: 0,
input: 0,
output: 0,
},
releasedAt: '2024-11-21',
tokens: 32_767 + 8192,
vision: true,
},
{
description:
'Gemini Exp 1114 是Google最新的实验性多模态AI模型,具备快速处理能力,支持文本、图像和视频输入,适用于多种任务的高效扩展。',
Expand Down
4 changes: 4 additions & 0 deletions src/config/modelProviders/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import BedrockProvider from './bedrock';
import CloudflareProvider from './cloudflare';
import DeepSeekProvider from './deepseek';
import FireworksAIProvider from './fireworksai';
import GiteeAIProvider from './giteeai';
import GithubProvider from './github';
import GoogleProvider from './google';
import GroqProvider from './groq';
Expand Down Expand Up @@ -64,6 +65,7 @@ export const LOBE_DEFAULT_MODEL_LIST: ChatModelCard[] = [
CloudflareProvider.chatModels,
Ai360Provider.chatModels,
SiliconCloudProvider.chatModels,
GiteeAIProvider.chatModels,
UpstageProvider.chatModels,
SparkProvider.chatModels,
Ai21Provider.chatModels,
Expand Down Expand Up @@ -109,6 +111,7 @@ export const DEFAULT_MODEL_PROVIDER_LIST = [
TaichuProvider,
InternLMProvider,
SiliconCloudProvider,
GiteeAIProvider,
];

export const filterEnabledModels = (provider: ModelProviderCard) => {
Expand All @@ -129,6 +132,7 @@ export { default as BedrockProviderCard } from './bedrock';
export { default as CloudflareProviderCard } from './cloudflare';
export { default as DeepSeekProviderCard } from './deepseek';
export { default as FireworksAIProviderCard } from './fireworksai';
export { default as GiteeAIProviderCard } from './giteeai';
export { default as GithubProviderCard } from './github';
export { default as GoogleProviderCard } from './google';
export { default as GroqProviderCard } from './groq';
Expand Down
7 changes: 7 additions & 0 deletions src/libs/agent-runtime/AgentRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { LobeBedrockAI, LobeBedrockAIParams } from './bedrock';
import { LobeCloudflareAI, LobeCloudflareParams } from './cloudflare';
import { LobeDeepSeekAI } from './deepseek';
import { LobeFireworksAI } from './fireworksai';
import { LobeGiteeAI } from './giteeai';
import { LobeGithubAI } from './github';
import { LobeGoogleAI } from './google';
import { LobeGroq } from './groq';
Expand Down Expand Up @@ -137,6 +138,7 @@ class AgentRuntime {
cloudflare: Partial<LobeCloudflareParams>;
deepseek: Partial<ClientOptions>;
fireworksai: Partial<ClientOptions>;
giteeai: Partial<ClientOptions>;
github: Partial<ClientOptions>;
google: { apiKey?: string; baseURL?: string };
groq: Partial<ClientOptions>;
Expand Down Expand Up @@ -303,6 +305,11 @@ class AgentRuntime {
break;
}

case ModelProvider.GiteeAI: {
runtimeModel = new LobeGiteeAI(params.giteeai);
break;
}

case ModelProvider.Upstage: {
runtimeModel = new LobeUpstageAI(params.upstage);
break;
Expand Down
Loading

0 comments on commit 3e0bc27

Please sign in to comment.