@salesforce/agents
Version:
Client side APIs for working with Salesforce agents
125 lines (124 loc) • 3.11 kB
TypeScript
export type SourceType = 'SFDRIVE' | 'KNOWLEDGE' | 'RETRIEVER';
export type RetrieverDetail = {
id: string;
label: string;
apiName?: string;
};
export type RetrieverActionDetail = {
id: string;
label: string;
apiName?: string;
};
export type StageArtifact = {
id: string;
label: string;
apiName?: string;
assetType: string;
};
export type DataLibrarySummary = {
libraryId: string;
masterLabel: string;
developerName: string;
description?: string;
sourceType: string;
status: string;
retriever?: RetrieverDetail;
retrieverAction?: RetrieverActionDetail;
};
export type GroundingFileRef = {
fileId: string;
fileName: string;
filePath: string;
fileSize: number;
createdDate?: string;
createdBy?: string;
status?: string;
};
export type DataLibraryDetail = {
libraryId: string;
masterLabel: string;
developerName: string;
description?: string;
sourceType: string;
status?: string;
retrieverId?: string;
retrieverLabel?: string;
dataSpaceScopeId?: string;
retriever?: RetrieverDetail;
retrieverAction?: RetrieverActionDetail;
totalFileCount?: number;
groundingSource?: {
[key: string]: unknown;
groundingSourceType?: string;
groundingFileRefs?: GroundingFileRef[];
};
};
export type StageDetail = {
name: string;
status: string;
completedAt?: number;
startedAt?: number;
error?: string;
artifacts?: StageArtifact[];
errorCode?: string;
};
export type IndexingStatusResponse = {
indexingStatus: {
libraryId: string;
status: string;
currentStage?: string;
stageDetails?: StageDetail[];
lastUpdatedAt?: number;
};
};
export type GroundingSource = {
sourceType: SourceType;
indexMode?: string;
retrieverId?: string;
knowledgeConfig?: {
primaryIndexField1?: string;
primaryIndexField2?: string;
contentFields?: string[];
dataCategorySelectionIds?: string[];
dataCategorySelectionNames?: string[];
isDataCategoryRuleEnabled?: boolean;
isRestrictToPublicArticle?: boolean;
};
};
export type CreateLibraryInput = {
masterLabel: string;
developerName: string;
description?: string;
groundingSource: GroundingSource;
};
export type UpdateLibraryInput = {
masterLabel?: string;
description?: string;
groundingSource?: {
sourceType: string;
knowledgeConfig?: {
contentFields?: string[];
isRestrictToPublicArticle?: boolean;
isDataCategoryRuleEnabled?: boolean;
};
retrieverId?: string;
};
};
export type UploadResult = {
libraryId: string;
retrieverId?: string;
ragFeatureConfigId?: string;
status: string;
};
export type FileAddResult = {
success: boolean;
fileName: string;
fileNames: string[];
libraryId: string;
};
export type FileListResponse = {
files: GroundingFileRef[];
totalSize: number;
currentPageUrl?: string;
nextPageUrl?: string;
};