Firoj112's picture
Upload agent
62304db verified
import yaml
import os
from smolagents import GradioUI, ToolCallingAgent, HfApiModel
# Get current directory path
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
from managed_agents.question_generator.tools.generate_practice_questions import SimpleTool as GeneratePracticeQuestions
from managed_agents.question_generator.tools.final_answer import FinalAnswerTool as FinalAnswer
model = HfApiModel(
model_id='deepseek-ai/DeepSeek-R1',
provider=None,
)
generate_practice_questions = GeneratePracticeQuestions()
final_answer = FinalAnswer()
with open(os.path.join(CURRENT_DIR, "prompts.yaml"), 'r') as stream:
prompt_templates = yaml.safe_load(stream)
agent_question_generator = ToolCallingAgent(
model=model,
tools=[generate_practice_questions],
managed_agents=[],
max_steps=20,
verbosity_level=1,
grammar=None,
planning_interval=None,
name='question_generator',
description='Generates practice questions for cryptography topics',
prompt_templates=prompt_templates
)
if __name__ == "__main__":
GradioUI(agent_question_generator).launch()