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(core): support ai network search #9357

Merged
merged 1 commit into from
Jan 9, 2025
Merged

Conversation

akumatus
Copy link
Member

@akumatus akumatus commented Dec 27, 2024

What Changed?

  • Add PerplexityProvider in backend.
  • Update session prompt name if user toggle network search mode in chat panel.
  • Add experimental flag for AI network search feature.
  • Add unit tests and e2e tests.

Search results are streamed and appear word for word:

🎥 Video uploaded on Graphite:

Click the little globe icon to manually turn on/off Internet search:

🎥 Video uploaded on Graphite:

When there is an image, it will automatically switch to the openai model:

🎥 Video uploaded on Graphite:

Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added mod:i18n Related to i18n app:server test Related to test cases app:core labels Dec 27, 2024
@akumatus akumatus force-pushed the feat/ai-network-search branch from 8b6330c to f3279d2 Compare December 27, 2024 10:42
@akumatus akumatus marked this pull request as ready for review December 27, 2024 10:42
@akumatus akumatus requested a review from a team as a code owner December 27, 2024 10:42
@graphite-app graphite-app bot requested review from JimmFly, Brooooooklyn, darkskygit, forehalo, CatsJuice, EYHN and pengx17 and removed request for forehalo and darkskygit December 27, 2024 10:42
@akumatus akumatus force-pushed the feat/ai-network-search branch from f3279d2 to 2cf72f7 Compare January 6, 2025 07:17
Copy link

codecov bot commented Jan 6, 2025

Codecov Report

Attention: Patch coverage is 67.86427% with 161 lines in your changes missing coverage. Please review.

Project coverage is 52.96%. Comparing base (4f10457) to head (58ce865).
Report is 1 commits behind head on canary.

Files with missing lines Patch % Lines
...server/src/plugins/copilot/providers/perplexity.ts 67.07% 107 Missing ⚠️
...ocksuite/presets/ai/chat-panel/chat-panel-input.ts 0.00% 25 Missing ⚠️
...t-block/widgets/ai-panel/components/state/input.ts 16.66% 10 Missing ⚠️
...e/src/modules/ai-button/services/network-search.ts 11.11% 8 Missing ⚠️
...ages/backend/server/src/plugins/copilot/session.ts 87.50% 5 Missing ⚠️
...ges/backend/server/src/plugins/copilot/resolver.ts 90.90% 4 Missing ⚠️
...rontend/core/src/blocksuite/presets/ai/ai-panel.ts 0.00% 1 Missing ⚠️
...core/src/blocksuite/presets/ai/chat-panel/index.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           canary    #9357       +/-   ##
===========================================
+ Coverage   41.77%   52.96%   +11.19%     
===========================================
  Files        1932     2178      +246     
  Lines       68105    98069    +29964     
  Branches    14838    16695     +1857     
===========================================
+ Hits        28450    51946    +23496     
- Misses      38268    44695     +6427     
- Partials     1387     1428       +41     
Flag Coverage Δ
server-test 78.53% <74.33%> (?)
unittest 32.32% <8.16%> (-0.07%) ⬇️

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.

@akumatus akumatus requested review from darkskygit and removed request for JimmFly and CatsJuice January 6, 2025 09:14
@akumatus akumatus force-pushed the feat/ai-network-search branch 8 times, most recently from 045618f to b765c44 Compare January 7, 2025 10:34
@akumatus akumatus requested review from EYHN and removed request for EYHN January 7, 2025 10:49
@akumatus akumatus force-pushed the feat/ai-network-search branch 4 times, most recently from b09f519 to 75cc035 Compare January 8, 2025 04:14
@akumatus akumatus force-pushed the feat/ai-network-search branch from 8c9134e to 0b95336 Compare January 8, 2025 11:46
Copy link

graphite-app bot commented Jan 9, 2025

Merge activity

### What Changed?
- Add `PerplexityProvider` in backend.
- Update session prompt name if user toggle network search mode in chat panel.
- Add experimental flag for AI network search feature.
- Add unit tests and e2e tests.

Search results are streamed and appear word for word:

<div class='graphite__hidden'>
          <div>🎥 Video uploaded on Graphite:</div>
            <a href="https://app.graphite.dev/media/video/sJGviKxfE3Ap685cl5bj/56f6ec7b-4b21-405f-9612-43e083f6fb84.mov">
              <img src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/sJGviKxfE3Ap685cl5bj/56f6ec7b-4b21-405f-9612-43e083f6fb84.mov">
            </a>
          </div>
<video src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/sJGviKxfE3Ap685cl5bj/56f6ec7b-4b21-405f-9612-43e083f6fb84.mov">录屏2024-12-27 18.58.40.mov</video>

Click the little globe icon to manually turn on/off Internet search:
<div class='graphite__hidden'>
          <div>🎥 Video uploaded on Graphite:</div>
            <a href="https://app.graphite.dev/media/video/sJGviKxfE3Ap685cl5bj/778f1406-bf29-498e-a90d-7dad813392d1.mov">
              <img src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/sJGviKxfE3Ap685cl5bj/778f1406-bf29-498e-a90d-7dad813392d1.mov">
            </a>
          </div>
<video src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/sJGviKxfE3Ap685cl5bj/778f1406-bf29-498e-a90d-7dad813392d1.mov">录屏2024-12-27 19.01.16.mov</video>

When there is an image, it will automatically switch to the openai model:

<div class='graphite__hidden'>
          <div>🎥 Video uploaded on Graphite:</div>
            <a href="https://app.graphite.dev/media/video/sJGviKxfE3Ap685cl5bj/56431d8e-75e1-4d84-ab4a-b6636042cc6a.mov">
              <img src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/sJGviKxfE3Ap685cl5bj/56431d8e-75e1-4d84-ab4a-b6636042cc6a.mov">
            </a>
          </div>
<video src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/sJGviKxfE3Ap685cl5bj/56431d8e-75e1-4d84-ab4a-b6636042cc6a.mov">录屏2024-12-27 19.02.13.mov</video>
@akumatus akumatus force-pushed the feat/ai-network-search branch from 0b95336 to 58ce865 Compare January 9, 2025 04:01
@graphite-app graphite-app bot merged commit 58ce865 into canary Jan 9, 2025
61 checks passed
@graphite-app graphite-app bot deleted the feat/ai-network-search branch January 9, 2025 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app:core app:server mod:i18n Related to i18n test Related to test cases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants