Skip to content

Commit f95b236

Browse files
committed
available models printed, warning given if key is not working
1 parent e9daac2 commit f95b236

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

R/setupAgent.R

+3-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ setupAgent<-function(name=c("openai","replicate","generic"),
100100
if (is.null(model)){
101101
warning ("No model selected. Model will be set to gtp-3.5-turbo.")
102102
model = "gpt-3.5-turbo"
103-
}else if(!model%in% chatModels){
104-
stop(paste("Invalid model selected. Please choose one of the following models:\n ",chatModels))
103+
}else if(!model %in% chatModels){
104+
stop(paste("Invalid model selected. Please choose one of the following models:\n ",paste(chatModels,collapse=', ')))
105105
}
106106
}else if (type=="completion"){
107107
completionModels=strsplit("text-davinci-003, text-davinci-002, text-curie-001, text-babbage-001, text-ada-001",", ")[[1]]
@@ -171,6 +171,7 @@ getModels <- function (api_key){
171171

172172

173173
} else {
174+
warning('Request for available models failed. Check your API-key.')
174175
usable_models<-strsplit("gpt-4, gpt-4-0314, gpt-4-32k, gpt-4-32k-0314, gpt-3.5-turbo, gpt-3.5-turbo-0301, gpt-4o-mini, gpt-4o",", ")[[1]]
175176
return (usable_models)
176177
}

0 commit comments

Comments
 (0)