(
*,
user_id: str,
natural_language: str = "",
scholar_url: str = "",
homepage_url: str = "",
pdf_paths: Optional[List[str]] = None,
affiliation: str = "",
core_directions_text: str = "",
topic_weights_text: str = "",
must_read_keywords: Optional[List[str]] = None,
must_read_authors: Optional[List[str]] = None,
must_read_institutions: Optional[List[str]] = None,
reset_existing: bool = False,
)
| 1936 | must_read = dict(profile.get("must_read") or {}) |
| 1937 | for key, values in updates["must_read"].items(): |
| 1938 | must_read[key] = values |
| 1939 | for key in ("authors", "institutions", "keywords"): |
| 1940 | must_read.setdefault(key, []) |
| 1941 | profile["must_read"] = must_read |
| 1942 | if existing_profile: |
| 1943 | db_ops.update_profile(user_id, profile) |
| 1944 | else: |
| 1945 | db_ops.create_profile(user_id, profile) |
| 1946 | |
| 1947 | |
| 1948 | def create_or_update_profile( |
| 1949 | *, |
| 1950 | user_id: str, |
| 1951 | natural_language: str = "", |
| 1952 | scholar_url: str = "", |
| 1953 | homepage_url: str = "", |
| 1954 | pdf_paths: Optional[List[str]] = None, |
| 1955 | affiliation: str = "", |
| 1956 | core_directions_text: str = "", |
| 1957 | topic_weights_text: str = "", |
| 1958 | must_read_keywords: Optional[List[str]] = None, |
| 1959 | must_read_authors: Optional[List[str]] = None, |
| 1960 | must_read_institutions: Optional[List[str]] = None, |
| 1961 | reset_existing: bool = False, |
| 1962 | ) -> Dict[str, Any]: |
| 1963 | if not user_id.strip(): |
| 1964 | raise ValueError("user_id is required") |
| 1965 | normalized_user_id = user_id.strip() |
| 1966 | result = coldstart_agent.cold_start( |
| 1967 | user_id=normalized_user_id, |
| 1968 | natural_language=natural_language.strip() or None, |
| 1969 | pdf_paths=pdf_paths or None, |
| 1970 | scholar_url=scholar_url.strip() or None, |
| 1971 | homepage_url=homepage_url.strip() or None, |
| 1972 | reset_existing=reset_existing, |
| 1973 | send_to_feishu=False, |
| 1974 | ) |
| 1975 | manual_updates = _manual_profile_updates( |
| 1976 | affiliation=affiliation, |
| 1977 | core_directions_text=core_directions_text, |
| 1978 | topic_weights_text=topic_weights_text, |
nothing calls this directly
no test coverage detected