Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import pandas as pd
|
|
| 6 |
from typing import TypedDict, Annotated, Union, Dict, Any
|
| 7 |
from smolagents import DuckDuckGoSearchTool
|
| 8 |
from langchain_community.tools import DuckDuckGoSearchRun
|
| 9 |
-
from tools import get_hub_stats, analyze_image, read_excel_file, download_file, execute_python_code
|
| 10 |
from langchain.tools import Tool
|
| 11 |
from langchain_huggingface import HuggingFaceEndpoint, ChatHuggingFace
|
| 12 |
from langchain_openai import ChatOpenAI
|
|
@@ -72,6 +72,12 @@ class NewAgent:
|
|
| 72 |
func=execute_python_code,
|
| 73 |
description="Executes a Python file and returns its output. Input should be the path to a Python file."
|
| 74 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
# Generate the chat interface, including the tools
|
| 76 |
tools = [
|
| 77 |
search_tool,
|
|
@@ -79,6 +85,7 @@ class NewAgent:
|
|
| 79 |
image_analysis_tool,
|
| 80 |
read_excel_tool,
|
| 81 |
python_exec_tool,
|
|
|
|
| 82 |
]
|
| 83 |
# llm = ChatOpenAI(model="gpt-4o")
|
| 84 |
llm = ChatOpenAI(model="gpt-4.1")
|
|
|
|
| 6 |
from typing import TypedDict, Annotated, Union, Dict, Any
|
| 7 |
from smolagents import DuckDuckGoSearchTool
|
| 8 |
from langchain_community.tools import DuckDuckGoSearchRun
|
| 9 |
+
from tools import get_hub_stats, analyze_image, read_excel_file, download_file, execute_python_code, transcribe_audio
|
| 10 |
from langchain.tools import Tool
|
| 11 |
from langchain_huggingface import HuggingFaceEndpoint, ChatHuggingFace
|
| 12 |
from langchain_openai import ChatOpenAI
|
|
|
|
| 72 |
func=execute_python_code,
|
| 73 |
description="Executes a Python file and returns its output. Input should be the path to a Python file."
|
| 74 |
)
|
| 75 |
+
# Initialize the Python Execution tool
|
| 76 |
+
transcribe_audio_tool = Tool(
|
| 77 |
+
name="transcribe_audio",
|
| 78 |
+
func=transcribe_audio,
|
| 79 |
+
description="Transcribe audio file using OpenAI Whisper"
|
| 80 |
+
)
|
| 81 |
# Generate the chat interface, including the tools
|
| 82 |
tools = [
|
| 83 |
search_tool,
|
|
|
|
| 85 |
image_analysis_tool,
|
| 86 |
read_excel_tool,
|
| 87 |
python_exec_tool,
|
| 88 |
+
transcribe_audio_tool,
|
| 89 |
]
|
| 90 |
# llm = ChatOpenAI(model="gpt-4o")
|
| 91 |
llm = ChatOpenAI(model="gpt-4.1")
|