It seems that Groq doesn't like tool calls in its message history?
library(elmer)
#' Get the current time
get_current_time <- function() {
format(Sys.time())
}
chat <- chat_groq(model="llama-3.2-1b-preview")
chat$register_tool(tool(
get_current_time,
"Get the current time."
))
print(chat$chat("What time is it?"))
print(chat$chat("How about now?"))
Result:
Error in `req_perform()`:
! HTTP 400 Bad Request.
• 'messages.4' : for 'role:assistant' the following must be satisfied[('messages.4.content' : value must be a string)]
It seems that Groq doesn't like tool calls in its message history?
Result: