Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Groq: conversation history with tool calls causes HTTP 400 #162

Open
jcheng5 opened this issue Nov 18, 2024 · 2 comments
Open

Groq: conversation history with tool calls causes HTTP 400 #162

jcheng5 opened this issue Nov 18, 2024 · 2 comments

Comments

@jcheng5
Copy link
Collaborator

jcheng5 commented Nov 18, 2024

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)]
@jcheng5
Copy link
Collaborator Author

jcheng5 commented Nov 18, 2024

No such issue when using ollama with llama3.2. So appears to be Groq-specific.

@hadley
Copy link
Member

hadley commented Nov 18, 2024

Do you think this needs more than documentation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants