Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

1023 B
Raw Blame
import pick from 'lodash/pick';
import type { TConversation } from 'librechat-data-provider';

export const isTemporaryConversation = (conversation?: Partial<TConversation> | null): boolean =>
  conversation?.isTemporary === true ||
  (conversation?.isTemporary === undefined && conversation?.expiredAt != null);

const sidebarFields = [
  'conversationId',
  'title',
  'endpoint',
  'endpointType',
  'model',
  'modelLabel',
  'chatGptLabel',
  'agent_id',
  'assistant_id',
  'spec',
  'iconURL',
  'user',
  'chatProjectId',
  'pinned',
  'isArchived',
  'isShared',
  'createdAt',
  'updatedAt',
  'archivedAt',
  'lastResponseAt',
  'lastResponseMessageId',
  'lastResponseIsManual',
  'isMarkedUnread',
  'lastSeenAt',
  'isTemporary',
  'expiredAt',
] as const satisfies readonly (keyof TConversation)[];

/** Sidebar metadata may overlay navigation records; chat-owned settings must not. */
export const toSidebarConversation = (conversation: TConversation): TConversation =>
  pick(conversation, sidebarFields);