claude_3_5_sonnet
What it is
- A non-functional template for configuring an Anthropic
claude-3-5-sonnetchat model for the Community Manager domain. - Provides a
create_model()factory that attempts to create alangchain_anthropic.ChatAnthropicinstance, gated by theANTHROPIC_API_KEYsecret.
Public API
create_model() -> ChatAnthropic | None- Logs a warning that this is not functional yet.
- Reads
ANTHROPIC_API_KEYvianaas_abi.secret.get. - Returns:
- a configured
ChatAnthropicinstance if the key is present Noneif the key is missing (and logs an error)
- a configured
- Module variable:
model- Currently set to
None(comment indicates it “would be”create_model()).
- Currently set to
Configuration/Dependencies
- Dependencies:
langchain_anthropic.ChatAnthropicnaas_abi.secret(used to retrieveANTHROPIC_API_KEY)naas_abi_core.logger(warning/error logging)
- Required secret/environment:
ANTHROPIC_API_KEY
- Model parameters (as configured in code):
model="claude-3-5-sonnet"temperature=0.1max_tokens=4000
Usage
from naas_abi_marketplace.domains.community_manager.models.claude_3_5_sonnet import create_model
model = create_model()
if model is None:
raise RuntimeError("Missing ANTHROPIC_API_KEY or model not available")
# Use `model` per langchain_anthropic.ChatAnthropic API
Caveats
- The module is explicitly marked “NOT FUNCTIONAL YET - template only” and always logs a warning when
create_model()is called. modelis not instantiated automatically (it remainsNone).