fix: unimported packages
Browse files- agent.py +4 -2
- tools/image_tools.py +2 -0
- tools/python_interpreter.py +2 -2
agent.py
CHANGED
@@ -12,11 +12,13 @@ import cmath
|
|
12 |
import pandas as pd
|
13 |
import uuid
|
14 |
import numpy as np
|
15 |
-
from
|
16 |
|
17 |
interpreter_instance = CodeInterpreter()
|
|
|
18 |
|
19 |
-
|
|
|
20 |
|
21 |
"""Langraph"""
|
22 |
from langgraph.graph import START, StateGraph, MessagesState
|
|
|
12 |
import pandas as pd
|
13 |
import uuid
|
14 |
import numpy as np
|
15 |
+
from tools.python_interpreter import CodeInterpreter
|
16 |
|
17 |
interpreter_instance = CodeInterpreter()
|
18 |
+
hf_token = os.environ["HUGGING_FACE_TOKEN"]
|
19 |
|
20 |
+
|
21 |
+
from tools.image import *
|
22 |
|
23 |
"""Langraph"""
|
24 |
from langgraph.graph import START, StateGraph, MessagesState
|
tools/image_tools.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
from langchain_core.tools import tool
|
2 |
from tools.image import decode_image, encode_image, save_image
|
|
|
|
|
3 |
|
4 |
@tool
|
5 |
def analyze_image(image_base64: str) -> Dict[str, Any]:
|
|
|
1 |
from langchain_core.tools import tool
|
2 |
from tools.image import decode_image, encode_image, save_image
|
3 |
+
from typing import Dict, Any, Optional
|
4 |
+
import numpy as np
|
5 |
|
6 |
@tool
|
7 |
def analyze_image(image_base64: str) -> Dict[str, Any]:
|
tools/python_interpreter.py
CHANGED
@@ -9,9 +9,8 @@ import numpy as np
|
|
9 |
import pandas as pd
|
10 |
import matplotlib.pyplot as plt
|
11 |
from PIL import Image
|
12 |
-
from
|
13 |
|
14 |
-
interpreter_instance = CodeInterpreter()
|
15 |
class CodeInterpreter:
|
16 |
|
17 |
def __init__(self, allowed_modules = None, max_execution_time = 30, working_directory = None):
|
@@ -111,6 +110,7 @@ class CodeInterpreter:
|
|
111 |
return result
|
112 |
|
113 |
|
|
|
114 |
@tool
|
115 |
def execute_code_lang(code: str, language: str = "python") -> str:
|
116 |
"""Execute code in python
|
|
|
9 |
import pandas as pd
|
10 |
import matplotlib.pyplot as plt
|
11 |
from PIL import Image
|
12 |
+
from langchain_core.tools import tool
|
13 |
|
|
|
14 |
class CodeInterpreter:
|
15 |
|
16 |
def __init__(self, allowed_modules = None, max_execution_time = 30, working_directory = None):
|
|
|
110 |
return result
|
111 |
|
112 |
|
113 |
+
interpreter_instance = CodeInterpreter()
|
114 |
@tool
|
115 |
def execute_code_lang(code: str, language: str = "python") -> str:
|
116 |
"""Execute code in python
|