claude_3_5_sonnet
What it is
- A non-functional template for configuring an Anthropic Claude model (
claude-3-5-sonnet) intended for the Campaign Manager domain. - Provides a
create_model()helper that attempts to build alangchain_anthropic.ChatAnthropicclient when an API key is available.
Public API
create_model() -> ChatAnthropic | None- Logs a warning that this is not functional yet.
- Reads
ANTHROPIC_API_KEYvianaas_abi.secret.get("ANTHROPIC_API_KEY"). - Returns:
- a configured
ChatAnthropicinstance if the key exists Noneif the key is missing (and logs an error)
- a configured
model: None- A module-level placeholder; not initialized (comment indicates it would be
create_model()later).
- A module-level placeholder; not initialized (comment indicates it would be
Configuration/Dependencies
- Dependencies:
langchain_anthropic.ChatAnthropicnaas_abi.secretfor secret retrievalnaas_abi_core.loggerfor logging
- Required secret:
ANTHROPIC_API_KEY(retrieved throughsecret.get(...))
- Model parameters used:
model="claude-3-5-sonnet"temperature=0.3max_tokens=4000
Usage
from naas_abi_marketplace.domains.campaign_manager.models.claude_3_5_sonnet import create_model
llm = create_model()
if llm is None:
raise RuntimeError("Missing ANTHROPIC_API_KEY")
# Example call pattern depends on your LangChain version and setup.
# (This module only returns the configured ChatAnthropic instance.)
Caveats
- The module is explicitly marked “NOT FUNCTIONAL YET - template only”.
- The exported
modelvariable isNoneand will not work unless you callcreate_model()yourself. - If
ANTHROPIC_API_KEYis not available vianaas_abi.secret,create_model()returnsNone.