brickfrog commited on
Commit
08a09be
·
verified ·
1 Parent(s): 313f83b

Upload folder using huggingface_hub

Browse files
ankigen_core/agents/enhancers.py CHANGED
@@ -54,7 +54,7 @@ class RevisionAgent(BaseAgentWrapper):
54
  )
55
 
56
  # Execute revision
57
- response = await self.execute(user_input)
58
 
59
  # Parse revised card
60
  revised_card = self._parse_revised_card(response, card)
@@ -188,7 +188,7 @@ class EnhancementAgent(BaseAgentWrapper):
188
  user_input = self._build_enhancement_prompt(card, enhancement_targets)
189
 
190
  # Execute enhancement
191
- response = await self.execute(user_input)
192
 
193
  # Parse enhanced card
194
  enhanced_card = self._parse_enhanced_card(response, card)
 
54
  )
55
 
56
  # Execute revision
57
+ response, usage = await self.execute(user_input)
58
 
59
  # Parse revised card
60
  revised_card = self._parse_revised_card(response, card)
 
188
  user_input = self._build_enhancement_prompt(card, enhancement_targets)
189
 
190
  # Execute enhancement
191
+ response, usage = await self.execute(user_input)
192
 
193
  # Parse enhanced card
194
  enhanced_card = self._parse_enhanced_card(response, card)
ankigen_core/agents/judges.py CHANGED
@@ -57,8 +57,8 @@ class ContentAccuracyJudge(BaseAgentWrapper):
57
  try:
58
  user_input = f"""Evaluate this flashcard for factual accuracy:
59
 
60
- Front: {card.front.content}
61
- Back: {card.back.content}
62
 
63
  Assess:
64
  1. Factual correctness
@@ -153,7 +153,7 @@ cognitive levels, and educational best practices.""",
153
 
154
  try:
155
  user_input = self._build_judgment_prompt(card)
156
- response = await self.execute(user_input)
157
 
158
  decision_data = (
159
  json.loads(response) if isinstance(response, str) else response
@@ -263,7 +263,7 @@ to the target audience.""",
263
 
264
  try:
265
  user_input = self._build_judgment_prompt(card)
266
- response = await self.execute(user_input)
267
 
268
  decision_data = (
269
  json.loads(response) if isinstance(response, str) else response
@@ -378,7 +378,7 @@ Verify code syntax, best practices, security considerations, and technical corre
378
  )
379
 
380
  user_input = self._build_judgment_prompt(card)
381
- response = await self.execute(user_input)
382
 
383
  decision_data = (
384
  json.loads(response) if isinstance(response, str) else response
@@ -504,7 +504,7 @@ and maintain consistent quality standards.""",
504
 
505
  try:
506
  user_input = self._build_judgment_prompt(card)
507
- response = await self.execute(user_input)
508
 
509
  decision_data = (
510
  json.loads(response) if isinstance(response, str) else response
 
57
  try:
58
  user_input = f"""Evaluate this flashcard for factual accuracy:
59
 
60
+ Front: {card.front.question}
61
+ Back: {card.back.answer}
62
 
63
  Assess:
64
  1. Factual correctness
 
153
 
154
  try:
155
  user_input = self._build_judgment_prompt(card)
156
+ response, usage = await self.execute(user_input)
157
 
158
  decision_data = (
159
  json.loads(response) if isinstance(response, str) else response
 
263
 
264
  try:
265
  user_input = self._build_judgment_prompt(card)
266
+ response, usage = await self.execute(user_input)
267
 
268
  decision_data = (
269
  json.loads(response) if isinstance(response, str) else response
 
378
  )
379
 
380
  user_input = self._build_judgment_prompt(card)
381
+ response, usage = await self.execute(user_input)
382
 
383
  decision_data = (
384
  json.loads(response) if isinstance(response, str) else response
 
504
 
505
  try:
506
  user_input = self._build_judgment_prompt(card)
507
+ response, usage = await self.execute(user_input)
508
 
509
  decision_data = (
510
  json.loads(response) if isinstance(response, str) else response
app.py CHANGED
@@ -306,10 +306,6 @@ def create_ankigen_interface():
306
  label="Generate Cloze Cards (Experimental)",
307
  value=False,
308
  )
309
- llm_judge_checkbox = gr.Checkbox(
310
- label="Use LLM Judge",
311
- value=False,
312
- )
313
 
314
  # Agent System Controls (simplified since we're agent-only)
315
  if AGENTS_AVAILABLE_APP:
@@ -666,7 +662,6 @@ def create_ankigen_interface():
666
  cards_per_topic_val,
667
  preference_prompt_val,
668
  generate_cloze_checkbox_val,
669
- llm_judge_checkbox_val,
670
  agent_mode_val,
671
  enable_subject_expert_val,
672
  enable_generation_coordinator_val,
@@ -774,7 +769,6 @@ def create_ankigen_interface():
774
  cards_per_topic_val,
775
  preference_prompt_val,
776
  generate_cloze_checkbox_val,
777
- llm_judge_checkbox_val,
778
  )
779
  # Expect 3-tuple return (dataframe, total_cards_html, token_usage_html)
780
 
@@ -791,7 +785,6 @@ def create_ankigen_interface():
791
  cards_per_topic,
792
  preference_prompt,
793
  generate_cloze_checkbox,
794
- llm_judge_checkbox,
795
  agent_mode_dropdown,
796
  enable_subject_expert,
797
  enable_generation_coordinator,
 
306
  label="Generate Cloze Cards (Experimental)",
307
  value=False,
308
  )
 
 
 
 
309
 
310
  # Agent System Controls (simplified since we're agent-only)
311
  if AGENTS_AVAILABLE_APP:
 
662
  cards_per_topic_val,
663
  preference_prompt_val,
664
  generate_cloze_checkbox_val,
 
665
  agent_mode_val,
666
  enable_subject_expert_val,
667
  enable_generation_coordinator_val,
 
769
  cards_per_topic_val,
770
  preference_prompt_val,
771
  generate_cloze_checkbox_val,
 
772
  )
773
  # Expect 3-tuple return (dataframe, total_cards_html, token_usage_html)
774
 
 
785
  cards_per_topic,
786
  preference_prompt,
787
  generate_cloze_checkbox,
 
788
  agent_mode_dropdown,
789
  enable_subject_expert,
790
  enable_generation_coordinator,