Skip to content

tdfs4ds.utils.optional

tdfs4ds.utils.optional

Optional dependencies: one place that says what to install.

The base install (pip install tdfs4ds) holds the feature store and the admin app. The assistant (consumer agent, query optimizer, LLM documentation, vector index, Gradio chat) needs the agent packages: pip install tdfs4ds[agent].

AGENT_MODULES module-attribute

AGENT_MODULES = ('langchain_core', 'langgraph')

AGENT_ALL_MODULES module-attribute

AGENT_ALL_MODULES = AGENT_MODULES + ('langchain_openai', 'chromadb', 'gradio')

_WANT_IF_SET module-attribute

_WANT_IF_SET = ('INSTRUCT_MODEL_PROVIDER', 'INSTRUCT_MODEL_MODEL', 'EMBEDDING_MODEL_PROVIDER', 'EMBEDDING_MODEL_MODEL', 'EMBEDDING_MODEL_URL', 'VECTOR_STORE_BACKEND', 'MCP_SERVER_URL', 'TRACING')

_TRUE module-attribute

_TRUE = ('1', 'true', 'yes', 'on', 'y')

install_hint

install_hint(extra='agent')

have

have(module)

True when module can be found (not imported: a find_spec is enough).

missing_modules

missing_modules(modules=AGENT_MODULES)

require_extra

require_extra(module, extra='agent', feature=None)

Import module (or a tuple of modules) and return it, or raise an ImportError that names the command to run. Call it at entry points, never at import time.

agent_wanted

agent_wanted(config=None)

Does the configuration say the assistant is wanted? -> (bool, [names]).

config is a dict of resolved settings ({"INSTRUCT_MODEL_MODEL": "x", ...}; a TDFS4DS_ prefix is accepted). Pure: nothing is read when it is given. Without it, the environment (TDFS4DS_*) and the model / MCP / tracing attributes of the module are read (the module's own defaults, which are never a choice, are not). The names returned are the variables that say so (TDFS4DS_...), never values.