Abraxas-365 / langchain-rust

🦜️🔗LangChain for Rust, the easiest way to write LLM-based programs in Rust
MIT License
632 stars 83 forks source link

fix: remove extraneous user message in Agent response. #236

Closed chirino closed 1 month ago

Abraxas-365 commented 1 month ago

Can you explain this pls 😄

chirino commented 1 month ago

Without this change the memory would contain a user message like "1" or "2". I think the number would depend on the number of user messages in the chat context that were sent to the agent. Seems weird that this would be add to the chat memory as a user message given the user did not say "1" or "2".

Should I not be trying to preserve the Agent memory between chat call invocations?

chirino commented 1 month ago

Could you explain what the line memory.add_user_message(&input_variables["input"]); is doing?

chirino commented 1 month ago

I found a bug on my side. I think might be invalid.