Skip to content

Commit 5e4d71e

Browse files
author
Pierre
committed
refactor: update audio classifier example to use Audio field type instead of File
1 parent 5bb4446 commit 5e4d71e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/04_audio_classifier_agent.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414

1515
import workflowai
1616
from workflowai import Model, Run
17-
from workflowai.fields import File
17+
from workflowai.fields import Audio
1818

1919

2020
class AudioInput(BaseModel):
2121
"""Input containing the audio file to analyze."""
22-
audio: File = Field(
22+
audio: Audio = Field(
2323
description="The audio recording to analyze for spam/robocall detection",
2424
)
2525

@@ -108,7 +108,7 @@ async def main():
108108
with open(audio_path, "rb") as f: # noqa: ASYNC230
109109
audio_data = f.read()
110110

111-
audio = File(
111+
audio = Audio(
112112
content_type="audio/mp3",
113113
data=base64.b64encode(audio_data).decode(),
114114
)

0 commit comments

Comments
 (0)