Skip to content

Commit 63384a8

Browse files
committed
Move UserOnboarding to model.py
1 parent db1abb1 commit 63384a8

File tree

2 files changed

+19
-21
lines changed

2 files changed

+19
-21
lines changed

autogpt_platform/backend/backend/data/model.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from urllib.parse import urlparse
2323
from uuid import uuid4
2424

25-
from prisma.enums import CreditTransactionType
25+
from prisma.enums import CreditTransactionType, OnboardingStep
2626
from pydantic import (
2727
BaseModel,
2828
ConfigDict,
@@ -855,3 +855,20 @@ class UserExecutionSummaryStats(BaseModel):
855855
total_execution_time: float = Field(default=0)
856856
average_execution_time: float = Field(default=0)
857857
cost_breakdown: dict[str, float] = Field(default_factory=dict)
858+
859+
860+
class UserOnboarding(BaseModel):
861+
userId: str
862+
completedSteps: list[OnboardingStep]
863+
walletShown: bool
864+
notified: list[OnboardingStep]
865+
rewardedFor: list[OnboardingStep]
866+
usageReason: Optional[str]
867+
integrations: list[str]
868+
otherIntegrations: Optional[str]
869+
selectedStoreListingVersionId: Optional[str]
870+
agentInput: dict[str, Any]
871+
onboardingAgentExecutionId: Optional[str]
872+
agentRuns: int
873+
lastRunAt: Optional[datetime]
874+
consecutiveRunDays: int

autogpt_platform/backend/backend/server/routers/v1.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
set_auto_top_up,
4646
)
4747
from backend.data.execution import UserContext
48-
from backend.data.model import CredentialsMetaInput
48+
from backend.data.model import CredentialsMetaInput, UserOnboarding
4949
from backend.data.notifications import NotificationPreference, NotificationPreferenceDTO
5050
from backend.data.onboarding import (
5151
FrontendOnboardingStep,
@@ -118,25 +118,6 @@ def _create_file_size_error(size_bytes: int, max_size_mb: int) -> HTTPException:
118118
logger = logging.getLogger(__name__)
119119

120120

121-
# Needed to avoid including User from UserOnboarding prisma model in router
122-
# that causes schema generation for prisma and our LibraryAgent in openapi.json
123-
class UserOnboarding(pydantic.BaseModel):
124-
userId: str
125-
completedSteps: list[OnboardingStep]
126-
walletShown: bool
127-
notified: list[OnboardingStep]
128-
rewardedFor: list[OnboardingStep]
129-
usageReason: Optional[str]
130-
integrations: list[str]
131-
otherIntegrations: Optional[str]
132-
selectedStoreListingVersionId: Optional[str]
133-
agentInput: dict[str, Any]
134-
onboardingAgentExecutionId: Optional[str]
135-
agentRuns: int
136-
lastRunAt: Optional[datetime]
137-
consecutiveRunDays: int
138-
139-
140121
async def hide_activity_summaries_if_disabled(
141122
executions: list[execution_db.GraphExecutionMeta], user_id: str
142123
) -> list[execution_db.GraphExecutionMeta]:

0 commit comments

Comments
 (0)