Coverage for haystack/__init__.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.15.4, created at 2026-08-21 13:53 +0000

1# SPDX-FileCopyrightText: 2022-present deepset GmbH <info@deepset.ai> 

2# 

3# SPDX-License-Identifier: Apache-2.0 

4 

5# We avoid lazy imports here because: 

6# - they create potential static type checking issues which are hard to debug 

7# - they make this module more complicated and hard to maintain 

8# - they offer minimal performance gains in this case. 

9 

10import haystack.logging 

11 

12# Imported so the `haystack.tracing` namespace is available after `import haystack`. 

13import haystack.tracing # noqa: F401 

14from haystack.core.component import component 

15from haystack.core.errors import ComponentError, DeserializationError 

16from haystack.core.pipeline import Pipeline 

17from haystack.core.serialization import default_from_dict, default_to_dict 

18from haystack.core.super_component.super_component import SuperComponent, super_component 

19from haystack.dataclasses import Answer, Document, ExtractedAnswer, GeneratedAnswer 

20from haystack.version import __version__ # noqa: F401 

21 

22# Initialize the logging configuration. 

23# This is a no-op unless `structlog` is installed. `configure_structlog=False` means we only install our own scoped 

24# logging handler (so Haystack's logs are formatted) without touching the process-global `structlog` configuration. 

25haystack.logging.configure_logging(configure_structlog=False) 

26 

27__all__ = [ 

28 "Answer", 

29 "ComponentError", 

30 "DeserializationError", 

31 "Document", 

32 "ExtractedAnswer", 

33 "GeneratedAnswer", 

34 "Pipeline", 

35 "SuperComponent", 

36 "super_component", 

37 "component", 

38 "default_from_dict", 

39 "default_to_dict", 

40]