File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ function generateImage($data): Prompt {
36
36
37
37
private function savePrompt ($ result , $ data ): Prompt {
38
38
$ prompt = new Prompt ([
39
- 'prompt_text ' => $ data ['prompt ' ],
39
+ 'prompt_text ' => array_key_exists ( ' prompt ' ) ?? $ data ['prompt ' ] : $ data [ ' messages ' ],
40
40
'data ' => $ result
41
41
]);
42
42
return $ prompt ;
Original file line number Diff line number Diff line change
1
+
2
+
3
+ curl -X POST http://localhost/api/generate-result -H " Content-Type: application/json" --data-binary @- << DATA
4
+ {
5
+ "type": "chat",
6
+ "model":"gpt-3.5-turbo",
7
+ "messages":[
8
+ {"role": "system", "content": "You are a helpful assistant."},
9
+ {"role": "user", "content": "Generate a press release for music artist Mastashake"}
10
+
11
+ ]
12
+ }
13
+ DATA
You can’t perform that action at this time.
0 commit comments