Skip to content

Commit

Permalink
Merge branch 'stable30' into backport/473/stable30
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey18106 authored Dec 23, 2024
2 parents f7e2859 + afb784c commit a8d50de
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 a8d50de

Please sign in to comment.