gpt_4o
What it is
- A non-functional template for configuring a
gpt-4oChatOpenAImodel for the Accountant domain. - Provides a
create_model()factory that validatesOPENAI_API_KEYvianaas_abi.secretand returns a configuredChatOpenAIinstance (orNone).
Public API
create_model() -> ChatOpenAI | None- Logs a warning that this is a template.
- Reads
OPENAI_API_KEYusingsecret.get("OPENAI_API_KEY"). - Returns:
Noneif the key is missing (and logs an error).- A
ChatOpenAIclient configured with:model="gpt-4o"temperature=0.1max_tokens=4000
model: None- Placeholder module-level variable. Currently not initialized (comment indicates it would call
create_model()).
- Placeholder module-level variable. Currently not initialized (comment indicates it would call
Configuration/Dependencies
- Environment/secret:
OPENAI_API_KEY(retrieved vianaas_abi.secret.get)
- Python dependencies:
langchain_openai.ChatOpenAInaas_abi.secretnaas_abi_core.logger
Usage
from naas_abi_marketplace.domains.accountant.models import gpt_4o
model = gpt_4o.create_model()
if model is None:
raise RuntimeError("Missing OPENAI_API_KEY")
# Use `model` per langchain_openai ChatOpenAI interface.
Caveats
- The module is explicitly marked "NOT FUNCTIONAL YET" and logs a warning on
create_model(). - The module-level
modelis alwaysNoneunless you explicitly callcreate_model(). - If
OPENAI_API_KEYis not available viasecret.get,create_model()returnsNone.