Skip to content

Commit

Permalink
Document streaming uploads [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Oct 27, 2024
1 parent 4a0eaed commit 99a4394
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,22 @@ $response= $ai->api('/audio/transcriptions')
Console::writeLine($response->value());
```

You can also stream uploads from *InputStream*s as follows:

```php
// ...setup code from above...

$upload= $ai->api('/audio/transcriptions')->open(['model', 'whisper-1']);

$stream= $upload->stream('file', 'audio.mp3');
while ($in->available()) {
$stream->write($in->read());
}
$response= $upload->finish();

Console::writeLine($response->value());


Tracing the calls
-----------------
REST API calls can be traced with the [logging library](https://github.com/xp-framework/logging):
Expand Down

0 comments on commit 99a4394

Please sign in to comment.