setKey {MacBehaviour} | R Documentation |
Step1: Set model's API key and url.
Description
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.
Usage
setKey(api_key, api_url = "https://api.openai.com/v1/chat/completions", model)
Arguments
api_key |
A character string: the user's OpenAI/huggingface/gemini/claude/baichuan/other API key.Please fill 'NA' for self-deployed models. |
api_url |
A character string: the user's OpenAI/huggingface/gemini/claude/baichuan/other url .default is OpenAI. for gemini, you just input "https://generativelanguage.googleapis.com/" |
model |
A character string: specify the model version.For gemini, you could input "gemini-pro" |
Value
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.
Examples
## Not run:
set_key(api_key="YOUR_API_KEY", api_url="api.openai.com/v1/chat/completions",model="gpt-3.5-turbo")
## End(Not run)
[Package MacBehaviour version 1.2.4 Index]