Generate text completions using Anthropic's API
Source:R/service-anthropic.R
create_completion_anthropic.Rd
Generate text completions using Anthropic's API
Usage
create_completion_anthropic(
prompt = list(list(role = "user", content = "Hello")),
system = NULL,
model = "claude-3-5-sonnet-20240620",
max_tokens = 1028,
key = Sys.getenv("ANTHROPIC_API_KEY")
)
Arguments
- prompt
The prompt for generating completions
- system
A system messages to instruct the model. Defaults to NULL.
- model
The model to use for generating text. By default, the function will try to use "claude-2.1".
- max_tokens
The maximum number of tokens to generate. Defaults to 256.
- key
The API key for accessing Anthropic's API. By default, the function will try to use the
ANTHROPIC_API_KEY
environment variable.