datarobot_genai.core.config
config
Config
Bases: DataRobotAppFrameworkBaseSettings
The single GLOBAL application config. There is exactly one.
Finds variables in priority order: env vars (including Runtime Parameters), .env, file secrets, then Pulumi outputs. It holds the two ecosystem-wide globals, app-wide settings, and the default LLM instance's flat, instance-namespaced fields so a standalone genai (no app registered) can still resolve the default LLM from the environment.
This is NOT an :class:LLMConfig. genai never reads LLM routing fields off it
directly; those are mapped into an :class:LLMConfig by its
resolve_llm_config(name=...) method, and the two globals through the base
class's resolve_datarobot_endpoint / resolve_datarobot_api_token methods.
Source code in datarobot_genai/core/config.py
register_config_provider
register_config_provider(provider: Callable[[], object | None] | None, default_llm_name: str = DEFAULT_LLM_NAME) -> None
Register the app's authoritative GLOBAL config source, or clear it with None.
provider is a zero-arg callable returning the app's global config object
(typically lambda: Config() over the app's own Config). It is called
each time genai resolves config, so values re-resolve through the app's
settings sources (env / .env / secrets / Pulumi) on every read.
default_llm_name is the app's default LLM instance name (the prefix on its
per-LLM fields), read back by :func:registered_default_llm_name. Call sites
with no name of their own pass it to config.resolve_llm_config(name=...), so
a non-"llm" component name still works for a bare get_llm().
Source code in datarobot_genai/core/config.py
resolve_config
Return the single GLOBAL application config.
The registered app config when a provider is registered, otherwise genai's own
env-reading :class:Config (a standalone genai with no app around it).
Everything is resolved off the returned config through the datarobot.core
base class methods (resolve_datarobot_endpoint / resolve_datarobot_api_token);
for LLM routing call resolve_llm_config(name=...) on the returned config.
Source code in datarobot_genai/core/config.py
registered_default_llm_name
Return the app's registered default LLM instance name ("llm" if none).
This is a plain lookup of the name registered with
:func:register_config_provider, and nothing more. It exists so a call site
with no instance name of its own can still target the app's namespace:
config = resolve_config()
llm_config = config.resolve_llm_config(name=registered_default_llm_name())
Deliberately returns a str and not an :class:LLMConfig. See the DO NOT
note above: genai must not have a function that resolves an LLM config for you.
Source code in datarobot_genai/core/config.py
get_max_history_messages_default
Return the default maximum number of history messages.
genai does not declare this field itself, so standalone genai always gets
DEFAULT_MAX_HISTORY_MESSAGES. A component that declares
max_history_messages on its own registered config drives the value
instead (like af-component-agent). Negative values are treated as 0 (disable history).
Source code in datarobot_genai/core/config.py
default_response_model
Return the configured model to report in OpenAI chat/completions responses.
dragent agents ignore the request's model and run the LLM configured in
workflow.yaml / env, so the response should report that actual model, not
echo the caller's string (which need not be sent at all) nor NAT's
"unknown-model" placeholder. Resolves the same way the LLM client does
(the default LLM's model), always datarobot/-prefixed and never None so
the response can never regress to "unknown-model".
Source code in datarobot_genai/core/config.py
default_assume_native_tool_calling_when_unmapped
Return the CrewAI native-tool-calling override for unmapped NIM models.
When LiteLLM has no catalog entry for a NIM model, this reports native
tool-calling support so CrewAI uses API tool_calls instead of the ReAct
text path. Like :func:get_max_history_messages_default, genai does not
declare the field, so standalone genai is always False and a component
that declares assume_native_tool_calling_when_unmapped drives it
(like af-component-agent).