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

Any reason to only allow loading sessions from CSV and JSON files vs an in memory list? #87

Open
jeanmaried opened this issue Oct 7, 2023 · 0 comments

Comments

@jeanmaried
Copy link

jeanmaried commented Oct 7, 2023

I store my messages in firebase and am wondering if there is a clean way to create a session without having a .json or .csv file in my file system?

I thought I would try something like this:

chat_messages = []

for message in fb_messages:
        chat_message = ChatMessage(
            role=message['role'], content=message['content'])
        chat_messages.append(chat_message)
        
ai.default_session.messages = chat_messages

ai("Hey there")

This stores the messages but when I call ai I get an error:

AttributeError: 'dict' object has no attribute 'model_dump'

This feels like a common enough use case that the solution could be abstracted into this library. I'm curious if there is either a reason for using files over in memory or if there is a way to upload an in memory list that I am missing?

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

1 participant