Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Rann Graphic Design Website
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sofiane Lasri
Rann Graphic Design Website
Commits
02013808
Verified
Commit
02013808
authored
4 months ago
by
Sofiane Lasri
Browse files
Options
Downloads
Patches
Plain Diff
comments
parent
e28721f3
Branches
Branches containing commit
No related tags found
1 merge request
!63
Resolve "Ajouter traduction Anglaise par IA"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/Services/AiProviderService.php
+8
-0
8 additions, 0 deletions
app/Services/AiProviderService.php
with
8 additions
and
0 deletions
app/Services/AiProviderService.php
+
8
−
0
View file @
02013808
...
...
@@ -16,6 +16,7 @@ class AiProviderService
*
* @param string $systemRole The system role to send to the AI provider. E.g. "You are a helpful assistant."
* @param string $prompt The prompt to send to the AI provider
* @param UploadedPicture ...$pictures The pictures to send to the AI provider
* @return array The response from the AI provider.
*/
public
function
promptWithPictures
(
string
$systemRole
,
string
$prompt
,
UploadedPicture
...
$pictures
):
array
...
...
@@ -85,6 +86,13 @@ public function promptWithPictures(string $systemRole, string $prompt, UploadedP
return
$this
->
callApi
(
config
(
'ai-provider.providers.'
.
$selectedProvider
.
'.url'
),
$requestBody
);
}
/**
* Prompt the AI provider with a text
*
* @param string $systemRole The system role to send to the AI provider. E.g. "You are a helpful assistant."
* @param string $prompt The prompt to send to the AI provider
* @return array The response from the AI provider.
*/
public
function
prompt
(
string
$systemRole
,
string
$prompt
):
array
{
$selectedProvider
=
config
(
'ai-provider.selected-provider'
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment