Replies: 12 comments 9 replies
-
|
感觉是不是有些部分是langchain的范畴 |
Beta Was this translation helpful? Give feedback.
-
|
感觉会略重,我非常认同 @ONLY-yours 的这个观点 #34 (comment) :
我觉得最适合的切入点是提供 session level 的状态管理 hooks,其他的东西让业务自己来实现(主要是 API 大家都不一样,做 proxy 模式又多绕一层) |
Beta Was this translation helpful? Give feedback.
-
|
按我目前设想的,更新了 Basic Use。 |
Beta Was this translation helpful? Give feedback.
-
|
建议能直接对接 openai sdk,让开发者开箱即用。 |
Beta Was this translation helpful? Give feedback.
-
|
提议👻 |
Beta Was this translation helpful? Give feedback.
-
|
看起来约定的东西比较多,如果是这个支小宝的例子,流程应该是什么样子的? https://usexagent.x-73x.pages.dev/components/use-x-agent-cn#components-use-x-agent-demo-suggestions |
Beta Was this translation helpful? Give feedback.
-
|
应该能基于这套东西直接做一个 https://github.com/langchain-ai/weblangchain 出来。 |
Beta Was this translation helpful? Give feedback.
-
useXChat:
const { chat } = useXChat(agent, {
defaultMessages: `WelcomedInfo(Bubble[role: 'welcome'])`,
requestPlaceholder,
requestFailed,
});
chat(message);useXAgent:
// Open AI,提供一些预设的协议来支持
const openAIAgent = useXAgent({
baseURL,
key,
model: 'gpt-3.5-turbo', // Trigger
});
const sockInstance = setupSocket();
// Customize without streaming
const customAIAgent = useXAgent({
request: (msg, info) => async {
const res = await fetch('/xxxxx', { msg, otherMsgs: info.messages }); // Or sock.send
return await res.json(); // 可以前端转化成 Message Gernic
},
});
// Customize with streaming
const customStreamingAIAgent = useXAgent({
request: (msg, info, onSuccess, onError, onUpdate) => {
// 自行处理三态逻辑,以 suc or err 为终结
}, // 背后是会转成一个 Updater 交给 useXChat 来处理的。
});
// Updater: 一种实现可以支持三态
* suc => insertSucBubble
* fail => inserErrBubble
* info => updateBubbleOrInsertIfNotExistMessageGeneric<Message = string>
// 如果是富态交互卡片类型
type MessageCustom = {
type: 'string' | 'map',
content: 'string' | MapJSON
};
BubbleList => role['ai' | 'map']
map => renderMap |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
在我使用的时候,useXAgent、useXChat、还有Bubble,他们是怎么配合起来,实现一个对话,我还是有点懵。可不可以多加一些例子,或者是文字描述呢? 另外提一个建议给Bubble,ai返回的对话,有的时候不是一个简短的话术,有的时候我看其他厂家已有的大模型,都会包含引用,在每句话的后面,一个小按钮,hover住可以看一下引用自哪里。点一下到对应的链接,是个点击事件。 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
🎯 要做什么?
🧑💻 目标用户是谁?
不仅仅是前端开发者:
🚀 要做成什么样子?
👀 如何去做?
🔎 展开讲讲
关于各个 Tools
关于各个 Runtime Hook
API
XFetch
XStream
XAdapter
useXAgent
useXMemory
useXAction
useXPlan
🏎️ 如何使用
开箱即用
配合原子组件使用
多项建议
📚 相关文献
https://lilianweng.github.io/posts/2023-06-23-agent/
Beta Was this translation helpful? Give feedback.
All reactions