tmc / langchaingo

LangChain for Go, the easiest way to write LLM-based programs in Go
https://tmc.github.io/langchaingo/
MIT License
4.38k stars 596 forks source link

Error running groq completion example #1028

Open deepakjois opened 1 week ago

deepakjois commented 1 week ago
$ ./groq-completion-example

2024/09/22 12:50:34 API returned unexpected status code: 400: property 'max_completion_tokens' is unsupported, did you mean 'max_tokens'?

I encountered this error when using it in my Go code as well. So this isnt an issue with the example, but probably with the underlying API call?

deepakjois commented 1 week ago

This may have broken the Groq integration: https://github.com/tmc/langchaingo/pull/1013

deepakjois commented 1 week ago

Is it possible to continue supporting max_tokens please, and special casing this for the o1 series of models.

For context, here is the response from OpenAI: https://community.openai.com/t/why-was-max-tokens-changed-to-max-completion-tokens/938077