Skip to content

Commit

Permalink
[stable30] fix(TaskProcessingService): TaskProcessing tasktype i/o sh…
Browse files Browse the repository at this point in the history
…apes were broken (#464)

Signed-off-by: Marcel Klehr <[email protected]>
  • Loading branch information
marcelklehr authored Dec 23, 2024
1 parent 77173ce commit afb784c
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions lib/Service/ProvidersAI/TaskProcessingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,19 +381,25 @@ public function getDescription(): string {
}

public function getInputShape(): array {
return array_map(static fn (array $shape) => new ShapeDescriptor(
$shape['name'],
$shape['description'],
EShapeType::from($shape['type']),
), $this->customTaskType['input_shape']);
return array_reduce($this->customTaskType['input_shape'], static function (array $input, array $shape) {
$input[$shape['name']] = new ShapeDescriptor(
$shape['name'],
$shape['description'],
EShapeType::from($shape['shape_type']),
);
return $input;
}, []);
}

public function getOutputShape(): array {
return array_map(static fn (array $shape) => new ShapeDescriptor(
$shape['name'],
$shape['description'],
EShapeType::from($shape['type']),
), $this->customTaskType['output_shape']);
return array_reduce($this->customTaskType['output_shape'], static function (array $output, array $shape) {
$output[$shape['name']] = new ShapeDescriptor(
$shape['name'],
$shape['description'],
EShapeType::from($shape['shape_type']),
);
return $output;
}, []);
}
};
}
Expand Down

0 comments on commit afb784c

Please sign in to comment.