-
Notifications
You must be signed in to change notification settings - Fork 11
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
Migrate to the new task processing API #102
Conversation
a5d15d0
to
c867b25
Compare
c867b25
to
78e25fb
Compare
d6bc49d
to
064d182
Compare
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
064d182
to
c43200a
Compare
Signed-off-by: Julien Veyssier <[email protected]>
…custom one Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
…t push sensitive values to the frontend Signed-off-by: Julien Veyssier <[email protected]>
5c14209
to
48cd8bd
Compare
throw new RuntimeException('Invalid prompt'); | ||
} | ||
$prompt = $input['input']; | ||
$prompt = 'Extract topics from the following text. Detect the language of the text. Use the same language as the text. Output only the topics. Here is the text:' . "\n\n" . $prompt; |
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.
Ideally the output should be comma separated, so it can be used programmatically.
} | ||
|
||
try { | ||
$completion = $this->openAiAPIService->createChatCompletion($this->userId, $adminModel, $userPrompt, $systemPrompt, $history, 1, $maxTokens); |
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.
Does this take into account the roles? ie. that the role of history[0]
is user
?
$systemPrompt = $input['system_prompt']; | ||
|
||
if (!isset($input['history']) || !is_array($input['history'])) { | ||
throw new RuntimeException('Invalid history'); |
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.
Great to have validation on this!
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.
PHP parts look good!
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
Ready to merge IMO.