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

refactor: chat invoke & chat api #3630

Merged
merged 10 commits into from
May 9, 2024
Merged

refactor: chat invoke & chat api #3630

merged 10 commits into from
May 9, 2024

Conversation

Ricbet
Copy link
Member

@Ricbet Ricbet commented May 8, 2024

Types

  • 🪚 Refactors

Background or solution

重构 Chat 模块以及 Chat 相关的后端接口定义

  1. 将“默认对话”与 agent chat 整合,现在只会存在 agent chat
  2. 初始会有一个以 Default_Chat_Agent_ 开头的唯一 id,承载之前“默认对话”的能力,见 chat-proxy.service.ts
  3. Default_Chat_Agent 用户不感知,所以不会出现在 @ 符号的 agent 列表里
  4. 调整流式对话内容的前后端交互方式,现在后端能直接返回一个 ChatReadableStream,直接往 ChatReadableStream 推送消息即可,删除了原先 this.client.onmessage 的调用方式
  5. 调整 IAIBackService 接口的 requestStream 方法定义,现在需要返回一个 ChatReadableStream

Changelog

@Ricbet Ricbet requested review from erha19 and bytemain May 8, 2024 08:20
@Ricbet Ricbet self-assigned this May 8, 2024
Copy link

railway-app bot commented May 8, 2024

This PR was not deployed automatically as @Ricbet does not have access to the Railway project.

In order to get automatic PR deploys, please add @Ricbet to the project inside the project settings page.

@opensumi opensumi bot added the ⚙️ refactor Refactor code label May 8, 2024
@Ricbet Ricbet force-pushed the refactor/chat-invoke branch 2 times, most recently from be43edb to 0c52f24 Compare May 9, 2024 06:11
Copy link

codecov bot commented May 9, 2024

Codecov Report

Attention: Patch coverage is 17.34694% with 81 lines in your changes are missing coverage. Please review.

Project coverage is 56.10%. Comparing base (6e5234e) to head (0994254).
Report is 3 commits behind head on main.

Files Patch % Lines
...s/ai-native/src/browser/chat/chat-proxy.service.ts 0.00% 40 Missing and 3 partials ⚠️
...ai-native/src/browser/model/msg-history-manager.ts 0.00% 7 Missing ⚠️
...native/src/browser/chat/chat-agent.view.service.ts 0.00% 6 Missing ⚠️
...ges/ai-native/src/browser/chat/chat.api.service.ts 0.00% 6 Missing ⚠️
...kages/core-node/src/ai-native/base-back.service.ts 37.50% 5 Missing ⚠️
...i-native/src/browser/chat/chat.feature.registry.ts 0.00% 3 Missing and 1 partial ⚠️
...ai-native/src/browser/chat/chat-manager.service.ts 0.00% 2 Missing ⚠️
packages/ai-native/src/browser/chat/chat-model.ts 75.00% 2 Missing ⚠️
...i-native/src/browser/chat/chat.internal.service.ts 0.00% 2 Missing ⚠️
packages/ai-native/src/browser/index.ts 0.00% 2 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3630      +/-   ##
==========================================
- Coverage   56.10%   56.10%   -0.01%     
==========================================
  Files        1513     1514       +1     
  Lines       91785    91834      +49     
  Branches    18818    18817       -1     
==========================================
+ Hits        51498    51521      +23     
- Misses      33410    33437      +27     
+ Partials     6877     6876       -1     
Flag Coverage Δ
jsdom 51.52% <16.32%> (-0.01%) ⬇️
node 15.65% <7.14%> (-0.01%) ⬇️

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.

@Ricbet Ricbet changed the title WIP: refactor: chat invoke refactor: chat invoke & chat api May 9, 2024
@Ricbet Ricbet requested a review from winjo May 9, 2024 09:41
Copy link
Member

@erha19 erha19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@erha19 erha19 merged commit c0f2621 into main May 9, 2024
11 checks passed
@erha19 erha19 deleted the refactor/chat-invoke branch May 9, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚙️ refactor Refactor code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants