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

box / box-typescript-sdk-gen / 10040883711

22 Jul 2024 12:33PM UTC coverage: 41.915% (-0.01%) from 41.926%
10040883711

Pull #260

github

web-flow
Merge 5ce50cfe7 into fa8952a65
Pull Request #260: feat: Support AI Agent API (box/box-codegen#531)

3969 of 16256 branches covered (24.42%)

Branch coverage included in aggregate %.

204 of 374 new or added lines in 13 files covered. (54.55%)

1 existing line in 1 file now uncovered.

12840 of 23847 relevant lines covered (53.84%)

76.19 hits per line

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

55.17
/src/schemas/aiAgentBasicTextToolAsk.generated.ts
1
import { serializeAiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi } from './aiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi.generated.js';
138✔
2
import { deserializeAiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi } from './aiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi.generated.js';
138✔
3
import { AiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi } from './aiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi.generated.js';
4
import { BoxSdkError } from '../box/errors.js';
138✔
5
import { SerializedData } from '../serialization/json.js';
6
import { sdIsEmpty } from '../serialization/json.js';
7
import { sdIsBoolean } from '../serialization/json.js';
8
import { sdIsNumber } from '../serialization/json.js';
138✔
9
import { sdIsString } from '../serialization/json.js';
138✔
10
import { sdIsList } from '../serialization/json.js';
11
import { sdIsMap } from '../serialization/json.js';
138✔
12
export interface AiAgentBasicTextToolAsk {
13
  readonly model?: string;
14
  readonly systemMessage?: string;
15
  readonly promptTemplate?: string;
16
  readonly numTokensForCompletion?: number;
17
  readonly llmEndpointParams?: AiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi;
18
}
19
export function serializeAiAgentBasicTextToolAsk(
138✔
20
  val: AiAgentBasicTextToolAsk
21
): SerializedData {
NEW
22
  return {
×
23
    ['model']: val.model == void 0 ? void 0 : val.model,
×
24
    ['system_message']:
25
      val.systemMessage == void 0 ? void 0 : val.systemMessage,
×
26
    ['prompt_template']:
27
      val.promptTemplate == void 0 ? void 0 : val.promptTemplate,
×
28
    ['num_tokens_for_completion']:
29
      val.numTokensForCompletion == void 0
×
30
        ? void 0
31
        : val.numTokensForCompletion,
32
    ['llm_endpoint_params']:
33
      val.llmEndpointParams == void 0
×
34
        ? void 0
35
        : serializeAiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi(
36
            val.llmEndpointParams
37
          ),
38
  };
39
}
40
export function deserializeAiAgentBasicTextToolAsk(
138✔
41
  val: SerializedData
42
): AiAgentBasicTextToolAsk {
43
  if (!sdIsMap(val)) {
4!
NEW
44
    throw new BoxSdkError({
×
45
      message: 'Expecting a map for "AiAgentBasicTextToolAsk"',
46
    });
47
  }
48
  if (!(val.model == void 0) && !sdIsString(val.model)) {
4!
NEW
49
    throw new BoxSdkError({
×
50
      message: 'Expecting string for "model" of type "AiAgentBasicTextToolAsk"',
51
    });
52
  }
53
  const model: undefined | string = val.model == void 0 ? void 0 : val.model;
4!
54
  if (!(val.system_message == void 0) && !sdIsString(val.system_message)) {
4!
NEW
55
    throw new BoxSdkError({
×
56
      message:
57
        'Expecting string for "system_message" of type "AiAgentBasicTextToolAsk"',
58
    });
59
  }
60
  const systemMessage: undefined | string =
61
    val.system_message == void 0 ? void 0 : val.system_message;
4!
62
  if (!(val.prompt_template == void 0) && !sdIsString(val.prompt_template)) {
4!
NEW
63
    throw new BoxSdkError({
×
64
      message:
65
        'Expecting string for "prompt_template" of type "AiAgentBasicTextToolAsk"',
66
    });
67
  }
68
  const promptTemplate: undefined | string =
69
    val.prompt_template == void 0 ? void 0 : val.prompt_template;
4!
70
  if (
4!
71
    !(val.num_tokens_for_completion == void 0) &&
8✔
72
    !sdIsNumber(val.num_tokens_for_completion)
73
  ) {
NEW
74
    throw new BoxSdkError({
×
75
      message:
76
        'Expecting number for "num_tokens_for_completion" of type "AiAgentBasicTextToolAsk"',
77
    });
78
  }
79
  const numTokensForCompletion: undefined | number =
80
    val.num_tokens_for_completion == void 0
4!
81
      ? void 0
82
      : val.num_tokens_for_completion;
83
  const llmEndpointParams:
84
    | undefined
85
    | AiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi =
86
    val.llm_endpoint_params == void 0
4!
87
      ? void 0
88
      : deserializeAiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi(
89
          val.llm_endpoint_params
90
        );
91
  return {
4✔
92
    model: model,
93
    systemMessage: systemMessage,
94
    promptTemplate: promptTemplate,
95
    numTokensForCompletion: numTokensForCompletion,
96
    llmEndpointParams: llmEndpointParams,
97
  } satisfies AiAgentBasicTextToolAsk;
98
}
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

© 2025 Coveralls, Inc