您现在的位置是:首页 > 文章详情

🔥 Solon Ai Flow 编排开发框架发布预告(效果预览)

日期:2025-05-16点击:57

Solon Ai 在推出 Solon Ai Mcp 后,又将推出 Solon Ai Flow。

1、Solon Ai Flow 是个啥?

Solon Ai Flow 是一个智能体编排开发框架。它是框架!不是工具,不是产品(这与市面上流行的工具和产品,有较大差别)。

使用 yaml 格式编排,很像 docker-compose 的观感。

2、发布预告

预计下周(2025年农历小满)发布首个版本。

3、效果预览

  • 简单的聊天智能体
 id: chat_case1 layout: - task: "@TextInput" meta: text: "你好" - task: "@ChatModel" meta: systemPrompt: "你是个聊天助手" stream: false chatConfig: # "@type": "org.noear.solon.ai.chat.ChatConfig" provider: "ollama" model: "qwen2.5:1.5b" apiUrl: "http://127.0.0.1:11434/api/chat" - task: "@TextOutput" 
  • RAG 知识库智能体
 id: rag_case1 layout: - task: "@TextInput" meta: text: "Solon 是谁开发的?" - task: "@EmbeddingModel" meta: embeddingConfig: # "@type": "org.noear.solon.ai.embedding.EmbeddingConfig" provider: "ollama" model: "bge-m3" apiUrl: "http://127.0.0.1:11434/api/embed" - task: "@InMemoryRepository" meta: documentSources: - "https://solon.noear.org/article/about?format=md" splitPipeline: - "org.noear.solon.ai.rag.splitter.RegexTextSplitter" - "org.noear.solon.ai.rag.splitter.TokenSizeTextSplitter" - task: "@ChatModel" meta: systemPrompt: "你是个知识库" stream: false chatConfig: # "@type": "org.noear.solon.ai.chat.ChatConfig" provider: "ollama" model: "qwen2.5:1.5b" apiUrl: "http://127.0.0.1:11434/api/chat" - task: "@TextOutput" 
  • 两个智能体表演相声式吵架(llm 与 llm 讲相声)
 id: pk_case1 layout: - type: "start" - task: "@TextInput" meta: text: "你好" - task: "@ChatModel" id: model_a meta: systemPrompt: "你是一个智能体名字叫“阿飞”。将跟另一个叫“阿紫”的智能体,表演相声式吵架。" stream: false chatSession: "A" chatConfig: # "@type": "org.noear.solon.ai.chat.ChatConfig" provider: "ollama" model: "qwen2.5:1.5b" apiUrl: "http://127.0.0.1:11434/api/chat" - task: "@TextOutput" meta: prefix: "阿飞: " - task: "@ChatModel" id: model_b meta: systemPrompt: "你是一个智能体名字叫“阿紫”。将跟另一个叫“阿飞”的智能体,表演相声式吵架。" stream: false chatSession: "B" chatConfig: # "@type": "org.noear.solon.ai.chat.ChatConfig" provider: "ollama" model: "qwen2.5:1.5b" apiUrl: "http://127.0.0.1:11434/api/chat" - task: "@TextOutput" meta: prefix: "阿紫: " - type: "exclusive" link: - nextId: model_a condition: 'context.counter().incr("demo") < 10' - nextId: end - type: "end" id: "end" 

4、如何运行?

case2, csae3, case4 是用 TextInput,TextOutput 作输出输入。通过流引擎和引上下文,即可运行。

 @SolonTest public class ChatTest { @Inject FlowEngine flowEngine; @Test public void case2() { flowEngine.eval("case2"); } @Test public void case3() { flowEngine.eval("case3"); } @Test public void case4() { flowEngine.eval("case4"); } } 

csae1 则是用 ChatInput 和 ChatOutput 作输入输出(基于 Context.current() 输入和输出),需要正常的 web 聊天场景

 @Controller public class DemoController { @Inject FlowEngine flowEngine; ChatSession chatSession = new ChatSessionDefault(); @Mapping("case1") public void case1() throws Exception { FlowContext flowContext = new FlowContext(); flowContext.put(Attrs.CTX_CHAT_SESSION, chatSession); //传递聊天会话 flowEngine.eval("case1", flowContext); } }
原文链接:https://www.oschina.net/news/350236
关注公众号

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。

持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。

转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。

文章评论

共有0条评论来说两句吧...

文章二维码

扫描即可查看该文章

点击排行

推荐阅读

最新文章