module RubyLLM::ActiveRecord::ChatFiles
The file store of a persisted chat, added by acts_as_chat with ChatMethods: the chatโs files live in ruby_llm_chat_files, with their content in Active Storage.
Public Instance Methods
Source
# File lib/ruby_llm/active_record/chat_files.rb, line 23 def with_file_store(store = RubyLLM::Chat::FileReferences::DEFAULT_STORE, **) store = FileStore.new(self) if store.equal?(RubyLLM::Chat::FileReferences::DEFAULT_STORE) to_llm.with_file_store(store, **) self end
Applies Chat#with_file_store and returns this record. Without a store, the chat keeps its files in Active Storage, in ruby_llm_chat_files (see ActiveRecord::FileStore), for the chatโs owner, the record acts_as_chat owner: names: that store writes files for the owner and sees only their files and the files without an owner. Pass nil to remove the store.
chat.with_file_store chat.with_file_store("tmp/chats/42") chat.with_file_store(:memory) chat.with_file_store(nil)