listPersonas (lib/personas-api.ts)

DeepTutor · web/lib/personas-api.ts · typescript · Apache-2.0
ai

Client library for CRUD operations on personas via REST API.

// Source: https://github.com/HKUDS/DeepTutor | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import { apiFetch, apiUrl } from "@/lib/api";
import { invalidateClientCache, withClientCache } from "@/lib/client-cache";
import { asJsonOrThrow as asJson } from "@/lib/api";

const PERSONAS_CACHE_PREFIX = "personas:";

export type PersonaSource = "user" | "admin";

export interface PersonaInfo {
  name: string;
  description: string;
  source: PersonaSource;
  read_only: boolean;
}

export interface PersonaDetail extends PersonaInfo {
  content: string;
}

export interface CreatePersonaPayload {
  name: string;
  description: string;
  content: string;
}

export interface UpdatePersonaP

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key