@squidcloud/client 1.0.124 → 1.0.126

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/cjs/index.js CHANGED
@@ -26388,7 +26388,7 @@ const AiAssistantMutateRequestSchema = {
26388
26388
  properties: {
26389
26389
  modelName: {
26390
26390
  type: 'string',
26391
- enum: ['gpt-3.5-turbo', 'gpt-4'],
26391
+ enum: ['gpt-3.5-turbo', 'gpt-4', 'claude-2'],
26392
26392
  },
26393
26393
  strictContext: {
26394
26394
  type: 'boolean',
@@ -26442,7 +26442,7 @@ const AiAssistantMutateRequestSchema = {
26442
26442
  properties: {
26443
26443
  modelName: {
26444
26444
  type: 'string',
26445
- enum: ['gpt-3.5-turbo', 'gpt-4'],
26445
+ enum: ['gpt-3.5-turbo', 'gpt-4', 'claude-2'],
26446
26446
  },
26447
26447
  strictContext: {
26448
26448
  type: 'boolean',
@@ -26531,13 +26531,16 @@ const AiAssistantMutateRequestSchema = {
26531
26531
 
26532
26532
  ;// CONCATENATED MODULE: ../common/src/ai-assistant.types.ts
26533
26533
  /** @internal */
26534
- const OpenAiModelData = {
26534
+ const AiModelData = {
26535
26535
  'gpt-4': {
26536
26536
  tokens: 8192,
26537
26537
  },
26538
26538
  'gpt-3.5-turbo': {
26539
26539
  tokens: 4096,
26540
26540
  },
26541
+ 'claude-2': {
26542
+ tokens: 100000,
26543
+ },
26541
26544
  };
26542
26545
 
26543
26546
  ;// CONCATENATED MODULE: ../common/src/integrations/observability.types.ts
@@ -26613,6 +26616,7 @@ var IntegrationType;
26613
26616
  IntegrationType["db2"] = "db2";
26614
26617
  IntegrationType["mariadb"] = "mariadb";
26615
26618
  IntegrationType["oracledb"] = "oracledb";
26619
+ IntegrationType["pinot"] = "pinot";
26616
26620
  IntegrationType["redis"] = "redis";
26617
26621
  IntegrationType["xata"] = "xata";
26618
26622
  IntegrationType["azure_sql"] = "azure_sql";
@@ -26634,6 +26638,7 @@ const DatabaseIntegrationTypes = [
26634
26638
  IntegrationType.cockroach,
26635
26639
  IntegrationType.snowflake,
26636
26640
  IntegrationType.oracledb,
26641
+ IntegrationType.pinot,
26637
26642
  ];
26638
26643
  const ApiIntegrationTypes = [IntegrationType.api, IntegrationType.graphql];
26639
26644
  const ObservabilityIntegrationTypes = [IntegrationType.datadog, IntegrationType.newrelic];
@@ -26713,6 +26718,25 @@ const OracleConnectionOptionsSchema = {
26713
26718
  connectionLimit: { type: 'number', nullable: false },
26714
26719
  },
26715
26720
  };
26721
+ const PinotConnectionOptionsSchema = {
26722
+ type: 'object',
26723
+ nullable: false,
26724
+ required: ['brokerUrl', 'controllerUrl'],
26725
+ properties: {
26726
+ brokerUrl: { type: 'string', nullable: false },
26727
+ controllerUrl: { type: 'string', nullable: false },
26728
+ user: { type: 'string', nullable: false },
26729
+ secrets: {
26730
+ type: 'object',
26731
+ required: ['password'],
26732
+ nullable: false,
26733
+ properties: {
26734
+ password: { type: 'string', nullable: false, isSecret: {} },
26735
+ },
26736
+ },
26737
+ connectionLimit: { type: 'number', nullable: false },
26738
+ },
26739
+ };
26716
26740
  const MssqlConnectionOptionsSchema = {
26717
26741
  type: 'object',
26718
26742
  nullable: false,
@@ -26940,6 +26964,27 @@ const UpsertIntegrationRequestSchema = {
26940
26964
  },
26941
26965
  },
26942
26966
  },
26967
+ {
26968
+ type: 'object',
26969
+ properties: {
26970
+ type: { const: IntegrationType.pinot },
26971
+ config: {
26972
+ type: 'object',
26973
+ required: ['configuration'],
26974
+ properties: {
26975
+ supportsExternalChanges: { type: 'boolean', nullable: true },
26976
+ configuration: {
26977
+ type: 'object',
26978
+ nullable: false,
26979
+ required: ['connectionOptions'],
26980
+ properties: {
26981
+ connectionOptions: PinotConnectionOptionsSchema,
26982
+ },
26983
+ },
26984
+ },
26985
+ },
26986
+ },
26987
+ },
26943
26988
  {
26944
26989
  type: 'object',
26945
26990
  properties: {
@@ -27327,6 +27372,20 @@ const TestDataConnectionRequestSchema = {
27327
27372
  },
27328
27373
  },
27329
27374
  },
27375
+ {
27376
+ type: 'object',
27377
+ required: ['configuration'],
27378
+ properties: {
27379
+ type: { const: IntegrationType.pinot },
27380
+ configuration: {
27381
+ type: 'object',
27382
+ required: ['connectionOptions'],
27383
+ properties: {
27384
+ connectionOptions: PinotConnectionOptionsSchema,
27385
+ },
27386
+ },
27387
+ },
27388
+ },
27330
27389
  {
27331
27390
  type: 'object',
27332
27391
  required: ['configuration'],
@@ -27434,6 +27493,14 @@ const DiscoverDataConnectionSchemaRequestSchema = {
27434
27493
  connectionOptions: OracleConnectionOptionsSchema,
27435
27494
  },
27436
27495
  },
27496
+ {
27497
+ type: 'object',
27498
+ required: ['connectionOptions'],
27499
+ properties: {
27500
+ integrationType: { const: IntegrationType.pinot },
27501
+ connectionOptions: PinotConnectionOptionsSchema,
27502
+ },
27503
+ },
27437
27504
  {
27438
27505
  type: 'object',
27439
27506
  required: ['connectionOptions'],
@@ -32287,7 +32354,7 @@ class AiAssistantClient {
32287
32354
  .observeNotifications()
32288
32355
  .pipe((0,external_rxjs_namespaceObject.filter)((notification) => notification.type === 'aiAssistant'), map_map((n) => n))
32289
32356
  .subscribe((notification) => {
32290
- this.handleChatResponse(notification);
32357
+ this.handleChatResponse(notification).then();
32291
32358
  });
32292
32359
  }
32293
32360
  /**
@@ -32310,10 +32377,11 @@ class AiAssistantClient {
32310
32377
  *
32311
32378
  * @param profileId - The profile id.
32312
32379
  * @param prompt - The prompt.
32380
+ * @param options - The options to send to the chat model.
32313
32381
  * @returns An observable that emits when a new response token is received. The emitted value is the entire response
32314
32382
  * that has been received so far.
32315
32383
  */
32316
- chat(profileId, prompt) {
32384
+ chat(profileId, prompt, options) {
32317
32385
  const clientRequestId = generateId();
32318
32386
  let accumulatedValue = '';
32319
32387
  const subject = new external_rxjs_namespaceObject.Subject();
@@ -32341,6 +32409,7 @@ class AiAssistantClient {
32341
32409
  const request = {
32342
32410
  profileId,
32343
32411
  prompt,
32412
+ options,
32344
32413
  integrationId: this.integrationId,
32345
32414
  clientRequestId,
32346
32415
  };
@@ -32378,11 +32447,12 @@ class AiAssistantProfileReference {
32378
32447
  * Sends a prompt to the current profile.
32379
32448
  *
32380
32449
  * @param prompt - The prompt.
32450
+ * @param options - The chat options.
32381
32451
  * @returns An observable that emits when a new response token is received. The emitted value is the entire response
32382
32452
  * that has been received so far.
32383
32453
  */
32384
- chat(prompt) {
32385
- return this.client.chat(this.profileId, prompt);
32454
+ chat(prompt, options) {
32455
+ return this.client.chat(this.profileId, prompt, options);
32386
32456
  }
32387
32457
  /**
32388
32458
  * Retrieves a context reference for the current profile. A context reference can be used to add a new context entry
@@ -32410,7 +32480,7 @@ class AiAssistantProfileReference {
32410
32480
  * Adds a new profile to the assistant. This will result in an error if a profile already exists with the same id.
32411
32481
  *
32412
32482
  * @param data An object containing options for creating the profile.
32413
- * @param data.modelName - The name of the OpenAI model (`gpt-3.5 or `gpt-4`).
32483
+ * @param data.modelName - The name of the OpenAI model (`gpt-3.5, `gpt-4` or `claude-2`).
32414
32484
  * @param data.isPublic - Whether the chat functionality of the profile can be accessed without security rules.
32415
32485
  * @returns A promise that resolves when the profile is successfully created.
32416
32486
  */
@@ -32435,7 +32505,7 @@ class AiAssistantProfileReference {
32435
32505
  * current profile id.
32436
32506
  *
32437
32507
  * @param data An object containing options for updating the profile.
32438
- * @param data.modelName - The name of the OpenAI model (`gpt-3.5 or `gpt-4`).
32508
+ * @param data.modelName - The name of the OpenAI model (`gpt-3.5, `gpt-4` or `claude-2`).
32439
32509
  * @param data.isPublic - Whether the chat functionality of the profile can be accessed without security rules.
32440
32510
  * @returns A promise that resolves when the profile is successfully updated.
32441
32511
  */
@@ -32485,6 +32555,7 @@ class AiAssistantContextReference {
32485
32555
  * @param data An object containing options for creating the entry.
32486
32556
  * @param data.title - The title of the entry.
32487
32557
  * @param data.context - The context data.
32558
+ * @param file - The file to insert.
32488
32559
  * @returns A promise that resolves when the context is successfully created.
32489
32560
  */
32490
32561
  insert(data, file) {
@@ -1,5 +1,5 @@
1
- /** The supported Open AI model names. */
2
- export type OpenAiModelName = 'gpt-3.5-turbo' | 'gpt-4';
1
+ /** The supported AI model names. */
2
+ export type AiModelName = 'gpt-3.5-turbo' | 'gpt-4' | 'claude-2';
3
3
  export type AiAssistantContextType = 'text' | 'url' | 'file';
4
4
  export interface AiAssistantTextContext {
5
5
  type: 'text';
@@ -14,3 +14,8 @@ export interface AiAssistantFileContext {
14
14
  data: string;
15
15
  }
16
16
  export type AiAssistantContext = AiAssistantTextContext | AiAssistantUrlContext | AiAssistantFileContext;
17
+ export interface AiAssistantChatOptions {
18
+ maxTokens?: number;
19
+ chatId?: string;
20
+ disableHistory?: boolean;
21
+ }
@@ -9,4 +9,5 @@ export type EnvironmentId = 'prod' | 'dev';
9
9
  export declare const allEnvironmentIds: Array<EnvironmentId>;
10
10
  /** A type alias for an integration id. */
11
11
  export type IntegrationId = string;
12
+ export type ChatId = string;
12
13
  export type SquidDeveloperId = string;
@@ -1,4 +1,4 @@
1
- import { OpenAiModelName } from '../ai-assistant.types';
1
+ import { AiModelName } from '../ai-assistant.types';
2
2
  import { IntegrationId } from '../communication.types';
3
3
  import { BaseIntegrationConfig, IntegrationType } from './index';
4
4
  export interface AiAssistantIntegrationConfig extends BaseIntegrationConfig {
@@ -9,7 +9,7 @@ export type AiAssistantConfiguration = {
9
9
  apiKey?: string;
10
10
  };
11
11
  export type AiAssistantProfileMetadata = {
12
- modelName: OpenAiModelName;
12
+ modelName: AiModelName;
13
13
  isPublic: boolean;
14
14
  strictContext: boolean;
15
15
  instructions: Record<string, string>;
@@ -26,6 +26,9 @@ export interface MySqlConnectionSecretOptions {
26
26
  export interface OracleConnectionSecretOptions {
27
27
  password: string;
28
28
  }
29
+ export interface PinotConnectionSecretOptions {
30
+ password?: string;
31
+ }
29
32
  export interface MssqlConnectionSecretOptions {
30
33
  password: string;
31
34
  }
@@ -48,6 +51,13 @@ export interface OracleConnectionOptions {
48
51
  database: string;
49
52
  connectionLimit?: number;
50
53
  }
54
+ export interface PinotConnectionOptions {
55
+ secrets: PinotConnectionSecretOptions;
56
+ brokerUrl: string;
57
+ controllerUrl: string;
58
+ user?: string;
59
+ connectionLimit?: number;
60
+ }
51
61
  export interface MssqlConnectionOptions {
52
62
  secrets: MssqlConnectionSecretOptions;
53
63
  host: string;
@@ -92,6 +102,9 @@ export interface MySqlIntegrationConfiguration {
92
102
  export interface OracleIntegrationConfiguration {
93
103
  connectionOptions: OracleConnectionOptions;
94
104
  }
105
+ export interface PinotIntegrationConfiguration {
106
+ connectionOptions: PinotConnectionOptions;
107
+ }
95
108
  export interface MssqlIntegrationConfiguration {
96
109
  connectionOptions: MssqlConnectionOptions;
97
110
  }
@@ -112,6 +125,10 @@ export interface OracleIntegrationConfig extends BaseDatabaseIntegrationConfig {
112
125
  type: IntegrationType.oracledb;
113
126
  configuration: OracleIntegrationConfiguration;
114
127
  }
128
+ export interface PinotIntegrationConfig extends BaseDatabaseIntegrationConfig {
129
+ type: IntegrationType.pinot;
130
+ configuration: PinotIntegrationConfiguration;
131
+ }
115
132
  export interface MssqlIntegrationConfig extends BaseDatabaseIntegrationConfig {
116
133
  type: IntegrationType.mssql;
117
134
  configuration: MssqlIntegrationConfiguration;
@@ -7,7 +7,7 @@ import { IntegrationId } from '../communication.types';
7
7
  import { AiAssistantIntegrationConfig } from './ai_assistant.types';
8
8
  import { GraphQLIntegrationConfig, HttpApiIntegrationConfig, IntegrationApiSchema, IntegrationGraphQLSchema, TestGraphQLDataConnectionRequest } from './api.types';
9
9
  import { Auth0IntegrationConfig, CognitoIntegrationConfig, JwtHmacIntegrationConfig, JwtRsaIntegrationConfig, OktaIntegrationConfig } from './auth.types';
10
- import { BaseDatabaseIntegrationConfig, CockroachIntegrationConfig, IntegrationDataSchema, InternalIntegrationConfig, MongoIntegrationConfig, MssqlIntegrationConfig, MySqlIntegrationConfig, OracleIntegrationConfig, PostgresIntegrationConfig, SnowflakeIntegrationConfig, TestDataConnectionRequest } from './database.types';
10
+ import { BaseDatabaseIntegrationConfig, CockroachIntegrationConfig, IntegrationDataSchema, InternalIntegrationConfig, MongoIntegrationConfig, MssqlIntegrationConfig, MySqlIntegrationConfig, OracleIntegrationConfig, PinotIntegrationConfig, PostgresIntegrationConfig, SnowflakeIntegrationConfig, TestDataConnectionRequest } from './database.types';
11
11
  import { DatadogIntegrationConfig, NewRelicIntegrationConfig } from './observability.types';
12
12
  export declare enum IntegrationCategory {
13
13
  'database' = "database",
@@ -51,6 +51,7 @@ export declare enum IntegrationType {
51
51
  'db2' = "db2",
52
52
  'mariadb' = "mariadb",
53
53
  'oracledb' = "oracledb",
54
+ 'pinot' = "pinot",
54
55
  'redis' = "redis",
55
56
  'xata' = "xata",
56
57
  'azure_sql' = "azure_sql",
@@ -67,6 +68,7 @@ export interface IntegrationConfigTypes {
67
68
  [IntegrationType.mongo]: MongoIntegrationConfig;
68
69
  [IntegrationType.mysql]: MySqlIntegrationConfig;
69
70
  [IntegrationType.oracledb]: OracleIntegrationConfig;
71
+ [IntegrationType.pinot]: PinotIntegrationConfig;
70
72
  [IntegrationType.mssql]: MssqlIntegrationConfig;
71
73
  [IntegrationType.postgres]: PostgresIntegrationConfig;
72
74
  [IntegrationType.cockroach]: CockroachIntegrationConfig;
@@ -87,6 +89,7 @@ export interface IntegrationSchemaTypes {
87
89
  [IntegrationType.mongo]: IntegrationDataSchema;
88
90
  [IntegrationType.mysql]: IntegrationDataSchema;
89
91
  [IntegrationType.oracledb]: IntegrationDataSchema;
92
+ [IntegrationType.pinot]: IntegrationDataSchema;
90
93
  [IntegrationType.mssql]: IntegrationDataSchema;
91
94
  [IntegrationType.postgres]: IntegrationDataSchema;
92
95
  [IntegrationType.cockroach]: IntegrationDataSchema;
@@ -98,7 +101,7 @@ export type IntegrationTypeWithConfig = keyof IntegrationConfigTypes;
98
101
  export type IntegrationSchemaKeys = keyof IntegrationSchemaTypes;
99
102
  export type IntegrationConfig = IntegrationConfigTypes[IntegrationTypeWithConfig];
100
103
  export type IntegrationSchema = IntegrationSchemaTypes[IntegrationSchemaKeys];
101
- export declare const DatabaseIntegrationTypes: readonly [IntegrationType.built_in_db, IntegrationType.mongo, IntegrationType.mysql, IntegrationType.mssql, IntegrationType.postgres, IntegrationType.cockroach, IntegrationType.snowflake, IntegrationType.oracledb];
104
+ export declare const DatabaseIntegrationTypes: readonly [IntegrationType.built_in_db, IntegrationType.mongo, IntegrationType.mysql, IntegrationType.mssql, IntegrationType.postgres, IntegrationType.cockroach, IntegrationType.snowflake, IntegrationType.oracledb, IntegrationType.pinot];
102
105
  export type DatabaseIntegrationType = (typeof DatabaseIntegrationTypes)[number];
103
106
  export type DatabaseIntegrationConfig = IntegrationConfigTypes[DatabaseIntegrationType];
104
107
  export declare const ApiIntegrationTypes: readonly [IntegrationType.api, IntegrationType.graphql];
@@ -1,4 +1,4 @@
1
- import { AiAssistantContext, IntegrationId, OpenAiModelName } from '@squidcloud/common';
1
+ import { AiAssistantChatOptions, AiAssistantContext, AiModelName, IntegrationId } from '@squidcloud/common';
2
2
  import { Observable } from 'rxjs';
3
3
  import { RpcManager } from './rpc.manager';
4
4
  import { SocketManager } from './socket.manager';
@@ -22,10 +22,11 @@ export declare class AiAssistantClient {
22
22
  *
23
23
  * @param profileId - The profile id.
24
24
  * @param prompt - The prompt.
25
+ * @param options - The options to send to the chat model.
25
26
  * @returns An observable that emits when a new response token is received. The emitted value is the entire response
26
27
  * that has been received so far.
27
28
  */
28
- chat(profileId: string, prompt: string): Observable<string>;
29
+ chat(profileId: string, prompt: string, options?: AiAssistantChatOptions): Observable<string>;
29
30
  private handleChatResponse;
30
31
  }
31
32
  declare class AiAssistantProfileReference {
@@ -37,10 +38,11 @@ declare class AiAssistantProfileReference {
37
38
  * Sends a prompt to the current profile.
38
39
  *
39
40
  * @param prompt - The prompt.
41
+ * @param options - The chat options.
40
42
  * @returns An observable that emits when a new response token is received. The emitted value is the entire response
41
43
  * that has been received so far.
42
44
  */
43
- chat(prompt: string): Observable<string>;
45
+ chat(prompt: string, options?: AiAssistantChatOptions): Observable<string>;
44
46
  /**
45
47
  * Retrieves a context reference for the current profile. A context reference can be used to add a new context entry
46
48
  * to the profile, or update/delete an existing entry context.
@@ -63,12 +65,12 @@ declare class AiAssistantProfileReference {
63
65
  * Adds a new profile to the assistant. This will result in an error if a profile already exists with the same id.
64
66
  *
65
67
  * @param data An object containing options for creating the profile.
66
- * @param data.modelName - The name of the OpenAI model (`gpt-3.5 or `gpt-4`).
68
+ * @param data.modelName - The name of the OpenAI model (`gpt-3.5, `gpt-4` or `claude-2`).
67
69
  * @param data.isPublic - Whether the chat functionality of the profile can be accessed without security rules.
68
70
  * @returns A promise that resolves when the profile is successfully created.
69
71
  */
70
72
  insert(data: {
71
- modelName: OpenAiModelName;
73
+ modelName: AiModelName;
72
74
  isPublic: boolean;
73
75
  }): Promise<void>;
74
76
  /**
@@ -76,12 +78,12 @@ declare class AiAssistantProfileReference {
76
78
  * current profile id.
77
79
  *
78
80
  * @param data An object containing options for updating the profile.
79
- * @param data.modelName - The name of the OpenAI model (`gpt-3.5 or `gpt-4`).
81
+ * @param data.modelName - The name of the OpenAI model (`gpt-3.5, `gpt-4` or `claude-2`).
80
82
  * @param data.isPublic - Whether the chat functionality of the profile can be accessed without security rules.
81
83
  * @returns A promise that resolves when the profile is successfully updated.
82
84
  */
83
85
  update(data: {
84
- modelName?: OpenAiModelName;
86
+ modelName?: AiModelName;
85
87
  isPublic?: boolean;
86
88
  }): Promise<void>;
87
89
  /**
@@ -105,6 +107,7 @@ declare class AiAssistantContextReference {
105
107
  * @param data An object containing options for creating the entry.
106
108
  * @param data.title - The title of the entry.
107
109
  * @param data.context - The context data.
110
+ * @param file - The file to insert.
108
111
  * @returns A promise that resolves when the context is successfully created.
109
112
  */
110
113
  insert(data: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/client",
3
- "version": "1.0.124",
3
+ "version": "1.0.126",
4
4
  "description": "A typescript implementation of the Squid client",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/typescript-client/src/index.d.ts",