LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Agent
  • Middleware
  • Backends
  • Sandboxes
  • Skills
  • Subagents
  • Types
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
  • Vitest
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewAgentMiddlewareBackendsSandboxesSkillsSubagentsTypes
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
Vitest
Language
Theme
JavaScriptdeepagentsprofilesvalidateProfileKey
Function●Since v1.10

validateProfileKey

Copy
validateProfileKey(key: string): string
View source on GitHub

Parameters

NameTypeDescription
key*string

Example

Normalize and validate a profile registry key.

Trims leading/trailing whitespace, then enforces the "provider" or "provider:model" shape. Rejects empty strings, multiple colons, and empty halves.

The registry key to validate.

Copy
validateProfileKey("anthropic:claude-opus-4-7"); // "anthropic:claude-opus-4-7"
validateProfileKey("  openai  ");                 // "openai"
validateProfileKey("openai:");                    // throws
validateProfileKey("");                            // throws