Skip to content

[Bug]: llama_index.core top-level legacy exports are listed in __all__ but missing at runtime #21132

@CadeYu

Description

@CadeYu

Bug Description

Several legacy exports are still listed in llama_index.core.__all__, but are no longer actually bound at runtime.

This causes import failures for names that appear to be part of the public API, for example:

from llama_index.core import GPTKnowledgeGraphIndex
from llama_index.core import SummaryPrompt
from llama_index.core import *

At runtime, these currently fail because:

  • GPTKnowledgeGraphIndex is listed in llama_index.core.indices.__all__, but is not actually imported/bound there
  • legacy prompt aliases such as SummaryPrompt, TreeInsertPrompt, RefinePrompt, etc. exist in llama_index.core.prompts.prompts, but are not re-exported through llama_index.core.prompts or llama_index.core

This also means from llama_index.core import * can fail with AttributeError because __all__ references names that are missing from the module object.

Version

0.14.18

Steps to Reproduce

  1. Create a clean environment and install/import llama-index-core
  2. Run:
from llama_index.core import GPTKnowledgeGraphIndex
  1. Run:
from llama_index.core import SummaryPrompt
  1. Run:
from llama_index.core import *

Relevant Logs/Tracbacks

ImportError: cannot import name 'GPTKnowledgeGraphIndex' from 'llama_index.core'
ImportError: cannot import name 'SummaryPrompt' from 'llama_index.core'
AttributeError: module 'llama_index.core' has no attribute 'GPTKnowledgeGraphIndex'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions