Spaces:
Sleeping
Sleeping
JarvisChan630
commited on
Commit
•
5132d94
1
Parent(s):
f344d7c
fix bugs
Browse files
agents/legacy/jar3d_agent.py
CHANGED
@@ -279,6 +279,7 @@ class NoToolExpert(BaseAgent[State]):
|
|
279 |
|
280 |
def get_prompt(self, state) -> str:
|
281 |
# print(f"\nn{state}\n")
|
|
|
282 |
system_prompt = state["meta_prompt"][-1].content
|
283 |
return system_prompt
|
284 |
|
|
|
279 |
|
280 |
def get_prompt(self, state) -> str:
|
281 |
# print(f"\nn{state}\n")
|
282 |
+
# The prompt not from the markdown, but form the meta-expert generated
|
283 |
system_prompt = state["meta_prompt"][-1].content
|
284 |
return system_prompt
|
285 |
|
models/llms.py
CHANGED
@@ -32,8 +32,8 @@ class BaseModel:
|
|
32 |
class MistralModel(BaseModel):
|
33 |
def __init__(self, temperature: float, model: str, json_response: bool, max_retries: int = 3, retry_delay: int = 1):
|
34 |
super().__init__(temperature, model, json_response, max_retries, retry_delay)
|
35 |
-
config_path = os.path.join(os.path.dirname(__file__), '..', 'config', 'config.yaml')
|
36 |
-
load_config(config_path)
|
37 |
# load_config()
|
38 |
self.api_key = os.environ.get("MISTRAL_API_KEY")
|
39 |
self.headers = {
|
@@ -94,8 +94,8 @@ class MistralModel(BaseModel):
|
|
94 |
class ClaudeModel(BaseModel):
|
95 |
def __init__(self, temperature: float, model: str, json_response: bool, max_retries: int = 3, retry_delay: int = 1):
|
96 |
super().__init__(temperature, model, json_response, max_retries, retry_delay)
|
97 |
-
config_path = os.path.join(os.path.dirname(__file__), '..', 'config', 'config.yaml')
|
98 |
-
load_config(config_path)
|
99 |
self.api_key = os.environ.get("ANTHROPIC_API_KEY")
|
100 |
self.headers = {
|
101 |
'Content-Type': 'application/json',
|
@@ -147,8 +147,8 @@ class ClaudeModel(BaseModel):
|
|
147 |
class GeminiModel(BaseModel):
|
148 |
def __init__(self, temperature: float, model: str, json_response: bool, max_retries: int = 3, retry_delay: int = 1):
|
149 |
super().__init__(temperature, model, json_response, max_retries, retry_delay)
|
150 |
-
config_path = os.path.join(os.path.dirname(__file__), '..', 'config', 'config.yaml')
|
151 |
-
load_config(config_path)
|
152 |
self.api_key = os.environ.get("GEMINI_API_KEY")
|
153 |
self.headers = {
|
154 |
'Content-Type': 'application/json'
|
@@ -218,8 +218,8 @@ class GeminiModel(BaseModel):
|
|
218 |
class GroqModel(BaseModel):
|
219 |
def __init__(self, temperature: float, model: str, json_response: bool, max_retries: int = 3, retry_delay: int = 1):
|
220 |
super().__init__(temperature, model, json_response, max_retries, retry_delay)
|
221 |
-
config_path = os.path.join(os.path.dirname(__file__), '..', 'config', 'config.yaml')
|
222 |
-
load_config(config_path)
|
223 |
self.api_key = os.environ.get("GROQ_API_KEY")
|
224 |
self.headers = {
|
225 |
'Content-Type': 'application/json',
|
|
|
32 |
class MistralModel(BaseModel):
|
33 |
def __init__(self, temperature: float, model: str, json_response: bool, max_retries: int = 3, retry_delay: int = 1):
|
34 |
super().__init__(temperature, model, json_response, max_retries, retry_delay)
|
35 |
+
# config_path = os.path.join(os.path.dirname(__file__), '..', 'config', 'config.yaml')
|
36 |
+
# load_config(config_path)
|
37 |
# load_config()
|
38 |
self.api_key = os.environ.get("MISTRAL_API_KEY")
|
39 |
self.headers = {
|
|
|
94 |
class ClaudeModel(BaseModel):
|
95 |
def __init__(self, temperature: float, model: str, json_response: bool, max_retries: int = 3, retry_delay: int = 1):
|
96 |
super().__init__(temperature, model, json_response, max_retries, retry_delay)
|
97 |
+
# config_path = os.path.join(os.path.dirname(__file__), '..', 'config', 'config.yaml')
|
98 |
+
# load_config(config_path)
|
99 |
self.api_key = os.environ.get("ANTHROPIC_API_KEY")
|
100 |
self.headers = {
|
101 |
'Content-Type': 'application/json',
|
|
|
147 |
class GeminiModel(BaseModel):
|
148 |
def __init__(self, temperature: float, model: str, json_response: bool, max_retries: int = 3, retry_delay: int = 1):
|
149 |
super().__init__(temperature, model, json_response, max_retries, retry_delay)
|
150 |
+
# config_path = os.path.join(os.path.dirname(__file__), '..', 'config', 'config.yaml')
|
151 |
+
# load_config(config_path)
|
152 |
self.api_key = os.environ.get("GEMINI_API_KEY")
|
153 |
self.headers = {
|
154 |
'Content-Type': 'application/json'
|
|
|
218 |
class GroqModel(BaseModel):
|
219 |
def __init__(self, temperature: float, model: str, json_response: bool, max_retries: int = 3, retry_delay: int = 1):
|
220 |
super().__init__(temperature, model, json_response, max_retries, retry_delay)
|
221 |
+
# config_path = os.path.join(os.path.dirname(__file__), '..', 'config', 'config.yaml')
|
222 |
+
# load_config(config_path)
|
223 |
self.api_key = os.environ.get("GROQ_API_KEY")
|
224 |
self.headers = {
|
225 |
'Content-Type': 'application/json',
|
tools/legacy/offline_graph_rag_tool copy.py
CHANGED
@@ -25,12 +25,14 @@ from langchain.schema import Document
|
|
25 |
from config.load_configs import load_config
|
26 |
from langchain_community.docstore.in_memory import InMemoryDocstore
|
27 |
from fake_useragent import UserAgent
|
|
|
28 |
|
29 |
root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
30 |
sys.path.insert(0, root_dir)
|
31 |
|
32 |
-
config_path = os.path.join(os.path.dirname(__file__), '..', 'config', 'config.yaml')
|
33 |
-
load_config(config_path)
|
|
|
34 |
|
35 |
ua = UserAgent()
|
36 |
os.environ["USER_AGENT"] = ua.random
|
|
|
25 |
from config.load_configs import load_config
|
26 |
from langchain_community.docstore.in_memory import InMemoryDocstore
|
27 |
from fake_useragent import UserAgent
|
28 |
+
from dotenv import load_dotenv
|
29 |
|
30 |
root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
31 |
sys.path.insert(0, root_dir)
|
32 |
|
33 |
+
# config_path = os.path.join(os.path.dirname(__file__), '..', 'config', 'config.yaml')
|
34 |
+
# load_config(config_path)
|
35 |
+
load_dotenv()
|
36 |
|
37 |
ua = UserAgent()
|
38 |
os.environ["USER_AGENT"] = ua.random
|
tools/offline_graph_rag_tool.py
CHANGED
@@ -21,12 +21,14 @@ from langchain.schema import Document
|
|
21 |
from config.load_configs import load_config
|
22 |
from langchain_community.docstore.in_memory import InMemoryDocstore
|
23 |
from fake_useragent import UserAgent
|
24 |
-
|
25 |
root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
26 |
sys.path.insert(0, root_dir)
|
27 |
|
28 |
-
config_path = os.path.join(os.path.dirname(__file__), '..', 'config', 'config.yaml')
|
29 |
-
load_config(config_path)
|
|
|
|
|
30 |
|
31 |
ua = UserAgent()
|
32 |
os.environ["USER_AGENT"] = ua.random
|
|
|
21 |
from config.load_configs import load_config
|
22 |
from langchain_community.docstore.in_memory import InMemoryDocstore
|
23 |
from fake_useragent import UserAgent
|
24 |
+
from dotenv import load_dotenv
|
25 |
root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
26 |
sys.path.insert(0, root_dir)
|
27 |
|
28 |
+
# config_path = os.path.join(os.path.dirname(__file__), '..', 'config', 'config.yaml')
|
29 |
+
# load_config(config_path)
|
30 |
+
|
31 |
+
load_dotenv()
|
32 |
|
33 |
ua = UserAgent()
|
34 |
os.environ["USER_AGENT"] = ua.random
|