Skip to content

Commit

Permalink
Add audio transcription by boolean (#1082)
Browse files Browse the repository at this point in the history
* Add audio transcription by bool

* Clean up
  • Loading branch information
Josh-XT authored Jan 6, 2024
1 parent 965ef87 commit d0a5290
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions agixt/Interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,26 @@ async def run(
browse_links: bool = False,
prompt_category: str = "Default",
persist_context_in_history: bool = False,
is_m4a_audio: bool = False,
is_wav_audio: bool = False,
**kwargs,
):
if is_m4a_audio or is_wav_audio:
# Convert the audio to text
ext = Extensions(
agent_name=self.agent_name,
agent_config=self.agent.AGENT_CONFIG,
conversation_name=conversation_name,
ApiClient=self.ApiClient,
user=self.user,
)
command_output = await ext.execute_command(
command_name="Transcribe M4A Audio"
if is_m4a_audio
else "Transcribe WAV Audio",
command_args={"base64_audio": user_input},
)
user_input = command_output
shots = int(shots)
if "prompt_category" in kwargs:
prompt_category = kwargs["prompt_category"]
Expand Down

0 comments on commit d0a5290

Please sign in to comment.