Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • fix evaluator to handle temperature gracefully like router, was previously complaining about the type of the temp

Type of Change

  • Bug fix

Testing

Tested manually.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Nov 2, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Nov 2, 2025 1:45am

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

Fixed temperature handling in evaluator block to prevent type errors by hardcoding the value to 0.1, matching the router block's approach.

Key Changes:

  • Removed value: () => '0.1' from temperature slider definition in evaluator block, which was returning a string instead of a number
  • Hardcoded temperature: 0.1 in the evaluator handler's provider request, consistent with router handler implementation
  • Removed unused temperature field from router config object for cleaner code

Technical Context:
The evaluator block had a value: () => '0.1' function that returned a string, but the handler expected a number type. This caused type mismatches when inputs.temperature || 0 was used. The router block already handled this correctly by hardcoding the temperature value in the provider request. This fix aligns both blocks to use the same pattern.

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The fix is straightforward and correct - it removes a type mismatch issue by hardcoding temperature to 0.1 (consistent with router implementation). The changes are minimal, well-scoped, and follow existing patterns in the codebase. No logical errors, security issues, or breaking changes introduced.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/blocks/blocks/evaluator.ts 5/5 Removed string return value from temperature slider, allowing it to return proper number type
apps/sim/executor/handlers/evaluator/evaluator-handler.ts 5/5 Hardcoded temperature to 0.1, matching router pattern and avoiding type issues from input
apps/sim/executor/handlers/router/router-handler.ts 5/5 Removed unused temperature from config object for cleaner code

Sequence Diagram

sequenceDiagram
    participant UI as Evaluator Block UI
    participant Handler as EvaluatorBlockHandler
    participant API as Provider API
    
    Note over UI: Temperature slider removed<br/>value: () => '0.1'
    UI->>Handler: execute(block, inputs, context)
    Note over Handler: inputs.temperature could be string<br/>causing type errors
    Handler->>Handler: Create evaluatorConfig<br/>{model, apiKey}
    Handler->>Handler: Process content & metrics
    Handler->>Handler: Build providerRequest<br/>temperature: 0.1 (hardcoded)
    Handler->>API: POST /api/providers
    API-->>Handler: Response with evaluation
    Handler-->>UI: BlockOutput with scores
Loading

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1
Copy link
Collaborator Author

@greptile

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

Fixed type mismatch in evaluator temperature handling by removing string default value and hardcoding numeric constant.

Key Changes:

  • Removed value: () => '0.1' from temperature slider in evaluator.ts that was returning string instead of number
  • Hardcoded temperature: 0.1 in evaluator-handler.ts to match router pattern and ensure correct type
  • Changed content field from short-input to long-input for better UX
  • Enhanced eval-input component with tag dropdown support for variable references and drag-drop functionality
  • Added text overlay rendering to variables-input for improved visibility of references in object/array types

Impact:
The temperature value was previously passed as a string "0.1" to the Provider API, which could cause type errors or unexpected behavior. The fix ensures temperature is consistently passed as a number 0.1, matching the router block implementation.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are well-structured and fix a clear type mismatch bug. The temperature fix follows the established router pattern, the UI enhancements are isolated and follow existing patterns in the codebase, and the author has manually tested the changes
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/blocks/blocks/evaluator.ts 5/5 Removed problematic string default value for temperature field and changed content input from short to long
apps/sim/executor/handlers/evaluator/evaluator-handler.ts 5/5 Hardcoded temperature to 0.1 as number, matching router pattern and fixing type mismatch
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/eval-input.tsx 5/5 Enhanced with tag dropdown support, variable references, and drag-drop functionality for description field

Sequence Diagram

sequenceDiagram
    participant UI as Evaluator Block UI
    participant Config as Block Config
    participant Handler as Evaluator Handler
    participant API as Provider API
    
    Note over Config: Temperature field removed<br/>default value: "0.1" (string)
    
    UI->>Config: User configures evaluator
    Config->>Config: Content type: short-input → long-input
    Config->>Config: Temperature hidden slider (no default)
    
    UI->>Handler: Execute evaluator block
    Note over Handler: inputs.temperature would be<br/>string "0.1" (type error)
    Handler->>Handler: FIX: Hardcode temperature: 0.1 (number)
    Handler->>Handler: Create evaluatorConfig
    
    Handler->>API: POST /api/providers
    Note over API: Request with<br/>temperature: 0.1 (number)
    API-->>Handler: Return evaluation results
    Handler-->>UI: Return output with metrics
Loading

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit 7d67ae3 into staging Nov 2, 2025
9 checks passed
@waleedlatif1 waleedlatif1 deleted the sim-333 branch November 2, 2025 01:52
waleedlatif1 added a commit that referenced this pull request Nov 12, 2025
…outer (#1792)

* fix(evaluator): fix evaluator to handle temperature gracefully like router

* apps/sim

* fix eval-input subblock
@waleedlatif1 waleedlatif1 mentioned this pull request Nov 12, 2025
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants