Feature Request: More Flexible Router Block (Multi-Route Selection & Custom System Prompt)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 30/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 冷清
- 技术栈
- typescript
- 领域
- ai
调研方向
No files, tests, or code entry points are named. Start by locating the Router block implementation and its existing single-route behavior, then determine how the requested routing modes, custom prompt, no-match handling, and confidence outputs fit together. Done would require an agreed, backward-compatible scope for these changes.
由索引模型根据 Issue 内容生成。
描述
Problem
The current Router block is useful for AI-powered routing, but it appears to be limited to selecting a single route and relies on a hidden internal system prompt. This makes the block less flexible for advanced workflows and prevents users from adapting the routing behavior to different use cases.
In many real-world scenarios, a single input may legitimately belong to multiple categories. For example:
- A support ticket may involve both Billing and Technical issues.
- User feedback may contain both a Bug Report and Product Feedback.
- A lead may qualify for multiple downstream workflows.
Currently, the Router seems designed around single-route classification, which limits these use cases.
Proposed Improvements
1. Route Selection Mode
Add a configurable routing mode with options such as:
Single Route (Current Behavior)
- Select exactly one best-matching route.
- Backward compatible with existing workflows.
Multiple Routes
- Allow the model to select multiple matching routes.
- Output an array of selected routes instead of a single value.
- Trigger multiple output ports simultaneously.
Example:
Input:
"Billing charges are incorrect and the API is returning errors."
Selected Routes:
- Billing
- Technical
2. Custom System Prompt
Expose the Router's system prompt as an optional advanced setting.
Example use cases:
- Adjust routing strictness.
- Allow multi-label classification.
- Prioritize specific business rules.
- Customize fallback behavior.
- Define confidence thresholds.
- Improve domain-specific routing.
Example:
"You may select multiple routes if the input clearly belongs to more than one category."
or
"Prefer the most specific route instead of the most general route."
This would significantly increase flexibility without affecting users who prefer the default behavior.
3. Configurable No-Match Behavior
Allow users to choose between:
- Route to Error Path
- Force Best Match
- Return Multiple Candidates
- Use Custom Fallback Route
4. Confidence Score Output
Provide an optional confidence score for each routing decision.
Example outputs:
- selectedRoute
- selectedRoutes
- confidence
- reasoning
This would help with debugging and workflow monitoring.
Benefits
- Supports both single-label and multi-label classification.
- Works better for complex enterprise workflows.
- Gives users more control over routing behavior.
- Reduces the need for custom LLM blocks before the Router.
- Makes the Router adaptable to a wider range of use cases.
Summary
The Router block would become significantly more powerful by supporting:
- Single-route and multi-route modes.
- User-configurable system prompts.
- Configurable no-match behavior.
- Confidence score outputs.
These changes would preserve backward compatibility while providing much greater flexibility for advanced workflow design.
- 主要语言
- TypeScript
- 星标
- 29.8k
- 派生
- 3.9k
- 平均合并
- 1 小时 44 分钟
- 30 天内合并 PR
- 841
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
simstudioai/sim 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
simstudioai/sim#9831 ·
维护者通常 1 天内回复
-
v2 API rate limits self-hosted installs by IP even with billing disabled可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 1/5 1 小时以内 新手友好度 75/100
simstudioai/sim#8452 ·
维护者通常 1 天内回复
-
Railway template generates invalid ENCRYPTION_KEY (should be 64-char hex string)可能重新可做 @sahooarnav2007-gif 于 15 天前认领,目前没有进行中的 PR。 未关闭bug
难度 2/5 1-3 小时 新手友好度 72/100
simstudioai/sim#6246 · 3 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
simstudioai/sim#1204 · 8 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
simstudioai/sim#9734 ·
维护者通常 1 天内回复
相似的 Issue
-
Bug: Cloudflare Pages static _redirects identity rule causes RSC Flight to reload as HTML可能已有人在做 @Donvero 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
Mantitup-Org/vista#210 ·
-
status: waiting for maintainer
难度 2/5 1-3 小时 新手友好度 88/100
mui/material-ui#49751 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
diplodoc-platform/transform#1184 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
JonasKruckenberg/imagetools#973 ·
维护者通常 1 天内回复