(key: keyof InferenceParams, meta: typeof INFERENCE_PARAM_METADATA[keyof InferenceParams])
| 211 | }; |
| 212 | |
| 213 | const renderStringArrayInput = (key: keyof InferenceParams, meta: typeof INFERENCE_PARAM_METADATA[keyof InferenceParams]) => { |
| 214 | const value = params[key] as string[] | undefined; |
| 215 | const inheritedValue = globalDefaults[key] as string[] | undefined; |
| 216 | const isSet = value !== undefined; |
| 217 | const displayValue = value?.join('\n') ?? ''; |
| 218 | |
| 219 | return ( |
| 220 | <div className="space-y-1"> |
| 221 | <div className="flex items-center justify-between"> |
| 222 | <div className="flex items-center"> |
| 223 | <label className="text-sm font-medium text-gray-700">{meta.label}</label> |
| 224 | <InfoTooltip paramKey={key} description={meta.description} /> |
| 225 | </div> |
| 226 | {isAgentOverride && isSet && ( |
| 227 | <button |
| 228 | onClick={() => clearParam(key)} |
| 229 | className="text-xs text-gray-400 hover:text-gray-600 flex items-center gap-1" |
| 230 | title="Reset to global default" |
| 231 | > |
| 232 | <RotateCcw className="h-3 w-3" /> |
| 233 | </button> |
| 234 | )} |
| 235 | </div> |
| 236 | <textarea |
| 237 | value={displayValue} |
| 238 | onChange={(e) => { |
| 239 | const val = e.target.value.trim(); |
| 240 | if (val === '') { |
| 241 | handleParamChange(key, undefined); |
| 242 | } else { |
| 243 | handleParamChange(key, val.split('\n').map(s => s.trim()).filter(Boolean)); |
| 244 | } |
| 245 | }} |
| 246 | placeholder={isAgentOverride && inheritedValue?.length ? `Inherited: ${inheritedValue.join(', ')}` : 'One per line'} |
| 247 | rows={2} |
| 248 | className={`w-full px-3 py-2 text-sm border rounded-md ${ |
| 249 | isAgentOverride && !isSet ? 'text-gray-400 border-gray-200' : 'border-gray-300' |
| 250 | }`} |
| 251 | /> |
| 252 | </div> |
| 253 | ); |
| 254 | }; |
| 255 | |
| 256 | const renderPasswordInput = (key: keyof InferenceParams, meta: typeof INFERENCE_PARAM_METADATA[keyof InferenceParams]) => { |
| 257 | const value = params[key] as string | undefined; |
no test coverage detected