gpt_4_1
What it is
- A module-level
ChatModeldefinition for OpenAI’sgpt-4.1, implemented vialangchain_openai.ChatOpenAI. - Intended to be imported and used as a preconfigured chat model within the
naas_abi_marketplaceChatGPT integration.
Public API
MODEL_ID: str- Constant model identifier:
"gpt-4.1".
- Constant model identifier:
PROVIDER: str- Constant provider name:
"openai".
- Constant provider name:
model: naas_abi_core.models.Model.ChatModel- Preconfigured chat model wrapper with:
model_id="gpt-4.1"provider="openai"model=ChatOpenAI(...)configured with temperature, timeout, retries, and API key.
- Preconfigured chat model wrapper with:
Configuration/Dependencies
- Dependencies:
langchain_openai.ChatOpenAInaas_abi_core.models.Model.ChatModelnaas_abi_marketplace.ai.chatgpt.ABIModulepydantic.SecretStr
- Configuration source:
- OpenAI API key is pulled from:
ABIModule.get_instance().configuration.openai_api_key
- Wrapped as
SecretStrand passed toChatOpenAI(api_key=...).
- OpenAI API key is pulled from:
- Fixed runtime parameters:
temperature=0timeout=180max_retries=3
Usage
from naas_abi_marketplace.ai.chatgpt.models.gpt_4_1 import model
# Pass `model` into the rest of your ABI pipeline where a ChatModel is expected.
# (Exact invocation depends on the consumer of `naas_abi_core.models.Model.ChatModel`.)
print(model.model_id) # "gpt-4.1"
Caveats
- This module does not define any functions or classes; it only instantiates a configured
ChatModelat import time. - Importing the module requires
ABIModule.get_instance().configuration.openai_api_keyto be available and valid.