LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Client
  • AsyncClient
  • Run Helpers
  • Run Trees
  • Evaluation
  • Schemas
  • Utilities
  • Wrappers
  • Anonymizer
  • Testing
  • Expect API
  • Middleware
  • Pytest Plugin
  • Deployment SDK
  • RemoteGraph
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDKRemoteGraph
Language
Theme
Pythonlangsmithclientconvert_prompt_to_anthropic_format
Function●Since v0.1

convert_prompt_to_anthropic_format

Convert a prompt to Anthropic format.

Requires the langchain_anthropic package to be installed.

Copy
convert_prompt_to_anthropic_format(
  messages: Any,
  model_kwargs: Optional[dict[str, Any]] = None
) -> dict

Used in Docs

  • Manage prompts programmatically

Parameters

NameTypeDescription
messages*Any

The messages to convert.

model_kwargsOptional[Dict[str, Any]]
Default:None

Model configuration arguments including model_name and stop.

View source on GitHub