BATUTO-ART commited on
Commit
e36ea9e
·
verified ·
1 Parent(s): b2a0109

Create core_logic.py

Browse files
Files changed (1) hide show
  1. core_logic.py +16 -0
core_logic.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from assistants import create_assistants
2
+ from models import ModelFactory
3
+
4
+ class CoreSystem:
5
+ def __init__(self):
6
+ self.ai_model = ModelFactory.create_model(
7
+ "sambanova",
8
+ api_key=os.getenv("SAMBANOVA_API_KEY")
9
+ )
10
+ self.assistants = create_assistants(self.ai_model)
11
+
12
+ def generate_with_assistant(self, assistant_key: str, subject: str) -> str:
13
+ assistant = self.assistants.get(assistant_key)
14
+ if not assistant:
15
+ raise ValueError("Assistant not found")
16
+ return assistant.generate_prompt(subject)