code: def create_session(
      user_id: str, session: Session, dbmanager: DBManager
  ) -> List[dict]:
      """
      Create a new session for a specific user in the database.
  
      :param user_id: The ID of the user whose session is to be created
      :param dbmanager: The DBManager instance to interact with the database
      :return: A list of dictionaries, each representing a session
      """
      query = "INSERT INTO sessions (user_id, id, timestamp, flow_config) VALUES (?, ?, ?,?)"
      args = (
          session.user_id,
          session.id,
          session.timestamp,
          json.dumps(session.flow_config.dict()),
      )
      dbmanager.query(query=query, args=args)
      sessions = get_sessions(user_id=user_id, dbmanager=dbmanager)
  
      return sessions
  
imports: import json
  import logging
  import sqlite3
  import threading
  import os
  from typing import Any, List, Dict, Optional, Tuple
  from ..datamodel import AgentFlowSpec, AgentWorkFlowConfig, Gallery, Message, Session, Skill
label_desc: Use image node_id 4 for calling a global function with example usage: create_session(user_id, session, dbmanager) and returns: sessions