gpt_4o
What it is
- A module-level definition of a
ChatModelconfigured for OpenAI’sgpt-4ovialangchain_openai.ChatOpenAI. - Intended to be imported and used as a ready-to-use chat model instance.
Public API
ID: str- Model identifier:
"gpt-4o".
- Model identifier:
PROVIDER: str- Provider identifier:
"openai".
- Provider identifier:
model: naas_abi_core.models.Model.ChatModel- Preconfigured
ChatModelwrapping aChatOpenAIinstance:model="gpt-4o"temperature=0api_keysourced fromABIModule.get_instance().configuration.openai_api_key(wrapped aspydantic.SecretStr)
- Preconfigured
Configuration/Dependencies
- Depends on:
langchain_openai.ChatOpenAInaas_abi_core.models.Model.ChatModelnaas_abi_marketplace.ai.chatgpt.ABIModulefor configuration accesspydantic.SecretStr
- Required configuration:
ABIModule.get_instance().configuration.openai_api_keymust be set to a valid OpenAI API key.
Usage
from naas_abi_marketplace.ai.chatgpt.models.gpt_4o import model
# `model` is a ChatModel that wraps a LangChain ChatOpenAI client.
# How you call it depends on the ChatModel interface in naas_abi_core.
print(model.model_id, model.provider)
Caveats
- Importing this module will instantiate
ChatOpenAIimmediately and read the OpenAI API key fromABIModuleconfiguration. If configuration is missing or not initialized, import-time errors may occur.