Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

414 B
Raw Blame
import { Letta } from '@letta-ai/letta-client';
import type { ClientOptions } from './types';
import { LettaAuthType } from './auth';


export function getLettaClient(auth: LettaAuthType): Letta {
  const clientConfig: ClientOptions = {};
  
  if (auth.apiKey) {
    clientConfig.apiKey = auth.apiKey;
  }
  
  if (auth.baseUrl) {
    clientConfig.baseURL = auth.baseUrl;
  }

  return new Letta(clientConfig);
}