plan 인풋 summary 추가 및 firecrawl 캐싱 삭제

This commit is contained in:
jaehwang committed 2026-06-18 10:19:44 +09:00
1 parent 687b2c0bfd
commit 387aa758d0
5 files changed
+62 -16

No files matched your search

+4 -2
View File
@@ -16,7 +16,7 @@ class FirecrawlClient:
HTTPMethod.POST,
url=f"{FIRECRAWL_BASE}/scrape",
headers=self._headers(),
json_body={"url": url, "formats": ["json", "links"], "jsonOptions": json_options, "waitFor": wait_for},
json_body={"url": url, "formats": ["json", "links"], "jsonOptions": json_options, "waitFor": wait_for, "maxAge": 0},
label="firecrawl-scrape",
)
if not resp or not resp.is_success:
@@ -76,7 +76,7 @@ class FirecrawlClient:
"url": url,
"formats": ["json", "links", "rawHtml"],
"jsonOptions": {
"prompt": "Extract: clinic name (Korean), clinic name (English), address, phone with dash format, business hours, slogan, services offered, doctors with name/title/specialty, brand identity (primary/accent/background/text colors in hex, heading/body fonts, logo URL from the actual header/main <img> src, og:image from <meta property='og:image'> content, favicon URL)",
"prompt": "Extract: 클리닉 이름 - clinicName (Korean), clinic name (English), address, phone with dash format, business hours, slogan, services offered, doctors with name/title/specialty, brand identity (primary/accent/background/text colors in hex, heading/body fonts, logo URL from the actual header/main <img> src, og:image from <meta property='og:image'> content, favicon URL)",
"schema": {
"type": "object",
"properties": {
@@ -127,6 +127,7 @@ class FirecrawlClient:
},
},
"waitFor": 5000,
"maxAge": 0,
},
timeout=60,
label="firecrawl-clinic-info",
@@ -187,6 +188,7 @@ class FirecrawlClient:
},
},
"waitFor": 5000,
"maxAge": 0,
},
timeout=60,
label="firecrawl-gangnamunni",
+8 -1
View File
@@ -13,7 +13,7 @@ from integrations.llm.schemas.report import (
ScoresInput, ScoresOutput,
OtherChannelsInput, OtherChannelsOutput
)
from integrations.llm.schemas.plan import PlanInput, PlanOutput
from integrations.llm.schemas.plan import PlanInput, PlanOutput, SummarizeInput, SummarizeOutput
from integrations.llm.schemas.market import (
MarketCompetitorsInput, MarketCompetitorsOutput,
MarketKeywordsInput, MarketKeywordsOutput,
@@ -64,6 +64,13 @@ plan_prompt = Prompt(
output_class=PlanOutput,
)
summarize_prompt = Prompt(
file_name="summarize_prompt.txt",
prompt_model="PLAN_MODEL",
input_class=SummarizeInput,
output_class=SummarizeOutput,
)
market_competitors_prompt = Prompt(
file_name="market_competitors_prompt.txt",
prompt_model="MARKET_MODEL",
+9
View File
@@ -2,6 +2,15 @@ from typing import Literal
from pydantic import BaseModel
class SummarizeInput(BaseModel):
label: str
data: str
class SummarizeOutput(BaseModel):
summary: str
class PlanInput(BaseModel):
clinic_name: str | None = None
clinic_name_en: str | None = None
@@ -0,0 +1,7 @@
다음은 "{label}" 원본 데이터입니다.
{data}
위 데이터를 마케팅 플랜 생성에 필요한 핵심 정보만 남기고 간결하게 요약하세요.
구체적인 수치·날짜·고유명사(채널명, 게시물 제목 등)는 그대로 보존하고, 중복되거나 플랜 작성에 불필요한 메타데이터는 제거하세요.
요약문 하나의 문자열로만 출력하세요.