Skip to content

Commit

Permalink
refactor(components): 优化模型列表和机器人模型切换功能
Browse files Browse the repository at this point in the history
- 添加模型列表和模型项的样式,提高用户体验
- 实现模型项的选中状态样式,便于用户识别当前选择
- 更新机器人模型切换逻辑,使用 updateTargetSession 方法
  • Loading branch information
softxx committed Nov 20, 2024
1 parent 1633dc0 commit 4a9a898
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
30 changes: 30 additions & 0 deletions app/components/chat.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -751,3 +751,33 @@
}
}
}

.model-list {
display: flex;
flex-wrap: wrap;
}

.model-item {
margin: 10px;
padding: 10px;
border: 1px solid #ccc;
cursor: pointer;
border-radius: 5px;
}

.model-item.selected {
background-color: #007bff;
color: white;
}

.radio-button-robot {
height: 55px;
width: 100%;
font-size: 17px;
line-height: 55px;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-weight: bold;
}
2 changes: 1 addition & 1 deletion app/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ export function ChatActions(props: {
onClick={() => {
//执行切换模型
const [model, providerName] = robotModel.split("@");
chatStore.updateCurrentSession((session) => {
chatStore.updateTargetSession(session,(session) => {
session.mask.modelConfig.model = model as ModelType;
session.mask.modelConfig.providerName =
providerName as ServiceProvider;
Expand Down

0 comments on commit 4a9a898

Please sign in to comment.