• 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

60.61
/src/schemas/aiAgentBasicGenTool.generated.ts
1
import { serializeAiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi } from './aiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi.generated.js';
2
import { deserializeAiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi } from './aiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi.generated.js';
138✔
3
import { serializeAiAgentBasicTextToolTextGen } from './aiAgentBasicTextToolTextGen.generated.js';
4
import { deserializeAiAgentBasicTextToolTextGen } from './aiAgentBasicTextToolTextGen.generated.js';
5
import { serializeAiAgentLongTextToolEmbeddingsField } from './aiAgentLongTextTool.generated.js';
6
import { deserializeAiAgentLongTextToolEmbeddingsField } from './aiAgentLongTextTool.generated.js';
138✔
7
import { serializeAiAgentLongTextTool } from './aiAgentLongTextTool.generated.js';
138✔
8
import { deserializeAiAgentLongTextTool } from './aiAgentLongTextTool.generated.js';
9
import { AiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi } from './aiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi.generated.js';
10
import { AiAgentBasicTextToolTextGen } from './aiAgentBasicTextToolTextGen.generated.js';
11
import { AiAgentLongTextToolEmbeddingsField } from './aiAgentLongTextTool.generated.js';
12
import { AiAgentLongTextTool } from './aiAgentLongTextTool.generated.js';
13
import { BoxSdkError } from '../box/errors.js';
138✔
14
import { SerializedData } from '../serialization/json.js';
15
import { sdIsEmpty } from '../serialization/json.js';
16
import { sdIsBoolean } from '../serialization/json.js';
17
import { sdIsNumber } from '../serialization/json.js';
138✔
18
import { sdIsString } from '../serialization/json.js';
138✔
19
import { sdIsList } from '../serialization/json.js';
20
import { sdIsMap } from '../serialization/json.js';
138✔
21
export type AiAgentBasicGenTool = AiAgentLongTextTool & {
22
  readonly contentTemplate?: string;
23
};
24
export function serializeAiAgentBasicGenTool(
138✔
25
  val: AiAgentBasicGenTool
26
): SerializedData {
NEW
27
  const base: any = serializeAiAgentLongTextTool(val);
×
NEW
28
  if (!sdIsMap(base)) {
×
NEW
29
    throw new BoxSdkError({
×
30
      message: 'Expecting a map for "AiAgentBasicGenTool"',
31
    });
32
  }
NEW
33
  return {
×
34
    ...base,
35
    ...{
36
      ['content_template']:
37
        val.contentTemplate == void 0 ? void 0 : val.contentTemplate,
×
38
    },
39
  };
40
}
41
export function deserializeAiAgentBasicGenTool(
138✔
42
  val: SerializedData
43
): AiAgentBasicGenTool {
44
  if (!sdIsMap(val)) {
2!
NEW
45
    throw new BoxSdkError({
×
46
      message: 'Expecting a map for "AiAgentBasicGenTool"',
47
    });
48
  }
49
  if (!(val.content_template == void 0) && !sdIsString(val.content_template)) {
2!
NEW
50
    throw new BoxSdkError({
×
51
      message:
52
        'Expecting string for "content_template" of type "AiAgentBasicGenTool"',
53
    });
54
  }
55
  const contentTemplate: undefined | string =
56
    val.content_template == void 0 ? void 0 : val.content_template;
2!
57
  const embeddings: undefined | AiAgentLongTextToolEmbeddingsField =
58
    val.embeddings == void 0
2!
59
      ? void 0
60
      : deserializeAiAgentLongTextToolEmbeddingsField(val.embeddings);
61
  if (!(val.model == void 0) && !sdIsString(val.model)) {
2!
NEW
62
    throw new BoxSdkError({
×
63
      message: 'Expecting string for "model" of type "AiAgentBasicGenTool"',
64
    });
65
  }
66
  const model: undefined | string = val.model == void 0 ? void 0 : val.model;
2!
67
  if (!(val.system_message == void 0) && !sdIsString(val.system_message)) {
2!
NEW
68
    throw new BoxSdkError({
×
69
      message:
70
        'Expecting string for "system_message" of type "AiAgentBasicGenTool"',
71
    });
72
  }
73
  const systemMessage: undefined | string =
74
    val.system_message == void 0 ? void 0 : val.system_message;
2!
75
  if (!(val.prompt_template == void 0) && !sdIsString(val.prompt_template)) {
2!
NEW
76
    throw new BoxSdkError({
×
77
      message:
78
        'Expecting string for "prompt_template" of type "AiAgentBasicGenTool"',
79
    });
80
  }
81
  const promptTemplate: undefined | string =
82
    val.prompt_template == void 0 ? void 0 : val.prompt_template;
2!
83
  if (
2!
84
    !(val.num_tokens_for_completion == void 0) &&
4✔
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 "AiAgentBasicGenTool"',
90
    });
91
  }
92
  const numTokensForCompletion: undefined | number =
93
    val.num_tokens_for_completion == void 0
2!
94
      ? void 0
95
      : val.num_tokens_for_completion;
96
  const llmEndpointParams:
97
    | undefined
98
    | AiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi =
99
    val.llm_endpoint_params == void 0
2!
100
      ? void 0
101
      : deserializeAiLlmEndpointParamsGoogleOrAiLlmEndpointParamsOpenAi(
102
          val.llm_endpoint_params
103
        );
104
  return {
2✔
105
    contentTemplate: contentTemplate,
106
    embeddings: embeddings,
107
    model: model,
108
    systemMessage: systemMessage,
109
    promptTemplate: promptTemplate,
110
    numTokensForCompletion: numTokensForCompletion,
111
    llmEndpointParams: llmEndpointParams,
112
  } satisfies AiAgentBasicGenTool;
113
}
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