langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Implemented appending arbitrary messages

Open eavanvalkenburg opened this issue 2 years ago • 1 comments

Implemented appending arbitrary messages to the base chat message history, the in-memory and cosmos ones.

As discussed this is the alternative way instead of #4480, with a add_message method added that takes a BaseMessage as input, so that the user can control what is in the base message like kwargs.

Fixes # (issue)

Before submitting

Who can review?

Community members can review the PR once tests pass. Tag maintainers/contributors who might be interested:

@hwchase17

eavanvalkenburg avatar May 26 '23 11:05 eavanvalkenburg

@hwchase17 -- Proposal seems to add an abstract method to add a custom message which seems reasonable to me -- it looks like a more appropriate method for the base schema than add_ai_message or add_human_message. Waiting for your :eye:

eyurtsev avatar May 26 '23 13:05 eyurtsev

Thanks @hwchase17

eavanvalkenburg avatar May 29 '23 14:05 eavanvalkenburg

@amitmukh this has been merged and release and will allow you to override the regular append_message behaviour

eavanvalkenburg avatar May 29 '23 17:05 eavanvalkenburg