File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
src/Services/DataTransferObjects Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -43,11 +43,11 @@ OPENAI_API_KEY=sk-*
43
43
* Models
44
44
* [ List models] ( https://platform.openai.com/docs/api-reference/models/list )
45
45
* [ Retrieve model] ( https://platform.openai.com/docs/api-reference/models/retrieve )
46
-
46
+ * Images
47
+ * [ Create image] ( https://platform.openai.com/docs/api-reference/images/create )
47
48
48
49
#### Coming soon:
49
50
* Images
50
- * Create image
51
51
* Create image edit
52
52
* Audio
53
53
* Create transcription
@@ -79,6 +79,21 @@ $result->getChoices(); // Choices from OpenAI.
79
79
80
80
```
81
81
82
+ #### Create image:
83
+
84
+ ``` php
85
+ $openAI = $this->container->make(\Itsimiro\OpenAI\Services\OpenAI::class);
86
+
87
+
88
+ $result = $openAI->getDalle()->createImage(new CreateImageParameters(
89
+ 'dog with a bone',
90
+ 2,
91
+ responseFormat: ImageResponseFormatEnum::URL
92
+ ));
93
+
94
+ $result->getImages(); // Generated images
95
+ ```
96
+
82
97
#### See the [ documentation] ( https://platform.openai.com/docs/api-reference ) for more details on using OpenAI.
83
98
84
99
## Testing
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public function __construct(
13
13
public int $ imageCount = 1 ,
14
14
public ImageSizeEnum $ size = ImageSizeEnum::LARGE ,
15
15
public ImageResponseFormatEnum $ responseFormat = ImageResponseFormatEnum::URL ,
16
- public ? string $ user = null
16
+ public string $ user = ''
17
17
)
18
18
{}
19
19
You can’t perform that action at this time.
0 commit comments