@flashbacktech/flashbackclient 0.2.14 → 0.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api/client.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { UserUpdateRequest, UserUpdateResponse } from './types/platform/user';
|
|
|
18
18
|
import { CreateRepoAiApiKeyRequest, CreateRepoAiApiKeyResponse, DeleteRepoAiApiKeyResponse, GetRepoAiApiKeysResponse, UpdateRepoAiApiKeyRequest, UpdateRepoAiApiKeyResponse } from './types/ai/aiapikey';
|
|
19
19
|
import { AiLlmStatsResponse, CreateAiLlmRequest, CreateAiLlmResponse, DeleteAiLlmResponse, GetAiLlmsResponse, UpdateAiLlmRequest, UpdateAiLlmResponse, ValidateAiLlmResponse } from './types/ai/aillm';
|
|
20
20
|
import { CreatePolicyRequest, GetPoliciesQuery, GetPolicyViolationsQuery, GetPolicyViolationsResponse, PolicyDTO, UpdatePolicyRequest } from './types/ai/policy';
|
|
21
|
+
import { CreateConversationRequest, CreateConversationResponse, SendPromptRequest, SendPromptResponse, GetConversationsRequest, GetConversationsResponse, GetConversationMessagesResponse } from './types/ai/conversation';
|
|
21
22
|
interface ErrorResponse {
|
|
22
23
|
message?: string;
|
|
23
24
|
[key: string]: any;
|
|
@@ -230,6 +231,10 @@ export declare class ApiClient implements IApiClient {
|
|
|
230
231
|
getRepoAiApiKeys: (repoId: string) => Promise<GetRepoAiApiKeysResponse>;
|
|
231
232
|
updateRepoAiApiKey: (repoId: string, apikeyId: string, data: UpdateRepoAiApiKeyRequest) => Promise<UpdateRepoAiApiKeyResponse>;
|
|
232
233
|
deleteRepoAiApiKey: (repoId: string, apikeyId: string) => Promise<DeleteRepoAiApiKeyResponse>;
|
|
234
|
+
createConversation: (data: CreateConversationRequest) => Promise<CreateConversationResponse>;
|
|
235
|
+
sendPrompt: (conversationId: string, data: SendPromptRequest) => Promise<SendPromptResponse>;
|
|
236
|
+
getConversations: (query: GetConversationsRequest) => Promise<GetConversationsResponse>;
|
|
237
|
+
getConversationMessages: (conversationId: string) => Promise<GetConversationMessagesResponse>;
|
|
233
238
|
createPolicy: (data: CreatePolicyRequest) => Promise<{
|
|
234
239
|
success: boolean;
|
|
235
240
|
policy: PolicyDTO;
|
package/dist/api/client.js
CHANGED
|
@@ -539,6 +539,41 @@ class ApiClient {
|
|
|
539
539
|
this.deleteRepoAiApiKey = async (repoId, apikeyId) => {
|
|
540
540
|
return this.makeRequest(`repo/${repoId}/ai/apikey/${apikeyId}`, 'DELETE', null);
|
|
541
541
|
};
|
|
542
|
+
////// Conversation API calls
|
|
543
|
+
this.createConversation = async (data) => {
|
|
544
|
+
return this.makeRequest('conversation', 'POST', data);
|
|
545
|
+
};
|
|
546
|
+
this.sendPrompt = async (conversationId, data) => {
|
|
547
|
+
return this.makeRequest(`conversation/${conversationId}/prompt`, 'POST', data);
|
|
548
|
+
};
|
|
549
|
+
this.getConversations = async (query) => {
|
|
550
|
+
const queryParams = new URLSearchParams();
|
|
551
|
+
if (query.take !== undefined) {
|
|
552
|
+
queryParams.append('take', query.take.toString());
|
|
553
|
+
}
|
|
554
|
+
if (query.skip !== undefined) {
|
|
555
|
+
queryParams.append('skip', query.skip.toString());
|
|
556
|
+
}
|
|
557
|
+
if (query.from) {
|
|
558
|
+
queryParams.append('from', query.from);
|
|
559
|
+
}
|
|
560
|
+
if (query.to) {
|
|
561
|
+
queryParams.append('to', query.to);
|
|
562
|
+
}
|
|
563
|
+
if (query.userId) {
|
|
564
|
+
queryParams.append('userId', query.userId);
|
|
565
|
+
}
|
|
566
|
+
if (query.workspaceId) {
|
|
567
|
+
queryParams.append('workspaceId', query.workspaceId);
|
|
568
|
+
}
|
|
569
|
+
if (query.repoId) {
|
|
570
|
+
queryParams.append('repoId', query.repoId);
|
|
571
|
+
}
|
|
572
|
+
return this.makeRequest(`conversation?${queryParams.toString()}`, 'GET', null);
|
|
573
|
+
};
|
|
574
|
+
this.getConversationMessages = async (conversationId) => {
|
|
575
|
+
return this.makeRequest(`conversation/${conversationId}/messages`, 'GET', null);
|
|
576
|
+
};
|
|
542
577
|
////// Policy API calls
|
|
543
578
|
this.createPolicy = async (data) => {
|
|
544
579
|
return this.makeRequest('policy', 'POST', data);
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export interface CreateConversationRequest {
|
|
2
|
+
repoId: string;
|
|
3
|
+
}
|
|
4
|
+
export interface CreateConversationResponse {
|
|
5
|
+
success: boolean;
|
|
6
|
+
conversationId?: string;
|
|
7
|
+
message?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface SendPromptRequest {
|
|
10
|
+
prompt: string;
|
|
11
|
+
}
|
|
12
|
+
export interface SendPromptResponse {
|
|
13
|
+
success: boolean;
|
|
14
|
+
message?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface GetConversationsRequest {
|
|
17
|
+
take?: number;
|
|
18
|
+
skip?: number;
|
|
19
|
+
from?: string;
|
|
20
|
+
to?: string;
|
|
21
|
+
userId?: string;
|
|
22
|
+
workspaceId?: string;
|
|
23
|
+
repoId?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ConversationDTO {
|
|
26
|
+
id: string;
|
|
27
|
+
orgId: string;
|
|
28
|
+
createdBy: string;
|
|
29
|
+
createdAt: string;
|
|
30
|
+
lastUpdatedAt: string;
|
|
31
|
+
workspaceId: string;
|
|
32
|
+
repoId: string;
|
|
33
|
+
tokensIn: string;
|
|
34
|
+
tokensOut: string;
|
|
35
|
+
creator?: {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
lastName: string;
|
|
39
|
+
email: string;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export interface GetConversationsResponse {
|
|
43
|
+
success: boolean;
|
|
44
|
+
conversations: ConversationDTO[];
|
|
45
|
+
total: number;
|
|
46
|
+
message?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface MessageDTO {
|
|
49
|
+
id: string;
|
|
50
|
+
conversationId: string;
|
|
51
|
+
role: string;
|
|
52
|
+
content: string;
|
|
53
|
+
tokenCount?: number;
|
|
54
|
+
model?: string;
|
|
55
|
+
metadata?: Record<string, unknown>;
|
|
56
|
+
createdAt: string;
|
|
57
|
+
}
|
|
58
|
+
export interface GetConversationMessagesResponse {
|
|
59
|
+
success: boolean;
|
|
60
|
+
messages: MessageDTO[];
|
|
61
|
+
message?: string;
|
|
62
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { NodeStatusInfo, NodeStatusType } from './bridge';
|
|
2
|
+
import { RepoAiLlmInfo } from '../ai/aillm';
|
|
2
3
|
export declare enum StorageType {
|
|
3
4
|
S3 = "S3",
|
|
4
5
|
GCS = "GCS",
|
|
@@ -65,6 +66,7 @@ export interface CreateRepoRequest {
|
|
|
65
66
|
storageType: StorageType;
|
|
66
67
|
mode: ModeType;
|
|
67
68
|
repoUnits: RepoUnitInfo[];
|
|
69
|
+
repoAiLlms?: RepoAiLlmInfo[];
|
|
68
70
|
workspaceId: string;
|
|
69
71
|
}
|
|
70
72
|
export interface CreateRepoResponse {
|
|
@@ -100,6 +102,7 @@ export interface StorageRepo {
|
|
|
100
102
|
storageType: StorageType;
|
|
101
103
|
mode: ModeType;
|
|
102
104
|
units: RepoUnitInfo[];
|
|
105
|
+
aiLlms?: RepoAiLlmInfo[];
|
|
103
106
|
apiKeys?: ApiKey[];
|
|
104
107
|
createdAt: string;
|
|
105
108
|
disabled?: boolean;
|
|
@@ -223,6 +226,7 @@ export interface CreateRepoWithBucketsRequest {
|
|
|
223
226
|
storageType: StorageType;
|
|
224
227
|
mode: ModeType;
|
|
225
228
|
repoBuckets: RepoBucketInfo[];
|
|
229
|
+
repoAiLlms?: RepoAiLlmInfo[];
|
|
226
230
|
workspaceId: string;
|
|
227
231
|
}
|
|
228
232
|
export interface UpdateRepoWithBucketsRequest extends CreateRepoWithBucketsRequest {
|
|
@@ -234,6 +238,7 @@ export interface StorageRepoWithBuckets {
|
|
|
234
238
|
mode: ModeType;
|
|
235
239
|
workspaceId: string;
|
|
236
240
|
buckets: RepoBucketInfo[];
|
|
241
|
+
aiLlms?: RepoAiLlmInfo[];
|
|
237
242
|
apiKeys?: ApiKey[];
|
|
238
243
|
createdAt: string;
|
|
239
244
|
disabled?: boolean;
|