feat: add APA citation field to enrichment output
Extend Gemini 2.5 Flash prompt to also extract APA 7th edition citation string per result. Bump max_tokens 512 → 1024 to accommodate the longer JSON response.
This commit is contained in:
@@ -82,6 +82,7 @@ You are an information extractor. Analyze the web page content below and return
|
|||||||
- "author": author or organization name, or null if not found (string | null)
|
- "author": author or organization name, or null if not found (string | null)
|
||||||
- "tags": list of 3-5 relevant keywords (string[])
|
- "tags": list of 3-5 relevant keywords (string[])
|
||||||
- "content_type": one of "article", "documentation", "news", "forum", "code", "video", "other" (string)
|
- "content_type": one of "article", "documentation", "news", "forum", "code", "video", "other" (string)
|
||||||
|
- "citation": APA 7th edition citation string for this source (string). Format: Author/Org. (Year, Month Day). Title. Site Name. URL — use "n.d." if date unknown, omit fields that cannot be determined.
|
||||||
|
|
||||||
Title: {title}
|
Title: {title}
|
||||||
URL: {url}
|
URL: {url}
|
||||||
@@ -110,7 +111,7 @@ def enrich_result(title: str, url: str, snippet: str) -> dict:
|
|||||||
client = _get_llm_client()
|
client = _get_llm_client()
|
||||||
req = GenericChatRequest(
|
req = GenericChatRequest(
|
||||||
messages=[UserMessage(content=[TextContent(text=prompt)])],
|
messages=[UserMessage(content=[TextContent(text=prompt)])],
|
||||||
max_tokens=512,
|
max_tokens=1024,
|
||||||
temperature=0,
|
temperature=0,
|
||||||
)
|
)
|
||||||
det = ChatDetails(
|
det = ChatDetails(
|
||||||
@@ -132,6 +133,7 @@ def enrich_result(title: str, url: str, snippet: str) -> dict:
|
|||||||
"author": None,
|
"author": None,
|
||||||
"tags": [],
|
"tags": [],
|
||||||
"content_type": "other",
|
"content_type": "other",
|
||||||
|
"citation": None,
|
||||||
"_error": str(exc),
|
"_error": str(exc),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user