Skip to content

Commit afb784c

Browse files
authored
[stable30] fix(TaskProcessingService): TaskProcessing tasktype i/o shapes were broken (#464)
Signed-off-by: Marcel Klehr <[email protected]>
1 parent 77173ce commit afb784c

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

lib/Service/ProvidersAI/TaskProcessingService.php

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -381,19 +381,25 @@ public function getDescription(): string {
381381
}
382382

383383
public function getInputShape(): array {
384-
return array_map(static fn (array $shape) => new ShapeDescriptor(
385-
$shape['name'],
386-
$shape['description'],
387-
EShapeType::from($shape['type']),
388-
), $this->customTaskType['input_shape']);
384+
return array_reduce($this->customTaskType['input_shape'], static function (array $input, array $shape) {
385+
$input[$shape['name']] = new ShapeDescriptor(
386+
$shape['name'],
387+
$shape['description'],
388+
EShapeType::from($shape['shape_type']),
389+
);
390+
return $input;
391+
}, []);
389392
}
390393

391394
public function getOutputShape(): array {
392-
return array_map(static fn (array $shape) => new ShapeDescriptor(
393-
$shape['name'],
394-
$shape['description'],
395-
EShapeType::from($shape['type']),
396-
), $this->customTaskType['output_shape']);
395+
return array_reduce($this->customTaskType['output_shape'], static function (array $output, array $shape) {
396+
$output[$shape['name']] = new ShapeDescriptor(
397+
$shape['name'],
398+
$shape['description'],
399+
EShapeType::from($shape['shape_type']),
400+
);
401+
return $output;
402+
}, []);
397403
}
398404
};
399405
}

0 commit comments

Comments
 (0)