Skip to content
Merged

Idea #28

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ dependencies = [
"duckdb>=1.4.4",
"bibtexparser>=1.4.0",
"rapidfuzz>=3.5.0",
"rank-bm25>=0.2.2",
"beautifulsoup4>=4.12.3",
]

Expand Down
2 changes: 2 additions & 0 deletions backend/src/gateway/contracts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
IdeaGenError,
IdeaGenRunEvent,
IdeaGenRunCreate,
IdeaGenPresetDefinition,
IdeaGenRunEventType,
IdeaGenRunResponse,
IdeaGenRunStatus,
Expand Down Expand Up @@ -63,6 +64,7 @@
"IdeaGenError",
"IdeaGenRunEvent",
"IdeaGenRunCreate",
"IdeaGenPresetDefinition",
"IdeaGenRunEventType",
"IdeaGenRunResponse",
"IdeaGenRunStatus",
Expand Down
12 changes: 12 additions & 0 deletions backend/src/gateway/contracts/idea_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from typing import Literal

from pydantic import BaseModel, Field, field_validator, model_validator
from src.modules.idea_gen.config_presets import PresetMode

IDEA_GEN_DEFAULT_TARGET_VENUES = ("NIPS", "ICML", "ICLR")
DEFAULT_MAX_CRITIC_ITERATIONS = 2
Expand Down Expand Up @@ -63,6 +64,7 @@ class IdeaGenRunCreate(BaseModel):
"""Request model for creating a new Idea Gen run."""

target: str = Field(..., min_length=10, max_length=1000)
preset_mode: PresetMode = "custom"
academic_domain: str = Field(default="AI/ML", min_length=1, max_length=200)
target_venues: list[str] = Field(
default_factory=lambda: list(IDEA_GEN_DEFAULT_TARGET_VENUES)
Expand Down Expand Up @@ -124,6 +126,16 @@ def _strip_answer(cls, value: str) -> str:
return stripped


class IdeaGenPresetDefinition(BaseModel):
"""Preset metadata exposed to the frontend."""

mode: PresetMode
label: str = Field(..., min_length=1, max_length=100)
description: str = Field(..., min_length=1, max_length=300)
default_max_iterations: int = Field(..., ge=1)
max_critic_iterations: int = Field(..., ge=1)


class CriticFeedbackSimple(BaseModel):
"""Current critic feedback shape persisted by the workflow."""

Expand Down
Loading
Loading