mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-10 07:27:57 -05:00
Fix: agent temperature
This commit is contained in:
@@ -16,13 +16,13 @@ export function SliderInput({
|
||||
blockId,
|
||||
subBlockId,
|
||||
}: SliderInputProps) {
|
||||
const [value, setValue] = useSubBlockValue(blockId, subBlockId)
|
||||
const [value, setValue] = useSubBlockValue<number>(blockId, subBlockId)
|
||||
const sliderValue = value ?? defaultValue
|
||||
|
||||
return (
|
||||
<div className="relative pt-2 pb-6">
|
||||
<Slider
|
||||
value={[Number(sliderValue)]}
|
||||
value={[sliderValue]}
|
||||
min={min}
|
||||
max={max}
|
||||
step={0.1}
|
||||
|
||||
@@ -57,7 +57,7 @@ export const AgentBlock: BlockConfig<AgentResponse> = {
|
||||
type: 'slider',
|
||||
layout: 'half',
|
||||
min: 0,
|
||||
max: 2,
|
||||
max: 1,
|
||||
},
|
||||
{
|
||||
id: 'apiKey',
|
||||
|
||||
@@ -38,11 +38,14 @@ export const useWorkflowStore = create<WorkflowStoreWithHistory>()(
|
||||
const block = state.blocks[blockId]
|
||||
if (!block) return state
|
||||
|
||||
// Handle different value types appropriately
|
||||
const processedValue = Array.isArray(value)
|
||||
? value
|
||||
: typeof value === 'string'
|
||||
? value
|
||||
: JSON.stringify(value, null, 2)
|
||||
: block.subBlocks[subBlockId]?.type === 'slider'
|
||||
? Number(value) // Convert slider values to numbers
|
||||
: typeof value === 'string'
|
||||
? value
|
||||
: JSON.stringify(value, null, 2)
|
||||
|
||||
// Only attempt JSON parsing for agent responseFormat validation
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user