Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
bentwnghk committed Dec 3, 2024
2 parents c13f75c + 2b6b1b3 commit 27c00d5
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,12 @@ Our marketplace is not just a showcase platform but also a collaborative space.

| Recent Submits | Description |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Daily Doctor](https://chat-preview.lobehub.com/market?agent=yunchat-docter)<br/><sup>By **[yuyun2000](https://github.com/yuyun2000)** on **2024-11-30**</sup> | Specializes in surgical diagnosis and personalized health management<br/>`general-medicine` `surgery` `health-consultation` `personalized-treatment` `medical-education` |
| [Python Artisan](https://chat-preview.lobehub.com/market?agent=yunchat)<br/><sup>By **[yuyun2000](https://github.com/yuyun2000)** on **2024-11-30**</sup> | Expert in Python development and deep learning, skilled in tool selection and code optimization<br/>`python-development` `deep-learning` `code-optimization` `security-review` `project-planning` |
| [AI Assistant for Course Content and Teaching Guidelines](https://chat-preview.lobehub.com/market?agent=course-prep-teaching-guide-ai)<br/><sup>By **[HNaga](https://github.com/HNaga)** on **2024-11-29**</sup> | This AI assistant is designed to help educators and instructors prepare comprehensive course content and provide practical teaching guidelines. It leverages advanced NLP capabilities to generate lesson plans, suggest engaging teaching strategies, and offer insights into educational best practices.<br/>`education` `teaching` `course-design` `content-creation` `ai-assistance` `curriculum-development` `instructional-design` |
| [Backend Development Assistant](https://chat-preview.lobehub.com/market?agent=backend-assistant)<br/><sup>By **[zeno980](https://github.com/zeno980)** on **2024-11-26**</sup> | Skilled in backend development tasks<br/>`backend-development` `ai-technology` `web-applications` `spring` `sql` |
| [Bilingual Dictionary Expert](https://chat-preview.lobehub.com/market?agent=english-chinese-dictionary-expert)<br/><sup>By **[swarfte](https://github.com/swarfte)** on **2024-11-26**</sup> | Expert in bilingual English-Chinese vocabulary translation and analysis<br/>`translation` `language-learning` `vocabulary` `dictionary` |
| [SSC Incremental](https://chat-preview.lobehub.com/market?agent=great-for-analysis-coding-and-rubber-ducking)<br/><sup>By **[Base03](https://github.com/Base03)** on **2024-11-26**</sup> | Claude minus the Reddit<br/>`technology` `analysis` `software` `ai` `research` |

> 📊 Total agents: [<kbd>**447**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
> 📊 Total agents: [<kbd>**450**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
<!-- AGENT LIST -->

Expand Down
6 changes: 3 additions & 3 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,12 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地

| 最近新增 | 助手说明 |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [日常医生](https://chat-preview.lobehub.com/market?agent=yunchat-docter)<br/><sup>By **[yuyun2000](https://github.com/yuyun2000)** on **2024-11-30**</sup> | 擅长外科诊疗与个性化健康管理<br/>`全科医学` `外科` `健康咨询` `个性化治疗` `医学教育` |
| [Python 智匠](https://chat-preview.lobehub.com/market?agent=yunchat)<br/><sup>By **[yuyun2000](https://github.com/yuyun2000)** on **2024-11-30**</sup> | 精通 Python 开发与深度学习,擅长工具选择与代码优化<br/>`python开发` `深度学习` `代码优化` `安全审查` `项目规划` |
| [课程内容和教学指南的 AI 助手](https://chat-preview.lobehub.com/market?agent=course-prep-teaching-guide-ai)<br/><sup>By **[HNaga](https://github.com/HNaga)** on **2024-11-29**</sup> | 这个 AI 助手旨在帮助教育工作者和讲师准备全面的课程内容并提供实用的教学指南。它利用先进的自然语言处理能力生成课程计划,建议引人入胜的教学策略,并提供教育最佳实践的见解。<br/>`教育` `教学` `课程设计` `内容创作` `人工智能助手` `课程开发` `教学设计` |
| [后端开发助手](https://chat-preview.lobehub.com/market?agent=backend-assistant)<br/><sup>By **[zeno980](https://github.com/zeno980)** on **2024-11-26**</sup> | 擅长后端开发任务<br/>`后端开发` `ai技术` `web应用` `spring` `sql` |
| [双语词典专家](https://chat-preview.lobehub.com/market?agent=english-chinese-dictionary-expert)<br/><sup>By **[swarfte](https://github.com/swarfte)** on **2024-11-26**</sup> | 双语英语 - 中文词汇翻译和分析专家<br/>`翻译` `语言学习` `词汇` `词典` |
| [SSC 增量](https://chat-preview.lobehub.com/market?agent=great-for-analysis-coding-and-rubber-ducking)<br/><sup>By **[Base03](https://github.com/Base03)** on **2024-11-26**</sup> | Claude 减去 Reddit<br/>`技术` `分析` `软件` `人工智能` `研究` |

> 📊 Total agents: [<kbd>**447**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
> 📊 Total agents: [<kbd>**450**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
<!-- AGENT LIST -->

Expand Down
7 changes: 7 additions & 0 deletions changelog/v1.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
[
{
"children": {
"improvements": ["Add QwQ 32B Preview model."]
},
"date": "2024-12-02",
"version": "1.35.6"
},
{
"children": {
"improvements": ["Deprecated the current client mode code."]
Expand Down
6 changes: 6 additions & 0 deletions src/config/modelProviders/huggingface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ const HuggingFace: ModelProviderCard = {
id: 'Qwen/Qwen2.5-Coder-32B-Instruct',
tokens: 32_768,
},
{
description: 'Qwen QwQ 是由 Qwen 团队开发的实验研究模型,专注于提升AI推理能力。',
displayName: 'QwQ 32B Preview',
id: 'Qwen/QwQ-32B-Preview',
tokens: 32_768,
},
{
displayName: 'Phi 3.5 mini instruct',
id: 'microsoft/Phi-3.5-mini-instruct',
Expand Down
34 changes: 33 additions & 1 deletion src/database/server/models/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { DeepPartial } from 'utility-types';
import { serverDB } from '@/database/server/core/db';
import { KeyVaultsGateKeeper } from '@/server/modules/KeyVaultsEncrypt';
import { UserGuide, UserPreference } from '@/types/user';
import { UserSettings } from '@/types/user/settings';
import { UserKeyVaults, UserSettings } from '@/types/user/settings';
import { merge } from '@/utils/merge';

import { NewUser, UserItem, userSettings, users } from '../schemas/lobechat';
Expand Down Expand Up @@ -105,6 +105,38 @@ export class UserModel {
};
};

static getUserApiKeys = async (id: string) => {
const result = await serverDB
.select({
settingsKeyVaults: userSettings.keyVaults,
})
.from(userSettings)
.where(eq(userSettings.id, id));

if (!result || !result[0]) {
throw new UserNotFoundError();
}

const state = result[0];

// Decrypt keyVaults
let decryptKeyVaults = {};
if (state.settingsKeyVaults) {
const gateKeeper = await KeyVaultsGateKeeper.initWithEnvKey();
const { wasAuthentic, plaintext } = await gateKeeper.decrypt(state.settingsKeyVaults);

if (wasAuthentic) {
try {
decryptKeyVaults = JSON.parse(plaintext);
} catch (e) {
console.error(`Failed to parse keyVaults ,userId: ${id}. Error:`, e);
}
}
}

return decryptKeyVaults as UserKeyVaults;
};

async updateUser(id: string, value: Partial<UserItem>) {
return serverDB
.update(users)
Expand Down

0 comments on commit 27c00d5

Please sign in to comment.