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

自动引用页面的URL、标题等信息作为问答的背景知识 #23

Closed
6 tasks done
crazygo opened this issue Feb 3, 2024 · 0 comments
Closed
6 tasks done

Comments

@crazygo
Copy link
Contributor

crazygo commented Feb 3, 2024

当在网页内唤起弹窗时,需要给会话自动关联页面的基本信息。不同的页面关联到的信息是不一样的,例如对stackoverflow需要关联问题和回答,对readme需要关联文本等。
这里定一个基础的模式,适用于所有页面。

flowchart LR
A(Command+I) -->B(唤起弹窗)
B --> C{检查支持本站点\n的agent列表}
C -->|站点专用agent| E(获取页面定制化信息)
C -->|无agent| G(获取页面基础信息)
E --> SHOW(显示引用)
G --> SHOW
Loading

从页面中提取基本信息

  • 定义 id=page 的 agent,匹配所有URL
  • 该 agent 获取到的页面信息如下
{
      "agentId":"page",
      "title":"DeepSeek API 手册",
      "url":"https://platform.deepseek.com/docs",
    }

作为对比(不属于本需求),针对 stackoverflow 定制的 agent,获取到的页面信息如下

{
      "agentId":"stackoverflow",
      "title":"What does 'synchronized' mean?",
      "url":"https://stackoverflow.com/questions/1085709/what-does-synchronized-mean",
      "question":"I have some questions regarding the usage and significance of ...",
      "answers":["The synchronized keyword is all about ...", "Well, I think we had enough of theoretical ..."]
    }

在弹窗中展示引用状态

拼接 Prompt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant