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

Feature request: Allow specifying chat history for LMs #1435

Open
ShaojieJiang opened this issue Aug 28, 2024 · 2 comments
Open

Feature request: Allow specifying chat history for LMs #1435

ShaojieJiang opened this issue Aug 28, 2024 · 2 comments

Comments

@ShaojieJiang
Copy link

Hi DSPy developers,

First of all, thanks a lot for this great work!

Recently I've been trying to integrate DSPy into my work, but I stumbled upon the chat history specification. My task is to design a professional interviewer chatbot, therefore, the optimisation target for me is to optimise the conversation flow in diverse cases (such as with both cooperative and uncooperative interviewees). This is different from the existing DSPy modules which mostly focus on answer generation.

Although my task is also roughly answer generation, being able to specify the chat history is important. So I'm wondering is it already planned to add support for history specification? If not, do you think this aligns well with your development agenda?

For the moment I'll add the support in my inherited LM class. Looking forward to your response!

Best regards,
Shaojie Jiang

@ShaojieJiang
Copy link
Author

Update: I quickly realised that it's more complicated than I thought. After some investigation, I managed to make it work for my case. Please see the MWE:
chatbot.py.zip

Not sure I did it in an ideal way, but the solution looked quite hacky to me. Any suggestions on a better solution are much appreciated!

@okhat
Copy link
Collaborator

okhat commented Sep 1, 2024

Hey @ShaojieJiang ! What does specifying chat history mean? Do you mean passing multiple user/assistant turns to chat LMs?

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