Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ feat: support displaying model description #4503

Closed
wants to merge 2 commits into from

Conversation

mushan0x0
Copy link
Contributor

@mushan0x0 mushan0x0 commented Oct 26, 2024

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • 📝 docs
  • 🔨 chore

🔀 变更说明 | Description of Change

close: #3897

在模型设置的显示

image

在模型选择的显示

image

国际化支持

image

📝 补充信息 | Additional Information

Copy link

vercel bot commented Oct 26, 2024

@mushan0x0 is attempting to deploy a commit to the LobeChat Community Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Oct 26, 2024
@lobehubbot
Copy link
Member

👍 @mushan0x0

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

@dosubot dosubot bot added the 🌠 Feature Request New feature or request | 特性与建议 label Oct 26, 2024
Copy link

codecov bot commented Oct 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.29%. Comparing base (1a5c7ae) to head (803fdcc).
Report is 21 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4503      +/-   ##
==========================================
- Coverage   92.30%   92.29%   -0.01%     
==========================================
  Files         496      496              
  Lines       36207    36194      -13     
  Branches     3440     2178    -1262     
==========================================
- Hits        33420    33407      -13     
  Misses       2787     2787              
Flag Coverage Δ
app 92.29% <ø> (-0.01%) ⬇️
server 97.33% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SAnBlog
Copy link

SAnBlog commented Oct 27, 2024

自定义模型如何显示自定义内容呢?

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


How does a custom model display custom content?

@mushan0x0
Copy link
Contributor Author

自定义模型如何显示自定义内容呢?

自定义显示不了,否则自定义规则就有点复杂了

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


How does a custom model display custom content?

Customization cannot be displayed, otherwise the customization rules would be a bit complicated.

@arvinxx
Copy link
Contributor

arvinxx commented Oct 28, 2024

@mushan0x0 这个样式不是我预期的。之前是计划准备做成类似这样的:

image

@mushan0x0
Copy link
Contributor Author

@mushan0x0 这个样式不是我预期的。之前是计划准备做成类似这样的:

image

那到时候应该这个组件都会重构掉吧,要不合了先过渡?或者直接关了这个 PR 吧

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@mushan0x0 This style is not what I expected. Previously, the plan was to make it look like this:

image

Then this component should be refactored by then. How about transitioning first? Or just close this PR.

@arvinxx
Copy link
Contributor

arvinxx commented Oct 28, 2024

那到时候应该这个组件都会重构掉吧,要不合了先过渡?或者直接关了这个 PR 吧

不会啊,只要单个 RenderItem 外层包一个 Popup ,然后里面写个自定义组件就好了,不需要重构。 如果要合的话,你可以改成 RenderItem 包一个 Tooltip ,然后在右侧展示文本,这样一来倒是渐进式的方案。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Then this component should be refactored by then. How about transitioning first? Or just close this PR.

No, as long as a single RenderItem wraps a Popup in the outer layer, and then writes a custom component inside, there is no need to refactor. If you want to combine it, you can change RenderItem to include a Tooltip, and then display the text on the right side. This is a progressive solution.

@mushan0x0
Copy link
Contributor Author

不会啊,只要单个 RenderItem 外层包一个 Popup ,然后里面写个自定义组件就好了,不需要重构。 如果要合的话,你可以改成 RenderItem 包一个 Tooltip ,然后在右侧展示文本,这样一来倒是渐进式的方案。

https://github.com/lobehub/lobe-chat/pull/4503/files#diff-6463c8191b7210b5b255fb32837c723b05aedeb63fb181ea9f1a09d57275f3b7R108-R118 这一块逻辑抽为 RenderItem 吗,是的话那我后面改一下

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


No, as long as a single RenderItem is wrapped in a Popup and then a custom component is written inside, there is no need to refactor. If you want to combine it, you can change RenderItem to include a Tooltip, and then display the text on the right side. This is a progressive solution.

https://github.com/lobehub/lobe-chat/pull/4503/files#diff-6463c8191b7210b5b255fb32837c723b05aedeb63fb181ea9f1a09d57275f3b7R108-R118 Is this logic extracted as RenderItem? If so, I will change it later.

@mushan0x0
Copy link
Contributor Author

不会啊,只要单个 RenderItem 外层包一个 Popup ,然后里面写个自定义组件就好了,不需要重构。 如果要合的话,你可以改成 RenderItem 包一个 Tooltip ,然后在右侧展示文本,这样一来倒是渐进式的方案。

https://github.com/lobehub/lobe-chat/pull/4503/files#diff-6463c8191b7210b5b255fb32837c723b05aedeb63fb181ea9f1a09d57275f3b7R145 这个不就是 RenderItem 嘛,后面升级直接改这个就行了

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


No, as long as a single RenderItem is wrapped in a Popup and then a custom component is written inside, there is no need to refactor. If you want to combine it, you can change RenderItem to include a Tooltip, and then display the text on the right side. This is a progressive solution.

https://github.com/lobehub/lobe-chat/pull/4503/files#diff-6463c8191b7210b5b255fb32837c723b05aedeb63fb181ea9f1a09d57275f3b7R145 Isn’t this just RenderItem? You can just change this when you upgrade later.

@arvinxx
Copy link
Contributor

arvinxx commented Oct 28, 2024

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


What I mean is to change it in this area instead of putting it in ModelInfoTags.

https://github.com/lobehub/lobe-chat/pull/4503/files#diff-6463c8191b7210b5b255fb32837c723b05aedeb63fb181ea9f1a09d57275f3b7R145

@SAnBlog
Copy link

SAnBlog commented Oct 28, 2024

@mushan0x0 这个样式不是我预期的。之前是计划准备做成类似这样的:

image

噢,这个效果简直棒极了

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@mushan0x0 This style is not what I expected. It was previously planned to be something like this:

image

Oh, this effect is amazing

@mushan0x0
Copy link
Contributor Author

我的意思就是改在这一块,而不是放到 ModelInfoTags 里

https://github.com/lobehub/lobe-chat/pull/4503/files#diff-6463c8191b7210b5b255fb32837c723b05aedeb63fb181ea9f1a09d57275f3b7R145

等你正式实现的时候你就可以改 ModelItemRender 吧,因为现在是复用的是 ModelInfoTags 的代码,过渡的话是不是就这样就行了,这一段代码都是类似的 https://github.com/lobehub/lobe-chat/pull/4503/files#diff-6463c8191b7210b5b255fb32837c723b05aedeb63fb181ea9f1a09d57275f3b7R86-R119 ,放在 ModelItemRender 有些别扭,而且 ModelInfoTags 也是别的地方通用的组件,这样就都有这个详情展示了

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


What I mean is to change it in this area instead of putting it in ModelInfoTags

https://github.com/lobehub/lobe-chat/pull/4503/files#diff-6463c8191b7210b5b255fb32837c723b05aedeb63fb181ea9f1a09d57275f3b7R145

When you officially implement it, you can change the ModelItemRender, because now the code of ModelInfoTags is reused. If you want to make the transition, just leave it like this. This piece of code is similar https://github.com/lobehub/ lobe-chat/pull/4503/files#diff-6463c8191b7210b5b255fb32837c723b05aedeb63fb181ea9f1a09d57275f3b7R86-R119, it is a bit awkward to put it in ModelItemRender, and ModelInfoTags is also a common component in other places, so this detail is displayed Got it

@arvinxx
Copy link
Contributor

arvinxx commented Oct 28, 2024

这个展示不符合我的预期,后续准备把 cache、video、files 都作为模型能力的 tag 进行展示的,info 那个图标太占位置了。

另外我不觉得应该在配置模型那边加 info。对话那边加是合理的,因为用户第一次来不一定知道不同模型的能力差异,但是在设置里面是不需要的,因为只有进阶一些的用户才会去那边做配置,这个时候再展示这个信息反而是个操作干扰项。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


This display does not meet my expectations. I plan to display cache, video, and files as model capabilities in the future. The info icon takes up too much space.

In addition, I don’t think you should add info to the configuration model. It is reasonable to add it in the dialogue, because the user may not know the difference in capabilities of different models for the first time, but it is not needed in the settings, because only more advanced users will go there to do the configuration. At this time, it is not necessary Displaying this information is an operational distraction.

@mushan0x0 mushan0x0 closed this Oct 28, 2024
@mushan0x0 mushan0x0 deleted the feat/model_tag branch October 28, 2024 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌠 Feature Request New feature or request | 特性与建议 size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Request] 模型选择列表,当鼠标在模型上停留的时候可否显示描述提示?
4 participants