setKey | R Documentation |
This function allows users to set and verify an API key for data collection. You can change the default api_url for others models' API.
setKey(api_key, model, api_url = NULL, ...)
api_key |
A character string: the user's OpenAI/huggingface/gemini/claude/baichuan/other API key. Please fill 'NA' for self-deployed models. |
model |
A character string: specify the model version. For gemini, you could input "gemini-pro" |
api_url |
A character string: the API URL for the model. If not specified, the default Chat completion URL will be used based on the api_key. |
... |
Additional arguments to be passed (currently not used, but kept for future extensibility). |
Prints a message to the console indicating whether the API key setup was successful. If the setup fails, the function stops with an error message.
## Not run:
set_key(api_key="YOUR_API_KEY", model="gpt-3.5-turbo", api_url="api.openai.com/v1/chat/completions")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.