bio_reasoning.layers.b package#
Layer B consists of bespoke foundation models specialized for non-textual or multimodal data (e.g. genomic sequences, protein structures, images) that interface with the LLM.
- bio_reasoning.layers.b.visual_describer_factory(api_key: str, api_base_url: str, model_name: str = 'gpt-4.1', system_prompt: str | None = None) Callable[[str | List[str], str], str][source]#
Factory function to create a visual description function with provided configuration.
- Parameters:
api_key (str) – The API key for authentication.
api_base_url (str) – The base URL of the API providing the visual description service.
model_name (str, optional) – Name of the model. Defaults to ‘gpt-4.1’.
system_prompt (str, optional) – A prompt to set the system context. Defaults to None.
- Returns:
A function that accepts image URIs and user prompt to generate a visual description.
- Return type:
Callable[[Union[str, List[str]], str], str]
- bio_reasoning.layers.b.load_image_data(uri: str) str[source]#
Load image data and return either as base64 encoded string (for local files) or direct URL (for remote resources).
- Parameters:
uri – Image URI (file path or URL)
- Returns:
Either a base64 encoded string (local files) or direct URL (remote resources)