gpt_4o (Treasurer model template)
What it is
- A non-functional template for configuring an OpenAI
gpt-4ochat model for the Treasurer domain. - Provides a helper to build a
langchain_openai.ChatOpenAIinstance when an API key is available.
Public API
create_model() -> ChatOpenAI | None- Logs a warning that this is a template.
- Reads
OPENAI_API_KEYvianaas_abi.secret.get. - Returns a configured
ChatOpenAIinstance if the key is present; otherwise logs an error and returnsNone.
model: None- Placeholder for a module-level model instance (currently not created).
Configuration/Dependencies
- Environment/Secrets
OPENAI_API_KEYmust be available vianaas_abi.secret.get("OPENAI_API_KEY").
- Dependencies
langchain_openai.ChatOpenAInaas_abi.secretnaas_abi_core.logger
Usage
from naas_abi_marketplace.domains.treasurer.models import gpt_4o
model = gpt_4o.create_model()
if model is None:
raise RuntimeError("Missing OPENAI_API_KEY")
# Example call pattern depends on your LangChain version/setup.
# (This file only constructs the model instance.)
Caveats
- The module is explicitly marked NOT FUNCTIONAL YET.
- The module-level
modelis alwaysNone(it does not auto-instantiatecreate_model()). - If
OPENAI_API_KEYis missing,create_model()returnsNoneand logs an error.