chat_claude: Chat with Anthropic Claude

View source: R/providers.R

chat_claudeR Documentation

Chat with Anthropic Claude

Description

Convenience wrapper for 'Anthropic' 'Claude' models.

Usage

chat_claude(prompt, model = "claude-3-5-sonnet-latest", ...)

Arguments

prompt

Character. The user message to send.

model

Character. Model name (e.g., "gpt-4o", "claude-3-5-sonnet-latest", "llama3.2").

...

Additional parameters passed to the API.

Value

The assistant's response as a character string, or a list when history is in use. See chat for details.

Examples

## Not run: 
chat_claude("Explain the theory of relativity")
chat_claude("Write a poem", model = "claude-3-5-haiku-latest")

## End(Not run)

llm.api documentation built on April 16, 2026, 5:08 p.m.