Spaces:
Sleeping
Sleeping
whisper
Browse files- app.py +1 -1
- requirements.txt +2 -1
- tools.py +4 -1
app.py
CHANGED
|
@@ -136,7 +136,7 @@ def finalize_node(state: AgentState) -> AgentState:
|
|
| 136 |
# Debug print
|
| 137 |
# print("\n>>> finalize_node JSON‐strict prompt:\n" + combined + "\n<<< end prompt >>>\n")
|
| 138 |
|
| 139 |
-
llm_response = llm([SystemMessage(content=combined)])
|
| 140 |
raw = llm_response.content.strip()
|
| 141 |
# print(">>> finalize_node got raw response:", raw)
|
| 142 |
|
|
|
|
| 136 |
# Debug print
|
| 137 |
# print("\n>>> finalize_node JSON‐strict prompt:\n" + combined + "\n<<< end prompt >>>\n")
|
| 138 |
|
| 139 |
+
llm_response = llm.invoke([SystemMessage(content=combined)])
|
| 140 |
raw = llm_response.content.strip()
|
| 141 |
# print(">>> finalize_node got raw response:", raw)
|
| 142 |
|
requirements.txt
CHANGED
|
@@ -11,4 +11,5 @@ langchain_community
|
|
| 11 |
openai
|
| 12 |
duckduckgo-search
|
| 13 |
regex
|
| 14 |
-
pytesseract
|
|
|
|
|
|
| 11 |
openai
|
| 12 |
duckduckgo-search
|
| 13 |
regex
|
| 14 |
+
pytesseract
|
| 15 |
+
openpyxl
|
tools.py
CHANGED
|
@@ -257,7 +257,10 @@ def audio_transcriber_tool(state: AgentState) -> AgentState:
|
|
| 257 |
raise RuntimeError("OPENAI_API_KEY is not set in environment.")
|
| 258 |
|
| 259 |
with open(local_audio, "rb") as audio_file:
|
| 260 |
-
response = openai.Audio.
|
|
|
|
|
|
|
|
|
|
| 261 |
text = response.get("text", "").strip()
|
| 262 |
except Exception as e:
|
| 263 |
text = f"Error during transcription: {e}"
|
|
|
|
| 257 |
raise RuntimeError("OPENAI_API_KEY is not set in environment.")
|
| 258 |
|
| 259 |
with open(local_audio, "rb") as audio_file:
|
| 260 |
+
response = openai.Audio.transcriptions.create(
|
| 261 |
+
file=audio_file,
|
| 262 |
+
model="whisper-1"
|
| 263 |
+
)
|
| 264 |
text = response.get("text", "").strip()
|
| 265 |
except Exception as e:
|
| 266 |
text = f"Error during transcription: {e}"
|