bridge.pipelines.gh2bt_for_meta.map_funcs.description module#
Mapping functions for description metadata.
This module reconciles textual tool descriptions between GitHub and bio.tools. GitHub descriptions are treated as authoritative when present. If GitHub provides no description and bio.tools is empty, a short description is generated from the README using an LLM.
- async bridge.pipelines.gh2bt_for_meta.map_funcs.description.map_description(gh_params, bt_description)[source]#
Map and reconcile GitHub description metadata and bio.tools description metadata.
Policy: 1. If GitHub provides no metadata, the existing bio.tools description
is preserved.
If GitHub provides a description: - If it is effectively identical to the bio.tools description
(ignoring trailing punctuation and whitespace), no change is made.
Otherwise, the GitHub description overwrites the bio.tools value.
If GitHub provides no description and bio.tools is empty: - If a README is available, a short description is generated from
the README using an LLM and normalized before storage.
If no README is available, no description is set.
LLM failures never overwrite existing bio.tools descriptions.
- Parameters:
gh_params (dict | None) – GitHub metadata dictionary. Expected keys include: -
"description": Repository description string (optional) -"readme": README contents used for LLM-based description generationbt_description (str | None) – Existing bio.tools description, or
Noneif unset.
- Returns:
The reconciled bio.tools description, or
Noneif no description could be determined.- Return type:
str | None