setKey: Step1: Set model's API key and url.

View source: R/tools.R

setKeyR 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, model, api_url = NULL, ...)

Arguments

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).

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", model="gpt-3.5-turbo", api_url="api.openai.com/v1/chat/completions")

## End(Not run)

MacBehaviour documentation built on Oct. 21, 2024, 1:07 a.m.