From a90baf0f6c9a7caa470f9019acf0f49ca90ec9f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9C=A4=EC=98=88=EB=A6=BC?= Date: Wed, 19 Aug 2026 20:03:46 +0900 Subject: [PATCH 1/2] =?UTF-8?q?refactor:=20=EC=B6=94=EC=B2=9C=20=EC=9E=84?= =?UTF-8?q?=EB=B2=A0=EB=94=A9=20=EC=9E=85=EB=A0=A5=EC=9D=84=20=ED=95=B5?= =?UTF-8?q?=EC=8B=AC=20=ED=82=A4=EC=9B=8C=EB=93=9C=20=EC=A4=91=EC=8B=AC?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/schemas/recommendation/schedule_context.py | 2 +- .../recommendation/schedule_context_service.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/schemas/recommendation/schedule_context.py b/app/schemas/recommendation/schedule_context.py index 38059c3..b6d21b5 100644 --- a/app/schemas/recommendation/schedule_context.py +++ b/app/schemas/recommendation/schedule_context.py @@ -42,7 +42,7 @@ class ScheduleContextResult(BaseModel): draft_revision: int = Field(alias="draftRevision") query_embedding: list[float] | None = Field(default=None, alias="queryEmbedding") embedding_status: EmbeddingStatus = Field(alias="embeddingStatus") - semantic_input_version: str = Field(default="v1", alias="semanticInputVersion") + semantic_input_version: str = Field(default="v2", alias="semanticInputVersion") schedule_context: ScheduleContext = Field(alias="scheduleContext") embedding_meta: EmbeddingMeta | None = Field(default=None, alias="embeddingMeta") error_code: str | None = Field(default=None, alias="errorCode") diff --git a/app/services/recommendation/schedule_context_service.py b/app/services/recommendation/schedule_context_service.py index a2e50f8..5693480 100644 --- a/app/services/recommendation/schedule_context_service.py +++ b/app/services/recommendation/schedule_context_service.py @@ -24,11 +24,14 @@ def _build_semantic_input( self, request: RecommendationRequest, ) -> str: - event_title = " ".join( - request.event_title.split() + event_title = " ".join(request.event_title.split()) + embedding_words = " ".join( + word.strip() + for word in request.embedding_words + if word.strip() ) - parts = [event_title] + parts = [embedding_words or event_title] def append_if_not_duplicated( value: str, @@ -46,9 +49,6 @@ def append_if_not_duplicated( parts.append(f"{prefix}{normalized_value}") - for word in request.embedding_words: - append_if_not_duplicated(word) - if request.place_candidate: append_if_not_duplicated( request.place_candidate, @@ -112,7 +112,7 @@ def structure_context( draftRevision=request.draft_revision, queryEmbedding=None, embeddingStatus="ERROR", - semanticInputVersion="v1", + semanticInputVersion="v2", scheduleContext=schedule_context, embeddingMeta=None, errorCode=exc.error_code.name, @@ -124,7 +124,7 @@ def structure_context( draftRevision=request.draft_revision, queryEmbedding=query_embedding, embeddingStatus="READY", - semanticInputVersion="v1", + semanticInputVersion="v2", scheduleContext=schedule_context, embeddingMeta=EmbeddingMeta( model=self.embedding_service.model, From 906f726e79b5b27a06a231a7358aeb5ceb2a8c10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9C=A4=EC=98=88=EB=A6=BC?= Date: Wed, 19 Aug 2026 20:18:34 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=EC=BD=94=EB=93=9C=EB=9E=98=EB=B9=97=20?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/recommendation/schedule_context_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/recommendation/schedule_context_service.py b/app/services/recommendation/schedule_context_service.py index 5693480..aef4169 100644 --- a/app/services/recommendation/schedule_context_service.py +++ b/app/services/recommendation/schedule_context_service.py @@ -26,7 +26,7 @@ def _build_semantic_input( ) -> str: event_title = " ".join(request.event_title.split()) embedding_words = " ".join( - word.strip() + " ".join(word.split()) for word in request.embedding_words if word.strip() )