Implement #4
This commit is contained in:
@ -8,6 +8,8 @@
|
||||
# source code released under the terms of GNU Public License Version 3
|
||||
# https://www.gnu.org/licenses/gpl-3.0.txt
|
||||
|
||||
import random
|
||||
|
||||
from typing import Callable, List
|
||||
from ums.agent import ExtractAudioAgent, ExtractImageAgent, ExtractTextAgent, SolveAgent, GatekeeperAgent
|
||||
|
||||
@ -59,14 +61,14 @@ class MySolveAgent(SolveAgent):
|
||||
status.extract.required = False
|
||||
self.sub_riddle(riddle=Riddle(context="Haha", question="Blubber"), status=status)
|
||||
|
||||
return RiddleSolution(solution="Huii", explanation="Blubb")
|
||||
return RiddleSolution(solution="Huii", explanation=f"Blubb, {random.random()}")
|
||||
|
||||
|
||||
class MyGatekeeperAgent(GatekeeperAgent):
|
||||
|
||||
def handle(self, solution: RiddleSolution, riddle: Riddle) -> RiddleSolution:
|
||||
solution.accepted = True
|
||||
solution.review = "Ok"
|
||||
def handle(self, solution: List[RiddleSolution], riddle: Riddle) -> RiddleSolution:
|
||||
solution[0].accepted = True
|
||||
solution[0].review = "Ok"
|
||||
|
||||
return solution
|
||||
|
||||
|
Reference in New Issue
Block a user