gpt_4o (Osint Researcher model template)
What it is
- A non-functional template for configuring a
gpt-4ochat model (ChatOpenAI) intended for the Osint Researcher domain. - Provides a
create_model()factory that validates presence ofOPENAI_API_KEYand returns a configuredChatOpenAIinstance, otherwise returnsNone.
Public API
-
create_model() -> ChatOpenAI | None- Logs a warning that this is a template/not functional yet.
- Reads
OPENAI_API_KEYvianaas_abi.secret.get("OPENAI_API_KEY"). - If missing: logs an error and returns
None. - If present: returns
langchain_openai.ChatOpenAIconfigured with:model="gpt-4o"temperature=0.1max_tokens=4000
-
Module variable:
model- Currently set to
None(comment indicates it would becreate_model()in a functional version).
- Currently set to
Configuration/Dependencies
- Environment/Secrets:
OPENAI_API_KEYmust be available vianaas_abi.secret.get("OPENAI_API_KEY").
- Python dependencies:
langchain_openai.ChatOpenAInaas_abi.secretnaas_abi_core.logger
Usage
from naas_abi_marketplace.domains.osint_researcher.models.gpt_4o import create_model
model = create_model()
if model is None:
raise RuntimeError("Model not created (missing OPENAI_API_KEY or template not enabled).")
# `model` is a ChatOpenAI instance when created successfully.
Caveats
- The module is explicitly marked "NOT FUNCTIONAL YET".
- The exported
modelvariable is alwaysNonein current code (it does not auto-initialize). - If
OPENAI_API_KEYis not available throughnaas_abi.secret,create_model()returnsNone.