Spaces:
Sleeping
Sleeping
File size: 1,702 Bytes
d62c395 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | from pydantic import BaseModel, Field
from typing import Literal, Optional
class Secret(BaseModel):
id: str
task_id: str
content: str
persona: str
context: str
difficulty: float
category: str
red_herrings: list[str]
hint_keywords: list[str]
class TaskMeta(BaseModel):
id: str
description: str
max_steps: int
reward_range: list[float]
difficulty: str
category: str
class MindReadObservation(BaseModel):
episode_id: str
task_id: str
step: int
max_steps: int
context: str
oracle_persona: str
conversation_history: list[dict]
questions_remaining: int
task_description: str
class AskQuestionAction(BaseModel):
action: Literal["ask_question", "submit_hypothesis"]
question: Optional[str] = None
hypothesis: Optional[str] = None
category_prediction: Optional[Literal[
"factual", "belief", "goal", "second_order"
]] = None
class StepResult(BaseModel):
observation: MindReadObservation
reward: float = 0.0
done: bool
info: dict
class RewardBreakdown(BaseModel):
reward: float
semantic_similarity: float
efficiency_bonus: float
category_bonus: float
keyword_bonus: float
questions_used: int
hypothesis: str
class SubmitResult(BaseModel):
reward: float
breakdown: RewardBreakdown
true_secret: str
episode_id: str
done: bool = True
class GenerateSecretRequest(BaseModel):
category: Literal["factual", "belief", "goal", "second_order"]
difficulty: float = Field(ge=0.0, le=1.0)
domain: str = "tech startup"
class HealthResponse(BaseModel):
status: str
version: str
oracle_backend: str
|