gpt_4o
What it is
- A non-functional template for configuring a
gpt-4ochat model (Content Analyst domain) usinglangchain_openai.ChatOpenAI. - Provides a
create_model()factory that validatesOPENAI_API_KEYand returns a configured model instance orNone.
Public API
create_model() -> ChatOpenAI | None- Logs a warning that the template is not functional yet.
- Reads
OPENAI_API_KEYvianaas_abi.secret.get. - Returns:
- A
ChatOpenAIinstance configured with:model="gpt-4o"temperature=0.1max_tokens=4000
Noneif the API key is missing (and logs an error).
- A
model: None- Placeholder global 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.content_analyst.models.gpt_4o import create_model
model = create_model()
if model is None:
raise RuntimeError("Missing OPENAI_API_KEY")
# Use model per LangChain ChatOpenAI interface
# e.g., model.invoke("Hello") # depending on your LangChain version
Caveats
- Marked as NOT FUNCTIONAL YET in code and logs a warning on creation.
- The module-level
modelis alwaysNone(it does not callcreate_model()).