Skip to content

Conversation

@Crokily
Copy link
Contributor

@Crokily Crokily commented Sep 27, 2025

现在AI助手默认使用免费的InternS1模型,不需要配置Key也能与文档AI对话了。

主要改动点:

  1. 解耦了AI route的代码,现在route只专注于Post /api/chat的接口代码,AI相关的代码被解耦到lib/ai下,拆分出了model切换,model配置,prompt配置三个文件,便于后续AI功能拓展开发的代码复用。
  2. 引入了ai-sdk/openai-compatible以增加对chatAPI兼容的外部模型的支持,provider下新增Intern model
  3. AI助手增加书生大模型的使用。

效果:
image

@Crokily Crokily self-assigned this Sep 27, 2025
@Crokily Crokily added this to AI Sep 27, 2025
@Crokily Crokily added the Agent label Sep 27, 2025
@vercel
Copy link

vercel bot commented Sep 27, 2025

@Crokily is attempting to deploy a commit to the longsizhuo's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Crokily Crokily changed the title 对AI助手增加了书生大模型的支持,并解耦了AI模块的代码便于后续复用 feat: 对AI助手增加了书生大模型的支持,并解耦了AI模块的代码便于后续复用 Sep 27, 2025
@Mira190
Copy link
Contributor

Mira190 commented Sep 27, 2025

image 能不能自动识别用户输入的语言然后输出对应语言,比如我说中文,能自动输出中文回答?能否通过加prompt实现? 然后比如我往上翻想看看问题的时候,发现输入框下面都出现了内容,参考gpt输入框下面是不会出现文字的/

@Mira190
Copy link
Contributor

Mira190 commented Sep 27, 2025

image 个人觉得ai助手可以再明显一点,在我电脑显示图标还是有点小,很容易忽略掉,其实这个是很好的功能。要么就通过新手指引来告诉大家有什么功能,要不就优化一下ui,可以参考amazon的?

@Crokily
Copy link
Contributor Author

Crokily commented Sep 27, 2025

image 个人觉得ai助手可以再明显一点,在我电脑显示图标还是有点小,很容易忽略掉,其实这个是很好的功能。要么就通过新手指引来告诉大家有什么功能,要不就优化一下ui,可以参考amazon的?

prompt语言问题:最佳解决方案是站点支持i18n系统,维护一个变量表示当前用户使用的语言,然后在发AI请求的时候把这个变量传进prompt,要求用该语言回答。
不过目前没有i18n系统,所以就先用prompt约束了,要求它用跟问题一致的语言进行回答,但这种方式会有一定的随机性,偶尔会自己变成英语

UI透明和按钮过小的问题也已调整:
04ff9541bdea5681183f682bdb528529

@Mira190
Copy link
Contributor

Mira190 commented Sep 27, 2025

测试完毕,没问题,可以合并

@Mira190 Mira190 merged commit 9e69f37 into InvolutionHell:main Sep 27, 2025
2 of 3 checks passed
@github-project-automation github-project-automation bot moved this to Done in AI Sep 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants