mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-26 23:51:14 +02:00
feat: register a scraper run as a citation
This commit is contained in:
parent
81f2d694bd
commit
957e57bb82
1 changed files with 23 additions and 0 deletions
|
|
@ -0,0 +1,23 @@
|
|||
"""Register a recorded scraper run as a citable ``[n]``."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.agents.chat.multi_agent_chat.shared.citations import (
|
||||
CitationRegistry,
|
||||
CitationSourceType,
|
||||
)
|
||||
|
||||
|
||||
def attach_run_citation(
|
||||
registry: CitationRegistry,
|
||||
*,
|
||||
run_external_id: str,
|
||||
capability: str,
|
||||
) -> tuple[int, str]:
|
||||
"""Register the ``run_<uuid>`` handle; return its ``[n]`` and the label line."""
|
||||
n = registry.register(
|
||||
CitationSourceType.RUN,
|
||||
{"run_id": run_external_id},
|
||||
{"capability": capability},
|
||||
)
|
||||
return n, f"\n\nCite this scraper run as [{n}] after any claim drawn from its data."
|
||||
Loading…
Add table
Add a link
Reference in a new issue