View source: R/service-anthropic.R
create_completion_anthropic | R Documentation |
Generate text completions using Anthropic's API
create_completion_anthropic(
prompt = list(list(role = "user", content = "Hello")),
system = NULL,
model = "claude-3-haiku-20240307",
max_tokens = 1028,
key = Sys.getenv("ANTHROPIC_API_KEY")
)
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 |
A list with the generated completions and other information returned by the API.
## Not run:
create_completion_anthropic(
prompt = "\n\nHuman: Hello, world!\n\nAssistant:",
model = "claude-3-haiku-20240307",
max_tokens = 1028
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.