@gitbook/api 0.133.0 → 0.135.0

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/client.d.ts CHANGED
@@ -789,7 +789,7 @@ export interface DocumentTableViewCards {
789
789
  }
790
790
  export interface DocumentTableRecord {
791
791
  orderIndex: string;
792
- values: Record<string, number | string | boolean | string[] | ContentRef>;
792
+ values: Record<string, number | string | null | boolean | string[] | ContentRef>;
793
793
  }
794
794
  export interface DocumentTableDefinitionBase {
795
795
  id: string;
@@ -2538,6 +2538,7 @@ export declare enum IntegrationScope {
2538
2538
  SiteVisitorAuth = "site:visitor:auth",
2539
2539
  SiteAdaptiveRead = "site:adaptive:read",
2540
2540
  SiteAdaptiveWrite = "site:adaptive:write",
2541
+ SiteAiAsk = "site:ai:ask",
2541
2542
  OpenapiRead = "openapi:read",
2542
2543
  OpenapiWrite = "openapi:write",
2543
2544
  ConversationsIngest = "conversations:ingest"
@@ -5014,7 +5015,8 @@ export declare enum CustomizationThemeMode {
5014
5015
  export declare enum CustomizationAIMode {
5015
5016
  None = "none",
5016
5017
  Search = "search",
5017
- Assistant = "assistant"
5018
+ Assistant = "assistant",
5019
+ Integration = "integration"
5018
5020
  }
5019
5021
  /**
5020
5022
  * How external links should open when clicked.
@@ -5128,6 +5130,8 @@ export interface SiteCustomizationSettings {
5128
5130
  };
5129
5131
  ai: {
5130
5132
  mode: CustomizationAIMode;
5133
+ /** The integration to use for the AI features on the site. Only required if mode is set to "integration". */
5134
+ integrationId?: string;
5131
5135
  };
5132
5136
  advancedCustomization: {
5133
5137
  /** If true, Advanced customization is enabled */
@@ -5349,6 +5353,50 @@ export declare enum AIModel {
5349
5353
  ReasoningMedium = "reasoning-medium",
5350
5354
  ReasoningHigh = "reasoning-high"
5351
5355
  }
5356
+ /** Confirmation to display to the user when the AI requires the user to confirm a tool call. */
5357
+ export interface AIToolConfirmation {
5358
+ /** Label to display in the UI when the user is prompted to confirm this tool. */
5359
+ label: string;
5360
+ /** Icon to display in the UI when the user is prompted to confirm this tool. */
5361
+ icon?: Icon;
5362
+ }
5363
+ /** Description of a tool that can be called from an AI agent. */
5364
+ export interface AIToolDefinition {
5365
+ /** The name of the tool. It should be unique within the agent. */
5366
+ name: string;
5367
+ /** The description of the tool, passed to the AI agent. */
5368
+ description: string;
5369
+ /** JSON schema describing the input of the tool. */
5370
+ inputSchema?: {
5371
+ type: 'object';
5372
+ properties: Record<string, {
5373
+ type: 'string' | 'number' | 'boolean' | 'array' | 'object';
5374
+ /** Description of the property. */
5375
+ description: string;
5376
+ [key: string]: any;
5377
+ }>;
5378
+ };
5379
+ /** Confirmation to display to the user when the AI requires the user to confirm a tool call. */
5380
+ confirmation: AIToolConfirmation;
5381
+ }
5382
+ /** Summary of a generic tool call. */
5383
+ export interface AIToolCallOtherSummary {
5384
+ /** Name of the icon */
5385
+ icon: Icon;
5386
+ /** Text to display to the user to describe the tool call. */
5387
+ text: string;
5388
+ }
5389
+ /** Result of a tool call. */
5390
+ export interface AIToolCallResult {
5391
+ /** The name of the tool that was called. */
5392
+ tool: string;
5393
+ /** The ID of the tool call. */
5394
+ toolCallId: string;
5395
+ /** The output to the tool call. */
5396
+ output: object;
5397
+ /** Summary of a generic tool call. */
5398
+ summary: AIToolCallOtherSummary;
5399
+ }
5352
5400
  /** Message emitted by the server to indicate the end of the AI response. It contains the ID of the response to be referenced for followup requests. */
5353
5401
  export interface AIStreamResponseFinish {
5354
5402
  type: 'response_finish';
@@ -5485,7 +5533,13 @@ export interface AIToolCallMCP {
5485
5533
  /** The title of the tool that has been called. */
5486
5534
  mcpToolTitle?: string;
5487
5535
  }
5488
- export type AIToolCall = AIToolCallGetPageContent | AIToolCallGetPages | AIToolCallSearch | AIToolCallEditPage | AIToolCallCreatePage | AIToolCallDeletePage | AIToolCallRenamePage | AIToolCallMovePage | AIToolCallListModifiedPages | AIToolCallGetPageDiff | AIToolCallCreateAgentTask | AIToolCallMCP;
5536
+ /** Any tool call that is unknown by GitBook */
5537
+ export interface AIToolCallOther {
5538
+ tool: 'other';
5539
+ /** Summary of a generic tool call. */
5540
+ summary: AIToolCallOtherSummary;
5541
+ }
5542
+ export type AIToolCall = AIToolCallGetPageContent | AIToolCallGetPages | AIToolCallSearch | AIToolCallEditPage | AIToolCallCreatePage | AIToolCallDeletePage | AIToolCallRenamePage | AIToolCallMovePage | AIToolCallListModifiedPages | AIToolCallGetPageDiff | AIToolCallCreateAgentTask | AIToolCallMCP | AIToolCallOther;
5489
5543
  /** Message emitted by the server to indicate that the AI has called a tool. */
5490
5544
  export interface AIStreamResponseToolCall {
5491
5545
  type: 'response_tool_call';
@@ -5495,6 +5549,25 @@ export interface AIStreamResponseToolCall {
5495
5549
  stepIndex: number;
5496
5550
  toolCall: AIToolCall;
5497
5551
  }
5552
+ /** Message emitted by the server to indicate that the AI requires the user to confirm a tool call. */
5553
+ export interface AIStreamResponseToolConfirm {
5554
+ type: 'response_tool_confirm';
5555
+ /** The ID of the message that this event is composing. */
5556
+ messageId: string;
5557
+ /** The index of the step of the message that this event is composing. */
5558
+ stepIndex: number;
5559
+ /** The tool call that the AI requires the user to confirm. */
5560
+ toolCall: {
5561
+ /** The name of the tool that the AI requires the user to confirm. */
5562
+ tool: string;
5563
+ /** The input to the tool call. */
5564
+ input: object;
5565
+ };
5566
+ /** The ID of the tool call that the AI requires the user to confirm. */
5567
+ toolCallId: string;
5568
+ /** Confirmation to display to the user when the AI requires the user to confirm a tool call. */
5569
+ toolConfirmation: AIToolConfirmation;
5570
+ }
5498
5571
  /** Message emitted by the server to suggest a followup message the user could respond with. */
5499
5572
  export interface AIStreamResponseFollowupSuggestion {
5500
5573
  type: 'response_followup_suggestion';
@@ -5502,7 +5575,7 @@ export interface AIStreamResponseFollowupSuggestion {
5502
5575
  messageId: string;
5503
5576
  suggestions: string[];
5504
5577
  }
5505
- export type AIStreamResponse = AIStreamResponseFinish | AIStreamResponseDocument | AIStreamResponseObject | AIStreamResponseToolCall | AIStreamResponseFollowupSuggestion;
5578
+ export type AIStreamResponse = AIStreamResponseFinish | AIStreamResponseDocument | AIStreamResponseObject | AIStreamResponseToolCall | AIStreamResponseToolConfirm | AIStreamResponseFollowupSuggestion;
5506
5579
  /** Analytics info on the GitBook's site session. */
5507
5580
  export interface SiteInsightsEventSession {
5508
5581
  /** GitBook's unique identifier of the visitor. */
@@ -11264,6 +11337,22 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11264
11337
  * @secure
11265
11338
  */
11266
11339
  deleteTranslation: (organizationId: string, translationId: string, params?: RequestParams) => Promise<HttpResponse<void, any>>;
11340
+ /**
11341
+ * No description
11342
+ *
11343
+ * @tags translations
11344
+ * @name RunTranslation
11345
+ * @summary Run a translation again
11346
+ * @request POST:/orgs/{organizationId}/translations/{translationId}/run
11347
+ * @secure
11348
+ */
11349
+ runTranslation: (organizationId: string, translationId: string, params?: RequestParams) => Promise<HttpResponse<void, {
11350
+ error: {
11351
+ /** @format int32 */
11352
+ code: 404;
11353
+ message: string;
11354
+ };
11355
+ }>>;
11267
11356
  /**
11268
11357
  * No description
11269
11358
  *
@@ -12175,7 +12264,12 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
12175
12264
  * @secure
12176
12265
  */
12177
12266
  streamRecommendedQuestionsInSite: (organizationId: string, siteId: string, query?: {
12178
- /** The ID of the space to filter the recommended questions for. */
12267
+ /** The ID of the site space to filter the recommended questions for. */
12268
+ siteSpaceId?: string;
12269
+ /**
12270
+ * The ID of the space to filter the recommended questions for.
12271
+ * @deprecated
12272
+ */
12179
12273
  spaceId?: string;
12180
12274
  }, params?: RequestParams) => EventIterator<SearchAIRecommendedQuestionStream>;
12181
12275
  /**
@@ -12475,16 +12569,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
12475
12569
  streamAiResponseInSite: (organizationId: string, siteId: string, data: {
12476
12570
  /** The ID of the previous response to continue from */
12477
12571
  previousResponseId?: string;
12572
+ /** The messages to send to the AI agent. */
12478
12573
  input: AIMessageInput[];
12479
- output: AIOutputFormat;
12574
+ /** @deprecated */
12575
+ output?: AIOutputFormat;
12480
12576
  model?: AIModel;
12481
- } & ({
12482
- mode: "custom";
12483
- /** Custom instructions for the AI */
12484
- instructions: string;
12485
- } | {
12486
- mode: "assistant";
12487
- }), params?: RequestParams) => EventIterator<AIStreamResponse>;
12577
+ /** Custom tools to provide to the AI agent. */
12578
+ tools?: AIToolDefinition[];
12579
+ /** Result of a tool call. */
12580
+ toolCall?: AIToolCallResult;
12581
+ }, params?: RequestParams) => EventIterator<AIStreamResponse>;
12488
12582
  /**
12489
12583
  * @description Experimental operation to get an existing AI response in a site.
12490
12584
  *
package/dist/index.cjs CHANGED
@@ -279,7 +279,7 @@ module.exports = __toCommonJS(src_exports);
279
279
 
280
280
  // package.json
281
281
  var name = "@gitbook/api";
282
- var version = "0.133.0";
282
+ var version = "0.135.0";
283
283
 
284
284
  // src/client.ts
285
285
  var import_event_iterator = __toESM(require_node(), 1);
@@ -611,6 +611,7 @@ var IntegrationScope = /* @__PURE__ */ ((IntegrationScope2) => {
611
611
  IntegrationScope2["SiteVisitorAuth"] = "site:visitor:auth";
612
612
  IntegrationScope2["SiteAdaptiveRead"] = "site:adaptive:read";
613
613
  IntegrationScope2["SiteAdaptiveWrite"] = "site:adaptive:write";
614
+ IntegrationScope2["SiteAiAsk"] = "site:ai:ask";
614
615
  IntegrationScope2["OpenapiRead"] = "openapi:read";
615
616
  IntegrationScope2["OpenapiWrite"] = "openapi:write";
616
617
  IntegrationScope2["ConversationsIngest"] = "conversations:ingest";
@@ -884,6 +885,7 @@ var CustomizationAIMode = /* @__PURE__ */ ((CustomizationAIMode2) => {
884
885
  CustomizationAIMode2["None"] = "none";
885
886
  CustomizationAIMode2["Search"] = "search";
886
887
  CustomizationAIMode2["Assistant"] = "assistant";
888
+ CustomizationAIMode2["Integration"] = "integration";
887
889
  return CustomizationAIMode2;
888
890
  })(CustomizationAIMode || {});
889
891
  var SiteExternalLinksTarget = /* @__PURE__ */ ((SiteExternalLinksTarget2) => {
@@ -3038,6 +3040,12 @@ var Api = class extends HttpClient {
3038
3040
  secure: true,
3039
3041
  ...params
3040
3042
  }),
3043
+ runTranslation: (organizationId, translationId, params = {}) => this.request({
3044
+ path: `/orgs/${organizationId}/translations/${translationId}/run`,
3045
+ method: "POST",
3046
+ secure: true,
3047
+ ...params
3048
+ }),
3041
3049
  listGlossaryEntries: (organizationId, query, params = {}) => this.request({
3042
3050
  path: `/orgs/${organizationId}/translations-glossary`,
3043
3051
  method: "GET",
package/dist/index.js CHANGED
@@ -172,7 +172,7 @@ var require_node = __commonJS({
172
172
 
173
173
  // package.json
174
174
  var name = "@gitbook/api";
175
- var version = "0.133.0";
175
+ var version = "0.135.0";
176
176
 
177
177
  // src/client.ts
178
178
  var import_event_iterator = __toESM(require_node(), 1);
@@ -504,6 +504,7 @@ var IntegrationScope = /* @__PURE__ */ ((IntegrationScope2) => {
504
504
  IntegrationScope2["SiteVisitorAuth"] = "site:visitor:auth";
505
505
  IntegrationScope2["SiteAdaptiveRead"] = "site:adaptive:read";
506
506
  IntegrationScope2["SiteAdaptiveWrite"] = "site:adaptive:write";
507
+ IntegrationScope2["SiteAiAsk"] = "site:ai:ask";
507
508
  IntegrationScope2["OpenapiRead"] = "openapi:read";
508
509
  IntegrationScope2["OpenapiWrite"] = "openapi:write";
509
510
  IntegrationScope2["ConversationsIngest"] = "conversations:ingest";
@@ -777,6 +778,7 @@ var CustomizationAIMode = /* @__PURE__ */ ((CustomizationAIMode2) => {
777
778
  CustomizationAIMode2["None"] = "none";
778
779
  CustomizationAIMode2["Search"] = "search";
779
780
  CustomizationAIMode2["Assistant"] = "assistant";
781
+ CustomizationAIMode2["Integration"] = "integration";
780
782
  return CustomizationAIMode2;
781
783
  })(CustomizationAIMode || {});
782
784
  var SiteExternalLinksTarget = /* @__PURE__ */ ((SiteExternalLinksTarget2) => {
@@ -2931,6 +2933,12 @@ var Api = class extends HttpClient {
2931
2933
  secure: true,
2932
2934
  ...params
2933
2935
  }),
2936
+ runTranslation: (organizationId, translationId, params = {}) => this.request({
2937
+ path: `/orgs/${organizationId}/translations/${translationId}/run`,
2938
+ method: "POST",
2939
+ secure: true,
2940
+ ...params
2941
+ }),
2934
2942
  listGlossaryEntries: (organizationId, query, params = {}) => this.request({
2935
2943
  path: `/orgs/${organizationId}/translations-glossary`,
2936
2944
  method: "GET",
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "./dist/index.cjs",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
- "version": "0.133.0",
7
+ "version": "0.135.0",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "README.md",
package/spec/openapi.json CHANGED
@@ -11184,6 +11184,37 @@
11184
11184
  }
11185
11185
  }
11186
11186
  },
11187
+ "/orgs/{organizationId}/translations/{translationId}/run": {
11188
+ "post": {
11189
+ "operationId": "runTranslation",
11190
+ "summary": "Run a translation again",
11191
+ "tags": [
11192
+ "translations"
11193
+ ],
11194
+ "security": [
11195
+ {
11196
+ "user": []
11197
+ }
11198
+ ],
11199
+ "parameters": [
11200
+ {
11201
+ "$ref": "#/components/parameters/organizationId"
11202
+ },
11203
+ {
11204
+ "$ref": "#/components/parameters/translationId"
11205
+ }
11206
+ ],
11207
+ "responses": {
11208
+ "204": {
11209
+ "description": "Translation run triggered"
11210
+ },
11211
+ "404": {
11212
+ "description": "No matching translation found",
11213
+ "$ref": "#/components/responses/NotFoundError"
11214
+ }
11215
+ }
11216
+ }
11217
+ },
11187
11218
  "/orgs/{organizationId}/translations-glossary": {
11188
11219
  "get": {
11189
11220
  "operationId": "listGlossaryEntries",
@@ -13921,10 +13952,19 @@
13921
13952
  {
13922
13953
  "$ref": "#/components/parameters/siteId"
13923
13954
  },
13955
+ {
13956
+ "name": "siteSpaceId",
13957
+ "in": "query",
13958
+ "description": "The ID of the site space to filter the recommended questions for.",
13959
+ "schema": {
13960
+ "type": "string"
13961
+ }
13962
+ },
13924
13963
  {
13925
13964
  "name": "spaceId",
13926
13965
  "in": "query",
13927
13966
  "description": "The ID of the space to filter the recommended questions for.",
13967
+ "deprecated": true,
13928
13968
  "schema": {
13929
13969
  "type": "string"
13930
13970
  }
@@ -14992,70 +15032,40 @@
14992
15032
  "content": {
14993
15033
  "application/json": {
14994
15034
  "schema": {
14995
- "allOf": [
14996
- {
14997
- "type": "object",
14998
- "required": [
14999
- "input",
15000
- "output"
15001
- ],
15002
- "properties": {
15003
- "previousResponseId": {
15004
- "type": "string",
15005
- "description": "The ID of the previous response to continue from"
15006
- },
15007
- "input": {
15008
- "type": "array",
15009
- "items": {
15010
- "$ref": "#/components/schemas/AIMessageInput"
15011
- }
15012
- },
15013
- "output": {
15014
- "$ref": "#/components/schemas/AIOutputFormat"
15015
- },
15016
- "model": {
15017
- "$ref": "#/components/schemas/AIModel"
15018
- }
15035
+ "type": "object",
15036
+ "required": [
15037
+ "input"
15038
+ ],
15039
+ "properties": {
15040
+ "previousResponseId": {
15041
+ "type": "string",
15042
+ "description": "The ID of the previous response to continue from"
15043
+ },
15044
+ "input": {
15045
+ "type": "array",
15046
+ "description": "The messages to send to the AI agent.",
15047
+ "items": {
15048
+ "$ref": "#/components/schemas/AIMessageInput"
15019
15049
  }
15020
15050
  },
15021
- {
15022
- "oneOf": [
15023
- {
15024
- "type": "object",
15025
- "required": [
15026
- "mode",
15027
- "instructions"
15028
- ],
15029
- "properties": {
15030
- "mode": {
15031
- "type": "string",
15032
- "enum": [
15033
- "custom"
15034
- ]
15035
- },
15036
- "instructions": {
15037
- "type": "string",
15038
- "description": "Custom instructions for the AI"
15039
- }
15040
- }
15041
- },
15042
- {
15043
- "type": "object",
15044
- "required": [
15045
- "mode"
15046
- ],
15047
- "properties": {
15048
- "mode": {
15049
- "type": "string",
15050
- "enum": [
15051
- "assistant"
15052
- ]
15053
- }
15054
- }
15055
- }
15056
- ]
15051
+ "output": {
15052
+ "deprecated": true,
15053
+ "$ref": "#/components/schemas/AIOutputFormat"
15054
+ },
15055
+ "model": {
15056
+ "$ref": "#/components/schemas/AIModel"
15057
+ },
15058
+ "tools": {
15059
+ "type": "array",
15060
+ "description": "Custom tools to provide to the AI agent.",
15061
+ "items": {
15062
+ "$ref": "#/components/schemas/AIToolDefinition"
15063
+ }
15064
+ },
15065
+ "toolCall": {
15066
+ "$ref": "#/components/schemas/AIToolCallResult"
15057
15067
  }
15058
- ]
15068
+ }
15059
15069
  }
15060
15070
  }
15061
15071
  }
@@ -19573,7 +19583,8 @@
19573
19583
  "type": "number"
19574
19584
  },
19575
19585
  {
19576
- "type": "string"
19586
+ "type": "string",
19587
+ "nullable": true
19577
19588
  },
19578
19589
  {
19579
19590
  "type": "boolean"
@@ -25918,6 +25929,7 @@
25918
25929
  "site:visitor:auth",
25919
25930
  "site:adaptive:read",
25920
25931
  "site:adaptive:write",
25932
+ "site:ai:ask",
25921
25933
  "openapi:read",
25922
25934
  "openapi:write",
25923
25935
  "conversations:ingest"
@@ -33070,7 +33082,8 @@
33070
33082
  "enum": [
33071
33083
  "none",
33072
33084
  "search",
33073
- "assistant"
33085
+ "assistant",
33086
+ "integration"
33074
33087
  ]
33075
33088
  },
33076
33089
  "SiteExternalLinksTarget": {
@@ -33286,6 +33299,10 @@
33286
33299
  "properties": {
33287
33300
  "mode": {
33288
33301
  "$ref": "#/components/schemas/CustomizationAIMode"
33302
+ },
33303
+ "integrationId": {
33304
+ "type": "string",
33305
+ "description": "The integration to use for the AI features on the site. Only required if mode is set to \"integration\"."
33289
33306
  }
33290
33307
  },
33291
33308
  "required": [
@@ -34001,6 +34018,132 @@
34001
34018
  "reasoning-high"
34002
34019
  ]
34003
34020
  },
34021
+ "AIToolConfirmation": {
34022
+ "type": "object",
34023
+ "description": "Confirmation to display to the user when the AI requires the user to confirm a tool call.",
34024
+ "properties": {
34025
+ "label": {
34026
+ "type": "string",
34027
+ "description": "Label to display in the UI when the user is prompted to confirm this tool."
34028
+ },
34029
+ "icon": {
34030
+ "description": "Icon to display in the UI when the user is prompted to confirm this tool.",
34031
+ "$ref": "#/components/schemas/Icon"
34032
+ }
34033
+ },
34034
+ "required": [
34035
+ "label"
34036
+ ]
34037
+ },
34038
+ "AIToolDefinition": {
34039
+ "type": "object",
34040
+ "description": "Description of a tool that can be called from an AI agent.",
34041
+ "properties": {
34042
+ "name": {
34043
+ "type": "string",
34044
+ "description": "The name of the tool. It should be unique within the agent."
34045
+ },
34046
+ "description": {
34047
+ "type": "string",
34048
+ "description": "The description of the tool, passed to the AI agent."
34049
+ },
34050
+ "inputSchema": {
34051
+ "type": "object",
34052
+ "description": "JSON schema describing the input of the tool.",
34053
+ "properties": {
34054
+ "type": {
34055
+ "type": "string",
34056
+ "enum": [
34057
+ "object"
34058
+ ]
34059
+ },
34060
+ "properties": {
34061
+ "type": "object",
34062
+ "additionalProperties": {
34063
+ "type": "object",
34064
+ "properties": {
34065
+ "type": {
34066
+ "type": "string",
34067
+ "enum": [
34068
+ "string",
34069
+ "number",
34070
+ "boolean",
34071
+ "array",
34072
+ "object"
34073
+ ]
34074
+ },
34075
+ "description": {
34076
+ "type": "string",
34077
+ "description": "Description of the property."
34078
+ }
34079
+ },
34080
+ "required": [
34081
+ "type",
34082
+ "description"
34083
+ ],
34084
+ "additionalProperties": true
34085
+ }
34086
+ }
34087
+ },
34088
+ "required": [
34089
+ "type",
34090
+ "properties"
34091
+ ]
34092
+ },
34093
+ "confirmation": {
34094
+ "$ref": "#/components/schemas/AIToolConfirmation"
34095
+ }
34096
+ },
34097
+ "required": [
34098
+ "name",
34099
+ "description",
34100
+ "confirmation"
34101
+ ]
34102
+ },
34103
+ "AIToolCallOtherSummary": {
34104
+ "type": "object",
34105
+ "description": "Summary of a generic tool call.",
34106
+ "properties": {
34107
+ "icon": {
34108
+ "$ref": "#/components/schemas/Icon"
34109
+ },
34110
+ "text": {
34111
+ "type": "string",
34112
+ "description": "Text to display to the user to describe the tool call."
34113
+ }
34114
+ },
34115
+ "required": [
34116
+ "icon",
34117
+ "text"
34118
+ ]
34119
+ },
34120
+ "AIToolCallResult": {
34121
+ "type": "object",
34122
+ "description": "Result of a tool call.",
34123
+ "required": [
34124
+ "tool",
34125
+ "toolCallId",
34126
+ "output",
34127
+ "summary"
34128
+ ],
34129
+ "properties": {
34130
+ "tool": {
34131
+ "type": "string",
34132
+ "description": "The name of the tool that was called."
34133
+ },
34134
+ "toolCallId": {
34135
+ "type": "string",
34136
+ "description": "The ID of the tool call."
34137
+ },
34138
+ "output": {
34139
+ "type": "object",
34140
+ "description": "The output to the tool call."
34141
+ },
34142
+ "summary": {
34143
+ "$ref": "#/components/schemas/AIToolCallOtherSummary"
34144
+ }
34145
+ }
34146
+ },
34004
34147
  "AIStreamResponseFinish": {
34005
34148
  "type": "object",
34006
34149
  "description": "Message emitted by the server to indicate the end of the AI response. It contains the ID of the response to be referenced for followup requests.\n",
@@ -34456,6 +34599,25 @@
34456
34599
  "mcpToolName"
34457
34600
  ]
34458
34601
  },
34602
+ "AIToolCallOther": {
34603
+ "type": "object",
34604
+ "description": "Any tool call that is unknown by GitBook",
34605
+ "properties": {
34606
+ "tool": {
34607
+ "type": "string",
34608
+ "enum": [
34609
+ "other"
34610
+ ]
34611
+ },
34612
+ "summary": {
34613
+ "$ref": "#/components/schemas/AIToolCallOtherSummary"
34614
+ }
34615
+ },
34616
+ "required": [
34617
+ "tool",
34618
+ "summary"
34619
+ ]
34620
+ },
34459
34621
  "AIToolCall": {
34460
34622
  "oneOf": [
34461
34623
  {
@@ -34493,6 +34655,9 @@
34493
34655
  },
34494
34656
  {
34495
34657
  "$ref": "#/components/schemas/AIToolCallMCP"
34658
+ },
34659
+ {
34660
+ "$ref": "#/components/schemas/AIToolCallOther"
34496
34661
  }
34497
34662
  ]
34498
34663
  },
@@ -34525,6 +34690,59 @@
34525
34690
  "toolCall"
34526
34691
  ]
34527
34692
  },
34693
+ "AIStreamResponseToolConfirm": {
34694
+ "type": "object",
34695
+ "description": "Message emitted by the server to indicate that the AI requires the user to confirm a tool call.\n",
34696
+ "properties": {
34697
+ "type": {
34698
+ "type": "string",
34699
+ "enum": [
34700
+ "response_tool_confirm"
34701
+ ]
34702
+ },
34703
+ "messageId": {
34704
+ "type": "string",
34705
+ "description": "The ID of the message that this event is composing.\n"
34706
+ },
34707
+ "stepIndex": {
34708
+ "type": "integer",
34709
+ "description": "The index of the step of the message that this event is composing.\n"
34710
+ },
34711
+ "toolCall": {
34712
+ "type": "object",
34713
+ "description": "The tool call that the AI requires the user to confirm.",
34714
+ "required": [
34715
+ "tool",
34716
+ "input"
34717
+ ],
34718
+ "properties": {
34719
+ "tool": {
34720
+ "type": "string",
34721
+ "description": "The name of the tool that the AI requires the user to confirm."
34722
+ },
34723
+ "input": {
34724
+ "type": "object",
34725
+ "description": "The input to the tool call."
34726
+ }
34727
+ }
34728
+ },
34729
+ "toolCallId": {
34730
+ "type": "string",
34731
+ "description": "The ID of the tool call that the AI requires the user to confirm."
34732
+ },
34733
+ "toolConfirmation": {
34734
+ "$ref": "#/components/schemas/AIToolConfirmation"
34735
+ }
34736
+ },
34737
+ "required": [
34738
+ "type",
34739
+ "messageId",
34740
+ "stepIndex",
34741
+ "toolCall",
34742
+ "toolCallId",
34743
+ "toolConfirmation"
34744
+ ]
34745
+ },
34528
34746
  "AIStreamResponseFollowupSuggestion": {
34529
34747
  "type": "object",
34530
34748
  "description": "Message emitted by the server to suggest a followup message the user could respond with.\n",
@@ -34567,6 +34785,9 @@
34567
34785
  {
34568
34786
  "$ref": "#/components/schemas/AIStreamResponseToolCall"
34569
34787
  },
34788
+ {
34789
+ "$ref": "#/components/schemas/AIStreamResponseToolConfirm"
34790
+ },
34570
34791
  {
34571
34792
  "$ref": "#/components/schemas/AIStreamResponseFollowupSuggestion"
34572
34793
  }
package/spec/openapi.yaml CHANGED
@@ -6344,6 +6344,23 @@ paths:
6344
6344
  description: Translation did not exist
6345
6345
  "205":
6346
6346
  description: Translation has been deleted
6347
+ "/orgs/{organizationId}/translations/{translationId}/run":
6348
+ post:
6349
+ operationId: runTranslation
6350
+ summary: Run a translation again
6351
+ tags:
6352
+ - translations
6353
+ security:
6354
+ - user: []
6355
+ parameters:
6356
+ - $ref: "#/components/parameters/organizationId"
6357
+ - $ref: "#/components/parameters/translationId"
6358
+ responses:
6359
+ "204":
6360
+ description: Translation run triggered
6361
+ "404":
6362
+ description: No matching translation found
6363
+ $ref: "#/components/responses/NotFoundError"
6347
6364
  "/orgs/{organizationId}/translations-glossary":
6348
6365
  get:
6349
6366
  operationId: listGlossaryEntries
@@ -7872,9 +7889,15 @@ paths:
7872
7889
  parameters:
7873
7890
  - $ref: "#/components/parameters/organizationId"
7874
7891
  - $ref: "#/components/parameters/siteId"
7892
+ - name: siteSpaceId
7893
+ in: query
7894
+ description: The ID of the site space to filter the recommended questions for.
7895
+ schema:
7896
+ type: string
7875
7897
  - name: spaceId
7876
7898
  in: query
7877
7899
  description: The ID of the space to filter the recommended questions for.
7900
+ deprecated: true
7878
7901
  schema:
7879
7902
  type: string
7880
7903
  responses:
@@ -8474,44 +8497,30 @@ paths:
8474
8497
  content:
8475
8498
  application/json:
8476
8499
  schema:
8477
- allOf:
8478
- - type: object
8479
- required:
8480
- - input
8481
- - output
8482
- properties:
8483
- previousResponseId:
8484
- type: string
8485
- description: The ID of the previous response to continue from
8486
- input:
8487
- type: array
8488
- items:
8489
- $ref: "#/components/schemas/AIMessageInput"
8490
- output:
8491
- $ref: "#/components/schemas/AIOutputFormat"
8492
- model:
8493
- $ref: "#/components/schemas/AIModel"
8494
- - oneOf:
8495
- - type: object
8496
- required:
8497
- - mode
8498
- - instructions
8499
- properties:
8500
- mode:
8501
- type: string
8502
- enum:
8503
- - custom
8504
- instructions:
8505
- type: string
8506
- description: Custom instructions for the AI
8507
- - type: object
8508
- required:
8509
- - mode
8510
- properties:
8511
- mode:
8512
- type: string
8513
- enum:
8514
- - assistant
8500
+ type: object
8501
+ required:
8502
+ - input
8503
+ properties:
8504
+ previousResponseId:
8505
+ type: string
8506
+ description: The ID of the previous response to continue from
8507
+ input:
8508
+ type: array
8509
+ description: The messages to send to the AI agent.
8510
+ items:
8511
+ $ref: "#/components/schemas/AIMessageInput"
8512
+ output:
8513
+ deprecated: true
8514
+ $ref: "#/components/schemas/AIOutputFormat"
8515
+ model:
8516
+ $ref: "#/components/schemas/AIModel"
8517
+ tools:
8518
+ type: array
8519
+ description: Custom tools to provide to the AI agent.
8520
+ items:
8521
+ $ref: "#/components/schemas/AIToolDefinition"
8522
+ toolCall:
8523
+ $ref: "#/components/schemas/AIToolCallResult"
8515
8524
  responses:
8516
8525
  "200":
8517
8526
  description: OK
@@ -11496,6 +11505,7 @@ components:
11496
11505
  oneOf:
11497
11506
  - type: number
11498
11507
  - type: string
11508
+ nullable: true
11499
11509
  - type: boolean
11500
11510
  - type: array
11501
11511
  items:
@@ -15571,6 +15581,7 @@ components:
15571
15581
  - site:visitor:auth
15572
15582
  - site:adaptive:read
15573
15583
  - site:adaptive:write
15584
+ - site:ai:ask
15574
15585
  - openapi:read
15575
15586
  - openapi:write
15576
15587
  - conversations:ingest
@@ -20399,6 +20410,7 @@ components:
20399
20410
  - none
20400
20411
  - search
20401
20412
  - assistant
20413
+ - integration
20402
20414
  SiteExternalLinksTarget:
20403
20415
  type: string
20404
20416
  description: |
@@ -20555,6 +20567,9 @@ components:
20555
20567
  properties:
20556
20568
  mode:
20557
20569
  $ref: "#/components/schemas/CustomizationAIMode"
20570
+ integrationId:
20571
+ type: string
20572
+ description: The integration to use for the AI features on the site. Only required if mode is set to "integration".
20558
20573
  required:
20559
20574
  - mode
20560
20575
  advancedCustomization:
@@ -21027,6 +21042,97 @@ components:
21027
21042
  - reasoning-low
21028
21043
  - reasoning-medium
21029
21044
  - reasoning-high
21045
+ AIToolConfirmation:
21046
+ type: object
21047
+ description: Confirmation to display to the user when the AI requires the user to confirm a tool call.
21048
+ properties:
21049
+ label:
21050
+ type: string
21051
+ description: Label to display in the UI when the user is prompted to confirm this tool.
21052
+ icon:
21053
+ description: Icon to display in the UI when the user is prompted to confirm this tool.
21054
+ $ref: "#/components/schemas/Icon"
21055
+ required:
21056
+ - label
21057
+ AIToolDefinition:
21058
+ type: object
21059
+ description: Description of a tool that can be called from an AI agent.
21060
+ properties:
21061
+ name:
21062
+ type: string
21063
+ description: The name of the tool. It should be unique within the agent.
21064
+ description:
21065
+ type: string
21066
+ description: The description of the tool, passed to the AI agent.
21067
+ inputSchema:
21068
+ type: object
21069
+ description: JSON schema describing the input of the tool.
21070
+ properties:
21071
+ type:
21072
+ type: string
21073
+ enum:
21074
+ - object
21075
+ properties:
21076
+ type: object
21077
+ additionalProperties:
21078
+ type: object
21079
+ properties:
21080
+ type:
21081
+ type: string
21082
+ enum:
21083
+ - string
21084
+ - number
21085
+ - boolean
21086
+ - array
21087
+ - object
21088
+ description:
21089
+ type: string
21090
+ description: Description of the property.
21091
+ required:
21092
+ - type
21093
+ - description
21094
+ additionalProperties: true
21095
+ required:
21096
+ - type
21097
+ - properties
21098
+ confirmation:
21099
+ $ref: "#/components/schemas/AIToolConfirmation"
21100
+ required:
21101
+ - name
21102
+ - description
21103
+ - confirmation
21104
+ AIToolCallOtherSummary:
21105
+ type: object
21106
+ description: Summary of a generic tool call.
21107
+ properties:
21108
+ icon:
21109
+ $ref: "#/components/schemas/Icon"
21110
+ text:
21111
+ type: string
21112
+ description: Text to display to the user to describe the tool call.
21113
+ required:
21114
+ - icon
21115
+ - text
21116
+ AIToolCallResult:
21117
+ type: object
21118
+ description: Result of a tool call.
21119
+ required:
21120
+ - tool
21121
+ - toolCallId
21122
+ - output
21123
+ - summary
21124
+ properties:
21125
+ tool:
21126
+ type: string
21127
+ description: The name of the tool that was called.
21128
+ toolCallId:
21129
+ type: string
21130
+ description: The ID of the tool call.
21131
+ output:
21132
+ type: object
21133
+ description: The output to the tool call.
21134
+ summary:
21135
+ $ref: "#/components/schemas/AIToolCallOtherSummary"
21030
21136
  AIStreamResponseFinish:
21031
21137
  type: object
21032
21138
  description: |
@@ -21363,6 +21469,19 @@ components:
21363
21469
  - tool
21364
21470
  - mcpServerId
21365
21471
  - mcpToolName
21472
+ AIToolCallOther:
21473
+ type: object
21474
+ description: Any tool call that is unknown by GitBook
21475
+ properties:
21476
+ tool:
21477
+ type: string
21478
+ enum:
21479
+ - other
21480
+ summary:
21481
+ $ref: "#/components/schemas/AIToolCallOtherSummary"
21482
+ required:
21483
+ - tool
21484
+ - summary
21366
21485
  AIToolCall:
21367
21486
  oneOf:
21368
21487
  - $ref: "#/components/schemas/AIToolCallGetPageContent"
@@ -21377,6 +21496,7 @@ components:
21377
21496
  - $ref: "#/components/schemas/AIToolCallGetPageDiff"
21378
21497
  - $ref: "#/components/schemas/AIToolCallCreateAgentTask"
21379
21498
  - $ref: "#/components/schemas/AIToolCallMCP"
21499
+ - $ref: "#/components/schemas/AIToolCallOther"
21380
21500
  AIStreamResponseToolCall:
21381
21501
  type: object
21382
21502
  description: |
@@ -21401,6 +21521,48 @@ components:
21401
21521
  - messageId
21402
21522
  - stepIndex
21403
21523
  - toolCall
21524
+ AIStreamResponseToolConfirm:
21525
+ type: object
21526
+ description: |
21527
+ Message emitted by the server to indicate that the AI requires the user to confirm a tool call.
21528
+ properties:
21529
+ type:
21530
+ type: string
21531
+ enum:
21532
+ - response_tool_confirm
21533
+ messageId:
21534
+ type: string
21535
+ description: |
21536
+ The ID of the message that this event is composing.
21537
+ stepIndex:
21538
+ type: integer
21539
+ description: |
21540
+ The index of the step of the message that this event is composing.
21541
+ toolCall:
21542
+ type: object
21543
+ description: The tool call that the AI requires the user to confirm.
21544
+ required:
21545
+ - tool
21546
+ - input
21547
+ properties:
21548
+ tool:
21549
+ type: string
21550
+ description: The name of the tool that the AI requires the user to confirm.
21551
+ input:
21552
+ type: object
21553
+ description: The input to the tool call.
21554
+ toolCallId:
21555
+ type: string
21556
+ description: The ID of the tool call that the AI requires the user to confirm.
21557
+ toolConfirmation:
21558
+ $ref: "#/components/schemas/AIToolConfirmation"
21559
+ required:
21560
+ - type
21561
+ - messageId
21562
+ - stepIndex
21563
+ - toolCall
21564
+ - toolCallId
21565
+ - toolConfirmation
21404
21566
  AIStreamResponseFollowupSuggestion:
21405
21567
  type: object
21406
21568
  description: |
@@ -21430,6 +21592,7 @@ components:
21430
21592
  - $ref: "#/components/schemas/AIStreamResponseDocument"
21431
21593
  - $ref: "#/components/schemas/AIStreamResponseObject"
21432
21594
  - $ref: "#/components/schemas/AIStreamResponseToolCall"
21595
+ - $ref: "#/components/schemas/AIStreamResponseToolConfirm"
21433
21596
  - $ref: "#/components/schemas/AIStreamResponseFollowupSuggestion"
21434
21597
  SiteInsightsEventSession:
21435
21598
  type: object