Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(TaskProcessingService): Custom task type i/o shapes were broken #463

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 getInputShape(): array {
return array_map(static fn (array $shape) => new ShapeDescriptor(
$shape['name'],
$shape['description'],
EShapeType::from($shape['shape_type']),
), $this->customTaskType['input_shape']);
return array_reduce($this->customTaskType['input_shape'], static function (array $input, array $shape) => {

Check failure on line 384 in lib/Service/ProvidersAI/TaskProcessingService.php

View workflow job for this annotation

GitHub Actions / php-psalm-analysis (8.1)

ParseError

lib/Service/ProvidersAI/TaskProcessingService.php:384:108: ParseError: Syntax error, unexpected T_DOUBLE_ARROW, expecting '{' on line 384 (see https://psalm.dev/173)
$input[$shape['name']] = new ShapeDescriptor(
$shape['name'],
$shape['description'],
EShapeType::from($shape['shape_type']),
);
return $input;
}, []);

Check failure on line 391 in lib/Service/ProvidersAI/TaskProcessingService.php

View workflow job for this annotation

GitHub Actions / php-psalm-analysis (8.1)

ParseError

lib/Service/ProvidersAI/TaskProcessingService.php:391:6: ParseError: Syntax error, unexpected ',' on line 391 (see https://psalm.dev/173)
}

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

Check failure on line 395 in lib/Service/ProvidersAI/TaskProcessingService.php

View workflow job for this annotation

GitHub Actions / php-psalm-analysis (8.1)

ParseError

lib/Service/ProvidersAI/TaskProcessingService.php:395:110: ParseError: Syntax error, unexpected T_DOUBLE_ARROW, expecting '{' on line 395 (see https://psalm.dev/173)
$output[$shape['name']] = new ShapeDescriptor(
$shape['name'],
$shape['description'],
EShapeType::from($shape['shape_type']),
);
return $output;
}, []);

Check failure on line 402 in lib/Service/ProvidersAI/TaskProcessingService.php

View workflow job for this annotation

GitHub Actions / php-psalm-analysis (8.1)

ParseError

lib/Service/ProvidersAI/TaskProcessingService.php:402:6: ParseError: Syntax error, unexpected ',' on line 402 (see https://psalm.dev/173)
}
};
}
Expand Down
Loading