Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions apps/sim/components/ui/tag-dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,23 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({

let blockTags: string[]

if (responseFormat) {
// Special handling for evaluator blocks
if (sourceBlock.type === 'evaluator') {
// Get the evaluation metrics for the evaluator block
const metricsValue = useSubBlockStore.getState().getValue(activeSourceBlockId, 'metrics')

if (metricsValue && Array.isArray(metricsValue) && metricsValue.length > 0) {
// Use the metric names as the available outputs
const validMetrics = metricsValue.filter((metric: any) => metric?.name)
Comment thread
waleedlatif1 marked this conversation as resolved.
blockTags = validMetrics.map(
(metric: any) => `${normalizedBlockName}.${metric.name.toLowerCase()}`
)
} else {
// Fallback to default evaluator outputs if no metrics are defined
const outputPaths = generateOutputPaths(blockConfig.outputs)
blockTags = outputPaths.map((path) => `${normalizedBlockName}.${path}`)
}
} else if (responseFormat) {
// Use custom schema properties if response format is specified
const schemaFields = extractFieldsFromSchema(responseFormat)
if (schemaFields.length > 0) {
Expand Down Expand Up @@ -430,7 +446,23 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({

let blockTags: string[]

if (responseFormat) {
// Special handling for evaluator blocks
if (accessibleBlock.type === 'evaluator') {
// Get the evaluation metrics for the evaluator block
const metricsValue = useSubBlockStore.getState().getValue(accessibleBlockId, 'metrics')

if (metricsValue && Array.isArray(metricsValue) && metricsValue.length > 0) {
// Use the metric names as the available outputs
const validMetrics = metricsValue.filter((metric: any) => metric?.name)
blockTags = validMetrics.map(
(metric: any) => `${normalizedBlockName}.${metric.name.toLowerCase()}`
)
} else {
// Fallback to default evaluator outputs if no metrics are defined
const outputPaths = generateOutputPaths(blockConfig.outputs)
blockTags = outputPaths.map((path) => `${normalizedBlockName}.${path}`)
}
} else if (responseFormat) {
// Use custom schema properties if response format is specified
const schemaFields = extractFieldsFromSchema(responseFormat)
if (schemaFields.length > 0) {
Expand Down