@squidcloud/client 1.0.151 → 1.0.152

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
@@ -35514,7 +35514,13 @@ const AiChatbotChatRequestSchema = {
35514
35514
 
35515
35515
  ;// CONCATENATED MODULE: ../common/src/ai-chatbot.types.ts
35516
35516
  /** The supported AI model names. */
35517
- const AI_MODEL_NAMES = (/* unused pure expression or super */ null && (['gpt-3.5-turbo', 'gpt-4', 'claude-2', 'gpt-4-1106-preview']));
35517
+ const AI_MODEL_NAMES = (/* unused pure expression or super */ null && ([
35518
+ 'gpt-3.5-turbo',
35519
+ 'gpt-3.5-turbo-1106',
35520
+ 'gpt-4',
35521
+ 'claude-2',
35522
+ 'gpt-4-1106-preview',
35523
+ ]));
35518
35524
  /** @internal */
35519
35525
  const AiModelData = {
35520
35526
  'gpt-4': {
@@ -35523,6 +35529,9 @@ const AiModelData = {
35523
35529
  'gpt-3.5-turbo': {
35524
35530
  tokens: 4096,
35525
35531
  },
35532
+ 'gpt-3.5-turbo-1106': {
35533
+ tokens: 16385,
35534
+ },
35526
35535
  'claude-2': {
35527
35536
  tokens: 100000,
35528
35537
  },
@@ -57650,6 +57659,14 @@ class QuerySender {
57650
57659
  }
57651
57660
  async processQueryBatch() {
57652
57661
  const queryRequestAndSubjects = this.pendingQueryRequests.splice(0);
57662
+ /**
57663
+ * There is a race condition where the batch timeout is triggered but the safeToSendQueriesToServer is not yet
57664
+ * true. In this case this function will be invoked again once the safeToSendQueriesToServer is true within the
57665
+ * setTimeout handler, and it may cause the queryRequestAndSubjects to be empty. In this case we do not want to send
57666
+ * an empty batch.
57667
+ */
57668
+ if (!queryRequestAndSubjects.length)
57669
+ return;
57653
57670
  const pendingQueryRequests = queryRequestAndSubjects.map(({ queryRequest }) => queryRequest);
57654
57671
  const responseSubjects = queryRequestAndSubjects.map(({ responseSubject }) => responseSubject);
57655
57672
  this.inflightQueriesCount.next(this.inflightQueriesCount.value + pendingQueryRequests.length);
@@ -1,5 +1,5 @@
1
1
  /** The supported AI model names. */
2
- export declare const AI_MODEL_NAMES: readonly ["gpt-3.5-turbo", "gpt-4", "claude-2", "gpt-4-1106-preview"];
2
+ export declare const AI_MODEL_NAMES: readonly ["gpt-3.5-turbo", "gpt-3.5-turbo-1106", "gpt-4", "claude-2", "gpt-4-1106-preview"];
3
3
  export type AiModelName = (typeof AI_MODEL_NAMES)[number];
4
4
  /** The possible sources for the LLM provider API key. */
5
5
  export type ApiKeySource = 'user' | 'system';
@@ -11,6 +11,8 @@ export interface ExecuteAiQueryResponse {
11
11
  answer: string;
12
12
  explanation?: string;
13
13
  executedQuery?: string;
14
+ queryMarkdownType?: string;
15
+ success: boolean;
14
16
  }
15
17
  /**
16
18
  * AiClient class serves as a facade for interacting with different AI services.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/client",
3
- "version": "1.0.151",
3
+ "version": "1.0.152",
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",
@@ -33,7 +33,7 @@
33
33
  "license": "ISC",
34
34
  "dependencies": {
35
35
  "@apollo/client": "^3.7.4",
36
- "@squidcloud/common": "1.0.151",
36
+ "@squidcloud/common": "1.0.152",
37
37
  "@supercharge/promise-pool": "^2.3.2",
38
38
  "axios": "^1.6.2",
39
39
  "cross-fetch": "^3.1.5",