tmc / langchaingo

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

using the mrkl agent with llama3 #790

Open nilsherzig opened 2 months ago

nilsherzig commented 2 months ago

Hi, I think there is a problem with llama3 and the mrkl chain.

The following stop word overwrite results in llama3 generating random things since its stop words are ignored.

https://github.com/tmc/langchaingo/blob/8707e51a48a1a85e4d3086a644a92b146a1623d2/agents/mrkl.go#L89

(after the joke and its stop words, it starts to hallucinate)

image

without this overwrite:

image

nilsherzig commented 2 months ago

might be related to https://github.com/langchain-ai/langchain/pull/20624

(not the empty array thing, but it looks like llama3 might need some extra care)