• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

box / box-typescript-sdk-gen / 13417170404

19 Feb 2025 04:12PM UTC coverage: 42.256% (-0.4%) from 42.608%
13417170404

Pull #520

github

web-flow
Merge 7711e5736 into 98b6a90da
Pull Request #520: test: Add AI studio tests (box/box-codegen#626)

4104 of 16572 branches covered (24.76%)

Branch coverage included in aggregate %.

378 of 832 new or added lines in 22 files covered. (45.43%)

14682 of 27886 relevant lines covered (52.65%)

92.64 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

14.75
/src/schemas/aiStudioAgentBasicTextTool.generated.ts
1
import { serializeAiLlmEndpointParamsAwsOrAiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi } from './aiLlmEndpointParamsAwsOrAiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi.generated.js';
2
import { deserializeAiLlmEndpointParamsAwsOrAiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi } from './aiLlmEndpointParamsAwsOrAiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi.generated.js';
146✔
3
import { serializeAiAgentBasicTextToolBase } from './aiAgentBasicTextToolBase.generated.js';
4
import { deserializeAiAgentBasicTextToolBase } from './aiAgentBasicTextToolBase.generated.js';
5
import { serializeAiAgentBasicTextTool } from './aiAgentBasicTextTool.generated.js';
146✔
6
import { deserializeAiAgentBasicTextTool } from './aiAgentBasicTextTool.generated.js';
7
import { AiLlmEndpointParamsAwsOrAiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi } from './aiLlmEndpointParamsAwsOrAiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi.generated.js';
8
import { AiAgentBasicTextToolBase } from './aiAgentBasicTextToolBase.generated.js';
9
import { AiAgentBasicTextTool } from './aiAgentBasicTextTool.generated.js';
10
import { BoxSdkError } from '../box/errors.js';
146✔
11
import { SerializedData } from '../serialization/json.js';
12
import { sdIsEmpty } from '../serialization/json.js';
13
import { sdIsBoolean } from '../serialization/json.js';
146✔
14
import { sdIsNumber } from '../serialization/json.js';
146✔
15
import { sdIsString } from '../serialization/json.js';
146✔
16
import { sdIsList } from '../serialization/json.js';
17
import { sdIsMap } from '../serialization/json.js';
146✔
18
export type AiStudioAgentBasicTextTool = AiAgentBasicTextTool & {
19
  /**
20
   * True if system message contains custom instructions placeholder, false otherwise */
21
  readonly isCustomInstructionsIncluded?: boolean;
22
};
23
export function serializeAiStudioAgentBasicTextTool(
146✔
24
  val: AiStudioAgentBasicTextTool,
25
): SerializedData {
NEW
26
  const base: any = serializeAiAgentBasicTextTool(val);
×
NEW
27
  if (!sdIsMap(base)) {
×
NEW
28
    throw new BoxSdkError({
×
29
      message: 'Expecting a map for "AiStudioAgentBasicTextTool"',
30
    });
31
  }
NEW
32
  return {
×
33
    ...base,
34
    ...{
35
      ['is_custom_instructions_included']: val.isCustomInstructionsIncluded,
36
    },
37
  };
38
}
39
export function deserializeAiStudioAgentBasicTextTool(
146✔
40
  val: SerializedData,
41
): AiStudioAgentBasicTextTool {
NEW
42
  if (!sdIsMap(val)) {
×
NEW
43
    throw new BoxSdkError({
×
44
      message: 'Expecting a map for "AiStudioAgentBasicTextTool"',
45
    });
46
  }
NEW
47
  if (
×
48
    !(val.is_custom_instructions_included == void 0) &&
×
49
    !sdIsBoolean(val.is_custom_instructions_included)
50
  ) {
NEW
51
    throw new BoxSdkError({
×
52
      message:
53
        'Expecting boolean for "is_custom_instructions_included" of type "AiStudioAgentBasicTextTool"',
54
    });
55
  }
56
  const isCustomInstructionsIncluded: undefined | boolean =
NEW
57
    val.is_custom_instructions_included == void 0
×
58
      ? void 0
59
      : val.is_custom_instructions_included;
NEW
60
  if (!(val.system_message == void 0) && !sdIsString(val.system_message)) {
×
NEW
61
    throw new BoxSdkError({
×
62
      message:
63
        'Expecting string for "system_message" of type "AiStudioAgentBasicTextTool"',
64
    });
65
  }
66
  const systemMessage: undefined | string =
NEW
67
    val.system_message == void 0 ? void 0 : val.system_message;
×
NEW
68
  if (!(val.prompt_template == void 0) && !sdIsString(val.prompt_template)) {
×
NEW
69
    throw new BoxSdkError({
×
70
      message:
71
        'Expecting string for "prompt_template" of type "AiStudioAgentBasicTextTool"',
72
    });
73
  }
74
  const promptTemplate: undefined | string =
NEW
75
    val.prompt_template == void 0 ? void 0 : val.prompt_template;
×
NEW
76
  if (!(val.model == void 0) && !sdIsString(val.model)) {
×
NEW
77
    throw new BoxSdkError({
×
78
      message:
79
        'Expecting string for "model" of type "AiStudioAgentBasicTextTool"',
80
    });
81
  }
NEW
82
  const model: undefined | string = val.model == void 0 ? void 0 : val.model;
×
NEW
83
  if (
×
84
    !(val.num_tokens_for_completion == void 0) &&
×
85
    !sdIsNumber(val.num_tokens_for_completion)
86
  ) {
NEW
87
    throw new BoxSdkError({
×
88
      message:
89
        'Expecting number for "num_tokens_for_completion" of type "AiStudioAgentBasicTextTool"',
90
    });
91
  }
92
  const numTokensForCompletion: undefined | number =
NEW
93
    val.num_tokens_for_completion == void 0
×
94
      ? void 0
95
      : val.num_tokens_for_completion;
96
  const llmEndpointParams:
97
    | undefined
98
    | AiLlmEndpointParamsAwsOrAiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi =
NEW
99
    val.llm_endpoint_params == void 0
×
100
      ? void 0
101
      : deserializeAiLlmEndpointParamsAwsOrAiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi(
102
          val.llm_endpoint_params,
103
        );
NEW
104
  return {
×
105
    isCustomInstructionsIncluded: isCustomInstructionsIncluded,
106
    systemMessage: systemMessage,
107
    promptTemplate: promptTemplate,
108
    model: model,
109
    numTokensForCompletion: numTokensForCompletion,
110
    llmEndpointParams: llmEndpointParams,
111
  } satisfies AiStudioAgentBasicTextTool;
112
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc