GenkitG
Genkit14mo ago
sour-pink

firebase does not like saving state

firebase does not like saving state objects with tools

hack to get save working

  async save(sessionId: string, sessionData: SessionData<S>): Promise<void> {
    const fs = new FirestoreService();
    const data: SessionData<S> = JSON.parse(JSON.stringify(sessionData)); // <-- hack
    fs.addOrUpdateDocument(COLLECTIONS.CHAT_SESSIONS, data, sessionId)
    
  }
Was this page helpful?