@trainly/react 1.6.2 → 2.0.0

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.
@@ -1,14 +1,27 @@
1
1
  import { TrainlyConfig, Citation, UploadResult, FileListResult, FileDeleteResult, BulkUploadResult, TextContent } from "../types";
2
+ import { TestingClient } from "./TestingClient";
3
+ import { FineTuningClient } from "./FineTuningClient";
4
+ import { ConfigClient } from "./ConfigClient";
5
+ import { AnalyticsClient } from "./AnalyticsClient";
6
+ import { VersionsClient } from "./VersionsClient";
2
7
  interface QueryResponse {
3
8
  answer: string;
4
9
  citations?: Citation[];
5
10
  }
6
11
  export declare class TrainlyClient {
7
- private config;
12
+ private _config;
8
13
  private scopedToken;
9
14
  private currentUserId;
10
15
  private isV1Mode;
16
+ testing: TestingClient;
17
+ fineTuning?: FineTuningClient;
18
+ config: ConfigClient;
19
+ analytics: AnalyticsClient;
20
+ versions?: VersionsClient;
11
21
  constructor(config: TrainlyConfig);
22
+ private _initSubClients;
23
+ private _detectAuthMode;
24
+ private _getHeaders;
12
25
  /**
13
26
  * NEW: Connect using V1 Trusted Issuer authentication with OAuth ID token
14
27
  * This method allows users to authenticate directly with their OAuth provider tokens
@@ -19,6 +32,10 @@ export declare class TrainlyClient {
19
32
  includeCitations?: boolean;
20
33
  scope_filters?: Record<string, string | number | boolean>;
21
34
  }): Promise<QueryResponse>;
35
+ askStream(question: string, options?: {
36
+ scope_filters?: Record<string, string | number | boolean>;
37
+ onChunk?: (chunk: string) => void;
38
+ }): AsyncGenerator<string, void, unknown>;
22
39
  upload(file: File, scopeValues?: Record<string, string | number | boolean>): Promise<UploadResult>;
23
40
  uploadText(text: string, contentName: string, scopeValues?: Record<string, string | number | boolean>): Promise<UploadResult>;
24
41
  bulkUploadFiles(files: File[], scopeValues?: Record<string, string | number | boolean>): Promise<BulkUploadResult>;
@@ -27,6 +44,23 @@ export declare class TrainlyClient {
27
44
  deleteFile(fileId: string): Promise<FileDeleteResult>;
28
45
  private waitForFileReady;
29
46
  private getChatId;
47
+ getChatSettings(): Promise<{
48
+ success: boolean;
49
+ chat_id?: string;
50
+ settings?: any;
51
+ }>;
52
+ updateChatSettings(settings: {
53
+ custom_prompt?: string;
54
+ temperature?: number;
55
+ max_tokens?: number;
56
+ selected_model?: string;
57
+ }): Promise<{
58
+ success: boolean;
59
+ chat_id?: string;
60
+ updated?: any;
61
+ settings?: any;
62
+ message?: string;
63
+ }>;
30
64
  private extractChatId;
31
65
  private generateAnonymousId;
32
66
  }