Skip to main content

Class: Projects

Defined in: src/utils/projects.ts Projects class for managing projects in the Galileo platform. Delegates to the internal GalileoApiClient for API interactions.

Constructors

Constructor

new Projects(): Projects;

Returns

Projects

Methods

addUserCollaborators()

addUserCollaborators(collaborators: object[], projectId?: string): Promise<object[]>;
Defined in: src/utils/projects.ts Adds user collaborators to a project.

Parameters

collaborators
object[] Collaborator payloads to create.
projectId?
string (Optional) Project ID override when client is not project-scoped.

Returns

Promise<object[]> A promise that resolves to the created collaborators.

create()

create(name: string, options?: ProjectCreateOptions): Promise<{
  createdAt: string;
  createdBy?: null | string;
  id: string;
  name?: null | string;
  type?:   | null
     | "prompt_evaluation"
     | "llm_monitor"
     | "gen_ai"
     | "training_inference"
     | "protect";
  updatedAt: string;
}>;
Defined in: src/utils/projects.ts Creates a new project.

Parameters

name
string Name of the project.
options?
ProjectCreateOptions (Optional) Additional project creation settings.

Returns

Promise<{ createdAt: string; createdBy?: null | string; id: string; name?: null | string; type?: | null | "prompt_evaluation" | "llm_monitor" | "gen_ai" | "training_inference" | "protect"; updatedAt: string; }> A promise that resolves to the created project.

delete()

delete(options: GetProjectOptions): Promise<{
  message: string;
}>;
Defined in: src/utils/projects.ts Deletes a project by ID or name without falling back to defaults.

Parameters

options
GetProjectOptions The deletion options.

Returns

Promise<{ message: string; }> A promise that resolves to the delete response payload.

get()

get(options: GetProjectOptions): Promise<{
  bookmark?: boolean;
  createdAt: string;
  createdBy: string;
  createdByUser: {
     email: string;
     firstName?: null | string;
     id: string;
     lastName?: null | string;
  };
  description?: null | string;
  id: string;
  labels?: "sample"[];
  name?: null | string;
  permissions?: object[];
  runs: object[];
  type?:   | null
     | "prompt_evaluation"
     | "llm_monitor"
     | "gen_ai"
     | "training_inference"
     | "protect";
  updatedAt: string;
}>;
Defined in: src/utils/projects.ts Gets a project by ID or name.

Parameters

options
GetProjectOptions The lookup options.

Returns

Promise<{ bookmark?: boolean; createdAt: string; createdBy: string; createdByUser: { email: string; firstName?: null | string; id: string; lastName?: null | string; }; description?: null | string; id: string; labels?: "sample"[]; name?: null | string; permissions?: object[]; runs: object[]; type?: | null | "prompt_evaluation" | "llm_monitor" | "gen_ai" | "training_inference" | "protect"; updatedAt: string; }> A promise that resolves to the matching project.

getAllUserCollaborators()

getAllUserCollaborators(projectId?: string): Promise<object[]>;
Defined in: src/utils/projects.ts Lists every user collaborator for a project, exhausting pagination tokens.

Parameters

projectId?
string (Optional) The project ID to list collaborators for.

Returns

Promise<object[]> A promise that resolves to all collaborators for the project.

getWithEnvFallbacks()

getWithEnvFallbacks(options: GetProjectOptions): Promise<{
  bookmark?: boolean;
  createdAt: string;
  createdBy: string;
  createdByUser: {
     email: string;
     firstName?: null | string;
     id: string;
     lastName?: null | string;
  };
  description?: null | string;
  id: string;
  labels?: "sample"[];
  name?: null | string;
  permissions?: object[];
  runs: object[];
  type?:   | null
     | "prompt_evaluation"
     | "llm_monitor"
     | "gen_ai"
     | "training_inference"
     | "protect";
  updatedAt: string;
}>;
Defined in: src/utils/projects.ts Gets a project by ID or name, falling back to environment configuration when omitted.

Parameters

options
GetProjectOptions The lookup options.

Returns

Promise<{ bookmark?: boolean; createdAt: string; createdBy: string; createdByUser: { email: string; firstName?: null | string; id: string; lastName?: null | string; }; description?: null | string; id: string; labels?: "sample"[]; name?: null | string; permissions?: object[]; runs: object[]; type?: | null | "prompt_evaluation" | "llm_monitor" | "gen_ai" | "training_inference" | "protect"; updatedAt: string; }> A promise that resolves to the matching project.

list()

list(projectType?:
  | "prompt_evaluation"
  | "llm_monitor"
  | "gen_ai"
  | "training_inference"
| "protect"): Promise<object[]>;
Defined in: src/utils/projects.ts Lists projects available to the authenticated user.

Parameters

projectType?
(Optional) Project type filter to apply. "prompt_evaluation" | "llm_monitor" | "gen_ai" | "training_inference" | "protect"

Returns

Promise<object[]> A promise that resolves to the matching projects.

removeUserCollaborator()

removeUserCollaborator(userId: string, projectId: string): Promise<void>;
Defined in: src/utils/projects.ts Removes a user collaborator from a project.

Parameters

userId
string ID of the collaborator to remove.
projectId
string Project ID that the collaborator belongs to.

Returns

Promise<void> A promise that resolves when removal succeeds.

shareWithUser()

shareWithUser(
   projectId: string,
   userId: string,
   role: "owner" | "editor" | "annotator" | "viewer"): Promise<{
  createdAt: string;
  email: string;
  firstName: null | string;
  id: string;
  lastName: null | string;
  permissions?: object[];
  role: "owner" | "editor" | "annotator" | "viewer";
  userId: string;
}>;
Defined in: src/utils/projects.ts Shares a project with a single user.

Parameters

projectId
string ID of the project to share.
userId
string ID of the user receiving access.
role
(Optional) Role to assign to the user (defaults to viewer). "owner" | "editor" | "annotator" | "viewer"

Returns

Promise<{ createdAt: string; email: string; firstName: null | string; id: string; lastName: null | string; permissions?: object[]; role: "owner" | "editor" | "annotator" | "viewer"; userId: string; }> A promise that resolves to the created collaborator record.

unshareWithUser()

unshareWithUser(projectId: string, userId: string): Promise<void>;
Defined in: src/utils/projects.ts Removes a user’s access to a project.

Parameters

projectId
string ID of the project to unshare.
userId
string ID of the user losing access.

Returns

Promise<void> A promise that resolves when the user is unshared.

updateUserCollaborator()

updateUserCollaborator(
   userId: string,
   update: object,
   projectId?: string): Promise<{
  createdAt: string;
  email: string;
  firstName: null | string;
  id: string;
  lastName: null | string;
  permissions?: object[];
  role: "owner" | "editor" | "annotator" | "viewer";
  userId: string;
}>;
Defined in: src/utils/projects.ts Updates a user collaborator assignment.

Parameters

userId
string ID of the collaborator to update.
update
Update payload describing the collaborator changes.
role
"owner" | "editor" | "annotator" | "viewer" (Optional) Updated role for the collaborator.
projectId?
string (Optional) Project ID override when client is not project-scoped.

Returns

Promise<{ createdAt: string; email: string; firstName: null | string; id: string; lastName: null | string; permissions?: object[]; role: "owner" | "editor" | "annotator" | "viewer"; userId: string; }> A promise that resolves to the updated collaborator.