if (FALSE) {
# Set your Dify API key in the environment or pass it directly
Sys.setenv(DIFY_API_KEY = "YOUR-DIFY-SECRET-KEY")
# Basic usage
response <- DifyChat4R(query = "Hello world!")
print(response)
# With conversation context
response <- DifyChat4R(
query = "How are you?",
conversation_id = "conv-123",
user = "user-456"
)
print(response)
}
Run the code above in your browser using DataLab