StanSava commited on
Commit
309d438
·
1 Parent(s): 9f80f96

change to HF agent and fix agent naming

Browse files
LLM/llm_models.py CHANGED
@@ -3,7 +3,7 @@ from .models import LLMProviderType, LLMModelType
3
  from .llm_provider import LLMProvider
4
 
5
 
6
- orchestrator_model = LLMProvider(LLMProviderType.OPENAI, LLMModelType.openai.gpt_5_1).get_model()
7
 
8
  supabase_model = LLMProvider(LLMProviderType.OPENAI, LLMModelType.openai.gpt_4o).get_model()
9
  websearch_model = LLMProvider(LLMProviderType.OPENAI, LLMModelType.openai.gpt_4o).get_model()
 
3
  from .llm_provider import LLMProvider
4
 
5
 
6
+ orchestrator_model = LLMProvider(LLMProviderType.HF, LLMModelType.open_source.deepseek_v3_terminus).get_model()
7
 
8
  supabase_model = LLMProvider(LLMProviderType.OPENAI, LLMModelType.openai.gpt_4o).get_model()
9
  websearch_model = LLMProvider(LLMProviderType.OPENAI, LLMModelType.openai.gpt_4o).get_model()
LLM/models.py CHANGED
@@ -23,20 +23,39 @@ class GeminiModel(str, Enum):
23
 
24
  class OSSModel(str, Enum):
25
  llama3_70b_instruct = "meta-llama/Meta-Llama-3-70B-Instruct"
26
- llama3_8b_instruct = "meta-llama/Meta-Llama-3-8B-Instruct"
27
  mixtral_8x7b = "mistralai/Mixtral-8x7B-Instruct-v0.1"
28
- mistral_small_instruct = "mistralai/Mistral-Small-Instruct-2409"
29
  qwen2_72b_instruct = "Qwen/Qwen2-72B-Instruct"
30
- deepseek_v2 = "deepseek-ai/DeepSeek-V2"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
 
33
  class LLMModelType:
34
  """Namespaced access to curated model enums, e.g. LLMModelType.openai.gpt_5_1."""
35
 
36
- openai = OpenAIModel
37
- claude = AnthropicModel
38
- gemini = GeminiModel
39
- open_source = OSSModel
40
 
41
  class LLMProviderType(str, Enum):
42
  OPENAI = "openai"
 
23
 
24
  class OSSModel(str, Enum):
25
  llama3_70b_instruct = "meta-llama/Meta-Llama-3-70B-Instruct"
 
26
  mixtral_8x7b = "mistralai/Mixtral-8x7B-Instruct-v0.1"
 
27
  qwen2_72b_instruct = "Qwen/Qwen2-72B-Instruct"
28
+ deepseek_v3_terminus = "deepseek-ai/DeepSeek-V3.1-Terminus"
29
+ deepseek_r1 = "deepseek-ai/DeepSeek-R1"
30
+ gpt_oss_120b = "openai/gpt-oss-120b"
31
+
32
+ class EnumNamespace:
33
+ """Proxy to expose Enum members as attribute-accessed .value strings."""
34
+
35
+ def __init__(self, enum_cls: type[Enum]):
36
+ self._enum_cls = enum_cls
37
+
38
+ def __getattr__(self, item: str) -> str:
39
+ try:
40
+ return getattr(self._enum_cls, item).value
41
+ except AttributeError as exc:
42
+ raise AttributeError(f"{self._enum_cls.__name__} has no member '{item}'") from exc
43
+
44
+ def __dir__(self) -> list[str]:
45
+ return [name for name in self._enum_cls.__members__]
46
+
47
+ def members(self) -> list[Enum]:
48
+ """Return the actual Enum members if needed."""
49
+ return list(self._enum_cls)
50
 
51
 
52
  class LLMModelType:
53
  """Namespaced access to curated model enums, e.g. LLMModelType.openai.gpt_5_1."""
54
 
55
+ openai = EnumNamespace(OpenAIModel)
56
+ claude = EnumNamespace(AnthropicModel)
57
+ gemini = EnumNamespace(GeminiModel)
58
+ open_source = EnumNamespace(OSSModel)
59
 
60
  class LLMProviderType(str, Enum):
61
  OPENAI = "openai"
agents/orchestrator_agent/get_orchestrator_prompt.py CHANGED
@@ -28,7 +28,8 @@ You orchestrate specialized managed agents instead of solving tasks yourself:
28
  Never hallucinate data that the managed agents can fetch. Each fact in your reasoning must cite which agent produced it.
29
 
30
  Try to use the managed agents as much as possible and to delegate tasks to them in bulk. Extract from the database all the necessary info, then do the websearch, then use the websearch results to build the training plan.
31
- Do not alternate between them if possible.
 
32
 
33
  ---
34
 
@@ -71,6 +72,8 @@ User prompt: {user_prompt}
71
 
72
  Always begin by determining what information is missing and which managed agent must supply it. Never skip the delegation step.
73
 
 
 
74
  Return the results in this format: {pydantic_to_template(AnalysisResult)}
75
 
76
  """
 
28
  Never hallucinate data that the managed agents can fetch. Each fact in your reasoning must cite which agent produced it.
29
 
30
  Try to use the managed agents as much as possible and to delegate tasks to them in bulk. Extract from the database all the necessary info, then do the websearch, then use the websearch results to build the training plan.
31
+
32
+ Be as efficient as possible. Instruct your managed agents to batch calls and functions calls as much as possible, in order to execute them in parallel. Take advantage of the code execution abilities of the managed agents.
33
 
34
  ---
35
 
 
72
 
73
  Always begin by determining what information is missing and which managed agent must supply it. Never skip the delegation step.
74
 
75
+ You, and your managed agents, MUST plan extensively before each function call, and reflect extensively on the outcomes of the previous function calls, ensuring user's query is completely resolved. DO NOT do this entire process by making function calls only, as this can impair your ability to solve the problem and think insightfully. In addition, ensure function calls have the correct arguments.
76
+
77
  Return the results in this format: {pydantic_to_template(AnalysisResult)}
78
 
79
  """
env.example CHANGED
@@ -2,4 +2,5 @@ OPENAI_API_KEY=''
2
  GEMINI_API_KEY=''
3
  CLAUDE_API_KEY=''
4
  HF_API_KEY=''
5
- OPENROUTER_API_KEY=''
 
 
2
  GEMINI_API_KEY=''
3
  CLAUDE_API_KEY=''
4
  HF_API_KEY=''
5
+ OPENROUTER_API_KEY=''
6
+ SUPABASE_API_KEY=''
response_sample.json ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "project_id": "1",
3
+ "project_name": "AI Fraud Detection System",
4
+ "team": [
5
+ {
6
+ "employee_id": "6",
7
+ "role": "Java Engineer",
8
+ "skills_gaps": [
9
+ {
10
+ "employee_id": "6",
11
+ "skill": "Python",
12
+ "gap": 7
13
+ },
14
+ {
15
+ "employee_id": "6",
16
+ "skill": "Machine Learning",
17
+ "gap": 8
18
+ }
19
+ ],
20
+ "training_plan": [
21
+ {
22
+ "id": "datacamp_fraud_python",
23
+ "title": "Fraud Detection in Python Course",
24
+ "url": "https://www.datacamp.com/courses/fraud-detection-in-python",
25
+ "skills_covered": ["Python"],
26
+ "cost": 30.0,
27
+ "duration_hours": 30.0
28
+ },
29
+ {
30
+ "id": "udemy_fraud_detection",
31
+ "title": "Fraud Detection using Python",
32
+ "url": "https://www.udemy.com/course/fraud-detection-using-python/",
33
+ "skills_covered": ["Python"],
34
+ "cost": 12.0,
35
+ "duration_hours": 50.0
36
+ },
37
+ {
38
+ "id": "coursera_ml_fraud_detection",
39
+ "title": "Machine Learning for Fraud Detection",
40
+ "url": "https://www.coursera.org/articles/machine-learning-for-fraud-detection",
41
+ "skills_covered": ["Machine Learning"],
42
+ "cost": 49.0,
43
+ "duration_hours": 60.0
44
+ }
45
+ ]
46
+ },
47
+ {
48
+ "employee_id": "Maria Popescu",
49
+ "role": "Unknown",
50
+ "skills_gaps": [
51
+ {
52
+ "employee_id": "Maria Popescu",
53
+ "skill": "Python",
54
+ "gap": 7
55
+ },
56
+ {
57
+ "employee_id": "Maria Popescu",
58
+ "skill": "Machine Learning",
59
+ "gap": 8
60
+ },
61
+ {
62
+ "employee_id": "Maria Popescu",
63
+ "skill": "SQL",
64
+ "gap": 6
65
+ }
66
+ ],
67
+ "training_plan": [
68
+ {
69
+ "id": "datacamp_fraud_python",
70
+ "title": "Fraud Detection in Python Course",
71
+ "url": "https://www.datacamp.com/courses/fraud-detection-in-python",
72
+ "skills_covered": ["Python"],
73
+ "cost": 30.0,
74
+ "duration_hours": 30.0
75
+ },
76
+ {
77
+ "id": "udemy_fraud_detection",
78
+ "title": "Fraud Detection using Python",
79
+ "url": "https://www.udemy.com/course/fraud-detection-using-python/",
80
+ "skills_covered": ["Python"],
81
+ "cost": 12.0,
82
+ "duration_hours": 50.0
83
+ },
84
+ {
85
+ "id": "coursera_ml_fraud_detection",
86
+ "title": "Machine Learning for Fraud Detection",
87
+ "url": "https://www.coursera.org/articles/machine-learning-for-fraud-detection",
88
+ "skills_covered": ["Machine Learning"],
89
+ "cost": 49.0,
90
+ "duration_hours": 60.0
91
+ },
92
+ {
93
+ "id": "coursera_data_analysis_sql",
94
+ "title": "Data Analysis Using SQL",
95
+ "url": "https://www.coursera.org/learn/data-analysis-sql",
96
+ "skills_covered": ["SQL"],
97
+ "cost": 0.0,
98
+ "duration_hours": 40.0
99
+ }
100
+ ]
101
+ },
102
+ {
103
+ "employee_id": "Alex Ionescu",
104
+ "role": "Unknown",
105
+ "skills_gaps": [
106
+ {
107
+ "employee_id": "Alex Ionescu",
108
+ "skill": "Python",
109
+ "gap": 7
110
+ },
111
+ {
112
+ "employee_id": "Alex Ionescu",
113
+ "skill": "Machine Learning",
114
+ "gap": 8
115
+ },
116
+ {
117
+ "employee_id": "Alex Ionescu",
118
+ "skill": "SQL",
119
+ "gap": 6
120
+ }
121
+ ],
122
+ "training_plan": [
123
+ {
124
+ "id": "datacamp_fraud_python",
125
+ "title": "Fraud Detection in Python Course",
126
+ "url": "https://www.datacamp.com/courses/fraud-detection-in-python",
127
+ "skills_covered": ["Python"],
128
+ "cost": 30.0,
129
+ "duration_hours": 30.0
130
+ },
131
+ {
132
+ "id": "udemy_fraud_detection",
133
+ "title": "Fraud Detection using Python",
134
+ "url": "https://www.udemy.com/course/fraud-detection-using-python/",
135
+ "skills_covered": ["Python"],
136
+ "cost": 12.0,
137
+ "duration_hours": 50.0
138
+ },
139
+ {
140
+ "id": "coursera_ml_fraud_detection",
141
+ "title": "Machine Learning for Fraud Detection",
142
+ "url": "https://www.coursera.org/articles/machine-learning-for-fraud-detection",
143
+ "skills_covered": ["Machine Learning"],
144
+ "cost": 49.0,
145
+ "duration_hours": 60.0
146
+ },
147
+ {
148
+ "id": "coursera_data_analysis_sql",
149
+ "title": "Data Analysis Using SQL",
150
+ "url": "https://www.coursera.org/learn/data-analysis-sql",
151
+ "skills_covered": ["SQL"],
152
+ "cost": 0.0,
153
+ "duration_hours": 40.0
154
+ }
155
+ ]
156
+ }
157
+ ]
158
+ }