MariaFilipkowska commited on
Commit
f625bce
·
verified ·
1 Parent(s): 4f477d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -14,7 +14,7 @@ from langgraph.graph import START, StateGraph
14
  from langgraph.graph.message import add_messages
15
  from langgraph.prebuilt import ToolNode, tools_condition
16
  from langchain_mistralai import ChatMistralAI
17
-
18
 
19
  import getpass
20
  import os
@@ -48,6 +48,8 @@ def get_ref_content(path: str) -> str | object:
48
  """Retrieves content from the reference path provided."""
49
  if path.startswith('http'):
50
  file = requests.get(path).content
 
 
51
  else:
52
  with open(path, "rb") as f:
53
  file = f.read()
 
14
  from langgraph.graph.message import add_messages
15
  from langgraph.prebuilt import ToolNode, tools_condition
16
  from langchain_mistralai import ChatMistralAI
17
+ import librosa
18
 
19
  import getpass
20
  import os
 
48
  """Retrieves content from the reference path provided."""
49
  if path.startswith('http'):
50
  file = requests.get(path).content
51
+ elif path.endswith('mp3'):
52
+ file = librosa.load(path)
53
  else:
54
  with open(path, "rb") as f:
55
  file = f.read()