Skip to content

Commit

Permalink
Update readme & codefix
Browse files Browse the repository at this point in the history
  • Loading branch information
miroslav committed Aug 15, 2023
1 parent 103ef43 commit 694fa42
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ OPENAI_API_KEY=sk-*
* Models
* [List models](https://platform.openai.com/docs/api-reference/models/list)
* [Retrieve model](https://platform.openai.com/docs/api-reference/models/retrieve)

* Images
* [Create image](https://platform.openai.com/docs/api-reference/images/create)

#### Coming soon:
* Images
* Create image
* Create image edit
* Audio
* Create transcription
Expand Down Expand Up @@ -79,6 +79,21 @@ $result->getChoices(); // Choices from OpenAI.

```

#### Create image:

```php
$openAI = $this->container->make(\Itsimiro\OpenAI\Services\OpenAI::class);


$result = $openAI->getDalle()->createImage(new CreateImageParameters(
'dog with a bone',
2,
responseFormat: ImageResponseFormatEnum::URL
));

$result->getImages(); // Generated images
```

#### See the [documentation](https://platform.openai.com/docs/api-reference) for more details on using OpenAI.

## Testing
Expand Down
2 changes: 1 addition & 1 deletion src/Services/DataTransferObjects/CreateImageParameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function __construct(
public int $imageCount = 1,
public ImageSizeEnum $size = ImageSizeEnum::LARGE,
public ImageResponseFormatEnum $responseFormat = ImageResponseFormatEnum::URL,
public ?string $user = null
public string $user = ''
)
{}

Expand Down

0 comments on commit 694fa42

Please sign in to comment.