-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[Task processing] Fix preferred providers #47177
[Task processing] Fix preferred providers #47177
Conversation
…, fix task type values according to preferred provider Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
@@ -43,7 +48,7 @@ | |||
public function boot(IBootContext $context): void { | |||
$server = $context->getServerContainer(); | |||
$config = $server->getConfig(); | |||
if ($config->getAppValue('testing', 'enable_alt_user_backend', 'no') === 'yes') { | |||
if ($config->getAppValue(self::APP_ID, 'enable_alt_user_backend', 'no') === 'yes') { |
Check notice
Code scanning / Psalm
DeprecatedMethod Note test
} | ||
|
||
return [ | ||
'output' => 'This is a fake result: ' . "\n\n- Prompt: " . $prompt . "\n- Model: " . $model . "\n- Maximum number of words: " . $maxTokens, |
Check notice
Code scanning / Psalm
PossiblyNullOperand Note test
164dcf6
to
eb48853
Compare
Do we have documentation on what "Preferred Provider" is? What will be its purpose after this PR? Application Application It was removed or disabled. Shouldn't application I just thought that "Preferred Provider" is a priority, that you can always choose the provider that has the highest priority and will always be chosen if it is available - but apparently I am confused. |
@bigcat88 So IMO it works fine in both things that were fixed:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for explanations
|
||
$coreLanguages = $this->getCoreLanguagesByCode(); | ||
|
||
$toLanguage = $coreLanguages[$input['target_language']] ?? $input['target_language']; |
Check notice
Code scanning / Psalm
PossiblyInvalidArrayOffset Note test
|
||
$toLanguage = $coreLanguages[$input['target_language']] ?? $input['target_language']; | ||
if ($input['origin_language'] !== 'detect_language') { | ||
$fromLanguage = $coreLanguages[$input['origin_language']] ?? $input['origin_language']; |
Check notice
Code scanning / Psalm
PossiblyInvalidArrayOffset Note test
$prompt = 'Fake Translation to ' . $toLanguage . ': ' . $inputText; | ||
} | ||
|
||
$fakeResult = $prompt . "\n\nModel: " . $model . "\nMax tokens: " . $maxTokens; |
Check notice
Code scanning / Psalm
PossiblyNullOperand Note test
93689e2
to
d3fe116
Compare
…ribe and translate providers in the testing app Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
d3fe116
to
475d008
Compare
The first available provider is selected when running a sync task and when populating the available task type values (optional shapes, enum values etc...).
IManager:getAvailableTaskTypes()
: Use the preferred provider to extend task type values@marcelklehr Should something be fixed for async workers (when exApps are getting a task via the API)?