Skip to content

Add toAudio macro to Stringable#264

Open
nhedger wants to merge 1 commit intolaravel:0.xfrom
nhedger:stringable-to-audio
Open

Add toAudio macro to Stringable#264
nhedger wants to merge 1 commit intolaravel:0.xfrom
nhedger:stringable-to-audio

Conversation

@nhedger
Copy link
Contributor

@nhedger nhedger commented Mar 12, 2026

Note

AI assistance was used for this PR

Warning

Depends on #263 being merged because timeout support is baked in.

Description

This PR adds a toAudio macro to Stringable.

Examples

Str::of

# Short
$response = Str::of('Hello world')->toAudio(timeout: 45);

# Long
$response = Str::of('Hello world')->toAudio(
  provider: Lab::ElevenLabs,
  voice: 'alloy',
  instructions: 'Speak slowly',
  model: 'custom-model',
  timeout: 45,
);

@nhedger nhedger changed the title Stringable to audio Add toAudio macro to Stringable Mar 12, 2026
@taylorotwell
Copy link
Member

It looks like this includes the changes from the other PR.

@nhedger nhedger force-pushed the stringable-to-audio branch from 9c1fd04 to 39cead6 Compare March 16, 2026 18:49
@nhedger
Copy link
Contributor Author

nhedger commented Mar 16, 2026

Should be all good now @taylorotwell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants