MariaFilipkowska commited on
Commit
57ab296
·
verified ·
1 Parent(s): d5f3340

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -32,11 +32,11 @@ chat3 = ChatMistralAI(
32
  max_retries=6,
33
  mistral_api_key = os.getenv("Mistral")
34
  )
35
- chat2 = ChatMistralAI(
36
- model="mistral-ocr-2505",
37
- temperature=0.01,
38
- max_retries=6,
39
- mistral_api_key = os.getenv("Mistral")
40
  )
41
  print(f"Model {chat2.model} downloaded!")
42
  chat1 = ChatMistralAI(
@@ -64,7 +64,7 @@ def get_file_path(question: str) -> str:
64
 
65
  def get_ref_content(path: str) -> str | object:
66
  """Retrieves content from the reference path provided."""
67
- if path.endswith('mp3') or path.startswith('https://www.youtube.com/'):
68
  file = librosa.load(path)
69
  elif path.endswith(".jpg") or path.endswith(".jpeg"):
70
  file = cv2.imread(path)
@@ -157,7 +157,7 @@ class AgentState(TypedDict):
157
 
158
 
159
  def build_agent(chat):
160
- tools = [get_file_path_tool, get_content_tool, search_web_tool, extract_text_tool, play_chess_tool, run_code_tool]
161
  chat_with_tools = chat.bind_tools(tools, parallel_tool_calls=False)
162
  # The graph
163
  builder = StateGraph(AgentState)
 
32
  max_retries=6,
33
  mistral_api_key = os.getenv("Mistral")
34
  )
35
+ # chat2 = ChatMistralAI(
36
+ # model="mistral-ocr-2505",
37
+ # temperature=0.01,
38
+ # max_retries=6,
39
+ # mistral_api_key = os.getenv("Mistral")
40
  )
41
  print(f"Model {chat2.model} downloaded!")
42
  chat1 = ChatMistralAI(
 
64
 
65
  def get_ref_content(path: str) -> str | object:
66
  """Retrieves content from the reference path provided."""
67
+ if path.endswith('.mp3') or path.startswith('https://www.youtube.com/'):
68
  file = librosa.load(path)
69
  elif path.endswith(".jpg") or path.endswith(".jpeg"):
70
  file = cv2.imread(path)
 
157
 
158
 
159
  def build_agent(chat):
160
+ tools = [get_content_tool, search_web_tool, extract_text_tool, play_chess_tool, run_code_tool]
161
  chat_with_tools = chat.bind_tools(tools, parallel_tool_calls=False)
162
  # The graph
163
  builder = StateGraph(AgentState)