Open osanseviero opened 1 year ago
I think we are updating https://github.com/huggingface/discord-bots/blob/main/falcon.py with the new code from https://huggingface.co/spaces/freddyaboulton/falcon-180b-demo-gradio-discord-bot/blob/main/app.py#L2 . In this demo, we create a new client (see get_client
) for each thread, which allows to have similar behaviour.
So we should
Thanks to this, we would remove the need to store any information about the conversations in the bot code and keep things minimal
To touch back on this, do you think it still makes sense to explore? (not seeing a lot of usage from #codellama channel imo)
SG to not do this right now, let's explore in a follow-up if we see issues with this later on.
to retrieve the history from a thread you can use this :
history = await message.channel.history(limit=10).flatten()
# remove the first message which is the prompt
prompt = history.pop(0)
print("prompt :",prompt.content)
# print the history
print("history is ")
for h in history:
print(f"{h.author} : {h.content}")
new update for retrieving messages from history when using discord.py https://discordpy.readthedocs.io/en/latest/migrating.html#moving-away-from-custom-asynciterator
BTW for Falcon 180B, since we're using Freddy's as the template, would we need to adjust to a different Gradio interface to manually handle chathistory then?