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

Migrate to the new task processing API #102

Merged
merged 22 commits into from
Jul 17, 2024
Merged

Migrate to the new task processing API #102

merged 22 commits into from
Jul 17, 2024

Conversation

julien-nc
Copy link
Member

@julien-nc julien-nc commented May 29, 2024

  • Migrate free prompt
  • Migrate summarize
  • Migrate headline
  • Create topics
  • Migrate image generation
  • Migrate speech to text
  • Implement a provider for the new ContextWrite task type
  • Implement a provider for the new Chat task type

Ready to merge IMO.

@julien-nc julien-nc force-pushed the enh/task-processing branch 3 times, most recently from a5d15d0 to c867b25 Compare May 29, 2024 16:22
@julien-nc julien-nc force-pushed the enh/task-processing branch from c867b25 to 78e25fb Compare June 15, 2024 13:47
@julien-nc julien-nc force-pushed the enh/task-processing branch 2 times, most recently from d6bc49d to 064d182 Compare June 24, 2024 15:10
julien-nc added 13 commits July 1, 2024 10:38
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]>
@julien-nc julien-nc force-pushed the enh/task-processing branch from 064d182 to c43200a Compare July 1, 2024 08:41
julien-nc added 6 commits July 3, 2024 16:56
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
@julien-nc julien-nc marked this pull request as ready for review July 15, 2024 12:50
@julien-nc julien-nc added enhancement New feature or request 3. to review labels Jul 15, 2024
…t push sensitive values to the frontend

Signed-off-by: Julien Veyssier <[email protected]>
@julien-nc julien-nc force-pushed the enh/task-processing branch from 5c14209 to 48cd8bd Compare July 16, 2024 09:28
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;
Copy link
Member

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);
Copy link
Member

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');
Copy link
Member

@marcelklehr marcelklehr Jul 17, 2024

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!

Copy link
Member

@marcelklehr marcelklehr left a 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!

@julien-nc julien-nc merged commit a338ed2 into main Jul 17, 2024
7 checks passed
@julien-nc julien-nc mentioned this pull request Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants