Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,7 +28,7 @@ print("Loading LLM...")
|
|
| 28 |
chat = ChatMistralAI(
|
| 29 |
model="mistral-medium-2505",
|
| 30 |
temperature=0.1,
|
| 31 |
-
max_retries=
|
| 32 |
mistral_api_key = os.getenv("Mistral")
|
| 33 |
)
|
| 34 |
print(f"Model {chat.model} downloaded!")
|
|
@@ -53,7 +53,7 @@ def get_ref_content(path: str) -> str | object:
|
|
| 53 |
if path.endswith('mp3') or path.startswith('https://www.youtube.com/'):
|
| 54 |
file = librosa.load(path)
|
| 55 |
elif path.endswith('.xlsx') or path.endswith('.xls'):
|
| 56 |
-
file = pd.read_excel(path).
|
| 57 |
elif path.startswith('http'):
|
| 58 |
file = requests.get(path).content
|
| 59 |
else:
|
|
@@ -112,7 +112,7 @@ extract_text_tool = Tool(
|
|
| 112 |
)
|
| 113 |
|
| 114 |
tools = [get_file_path_tool, get_content_tool, extract_text_tool, search_web_tool]
|
| 115 |
-
chat_with_tools = chat.bind_tools(tools, parallel_tool_calls=
|
| 116 |
|
| 117 |
|
| 118 |
# Generate the AgentState and Agent graph
|
|
|
|
| 28 |
chat = ChatMistralAI(
|
| 29 |
model="mistral-medium-2505",
|
| 30 |
temperature=0.1,
|
| 31 |
+
max_retries=3,
|
| 32 |
mistral_api_key = os.getenv("Mistral")
|
| 33 |
)
|
| 34 |
print(f"Model {chat.model} downloaded!")
|
|
|
|
| 53 |
if path.endswith('mp3') or path.startswith('https://www.youtube.com/'):
|
| 54 |
file = librosa.load(path)
|
| 55 |
elif path.endswith('.xlsx') or path.endswith('.xls'):
|
| 56 |
+
file = pd.read_excel(path).T.to_json()
|
| 57 |
elif path.startswith('http'):
|
| 58 |
file = requests.get(path).content
|
| 59 |
else:
|
|
|
|
| 112 |
)
|
| 113 |
|
| 114 |
tools = [get_file_path_tool, get_content_tool, extract_text_tool, search_web_tool]
|
| 115 |
+
chat_with_tools = chat.bind_tools(tools, parallel_tool_calls=True)
|
| 116 |
|
| 117 |
|
| 118 |
# Generate the AgentState and Agent graph
|