@gitbook/api 0.134.0 → 0.136.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,41 @@ export declare enum AIModel {
5349
5353
  ReasoningMedium = "reasoning-medium",
5350
5354
  ReasoningHigh = "reasoning-high"
5351
5355
  }
5356
+ /** Description of a tool that can be called from an AI agent. */
5357
+ export interface AIToolDefinition {
5358
+ /** The name of the tool. It should be unique within the agent. */
5359
+ name: string;
5360
+ /** The description of the tool, passed to the AI agent. */
5361
+ description: string;
5362
+ /** JSON schema describing the input of the tool. */
5363
+ inputSchema?: {
5364
+ type: 'object';
5365
+ properties: Record<string, {
5366
+ type: 'string' | 'number' | 'boolean' | 'array' | 'object';
5367
+ /** Description of the property. */
5368
+ description: string;
5369
+ [key: string]: any;
5370
+ }>;
5371
+ };
5372
+ }
5373
+ /** Summary of a generic tool call. */
5374
+ export interface AIToolCallOtherSummary {
5375
+ /** Name of the icon */
5376
+ icon: Icon;
5377
+ /** Text to display to the user to describe the tool call. */
5378
+ text: string;
5379
+ }
5380
+ /** Result of a tool call. */
5381
+ export interface AIToolCallResult {
5382
+ /** The name of the tool that was called. */
5383
+ tool: string;
5384
+ /** The ID of the tool call. */
5385
+ toolCallId: string;
5386
+ /** The output to the tool call. */
5387
+ output: object;
5388
+ /** Summary of a generic tool call. */
5389
+ summary?: AIToolCallOtherSummary;
5390
+ }
5352
5391
  /** 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
5392
  export interface AIStreamResponseFinish {
5354
5393
  type: 'response_finish';
@@ -5485,7 +5524,13 @@ export interface AIToolCallMCP {
5485
5524
  /** The title of the tool that has been called. */
5486
5525
  mcpToolTitle?: string;
5487
5526
  }
5488
- export type AIToolCall = AIToolCallGetPageContent | AIToolCallGetPages | AIToolCallSearch | AIToolCallEditPage | AIToolCallCreatePage | AIToolCallDeletePage | AIToolCallRenamePage | AIToolCallMovePage | AIToolCallListModifiedPages | AIToolCallGetPageDiff | AIToolCallCreateAgentTask | AIToolCallMCP;
5527
+ /** Any tool call that is unknown by GitBook */
5528
+ export interface AIToolCallOther {
5529
+ tool: 'other';
5530
+ /** Summary of a generic tool call. */
5531
+ summary: AIToolCallOtherSummary;
5532
+ }
5533
+ export type AIToolCall = AIToolCallGetPageContent | AIToolCallGetPages | AIToolCallSearch | AIToolCallEditPage | AIToolCallCreatePage | AIToolCallDeletePage | AIToolCallRenamePage | AIToolCallMovePage | AIToolCallListModifiedPages | AIToolCallGetPageDiff | AIToolCallCreateAgentTask | AIToolCallMCP | AIToolCallOther;
5489
5534
  /** Message emitted by the server to indicate that the AI has called a tool. */
5490
5535
  export interface AIStreamResponseToolCall {
5491
5536
  type: 'response_tool_call';
@@ -5495,6 +5540,23 @@ export interface AIStreamResponseToolCall {
5495
5540
  stepIndex: number;
5496
5541
  toolCall: AIToolCall;
5497
5542
  }
5543
+ /** Message emitted by the server to indicate that the AI is calling a client-side tool. */
5544
+ export interface AIStreamResponseToolCallPending {
5545
+ type: 'response_tool_call_pending';
5546
+ /** The ID of the message that this event is composing. */
5547
+ messageId: string;
5548
+ /** The index of the step of the message that this event is composing. */
5549
+ stepIndex: number;
5550
+ /** The tool call that the AI is calling. */
5551
+ toolCall: {
5552
+ /** The name of the tool that the AI is calling. */
5553
+ tool: string;
5554
+ /** The input to the tool call. */
5555
+ input: object;
5556
+ };
5557
+ /** The ID of the tool call that the AI is calling. */
5558
+ toolCallId: string;
5559
+ }
5498
5560
  /** Message emitted by the server to suggest a followup message the user could respond with. */
5499
5561
  export interface AIStreamResponseFollowupSuggestion {
5500
5562
  type: 'response_followup_suggestion';
@@ -5502,7 +5564,7 @@ export interface AIStreamResponseFollowupSuggestion {
5502
5564
  messageId: string;
5503
5565
  suggestions: string[];
5504
5566
  }
5505
- export type AIStreamResponse = AIStreamResponseFinish | AIStreamResponseDocument | AIStreamResponseObject | AIStreamResponseToolCall | AIStreamResponseFollowupSuggestion;
5567
+ export type AIStreamResponse = AIStreamResponseFinish | AIStreamResponseDocument | AIStreamResponseObject | AIStreamResponseToolCall | AIStreamResponseToolCallPending | AIStreamResponseFollowupSuggestion;
5506
5568
  /** Analytics info on the GitBook's site session. */
5507
5569
  export interface SiteInsightsEventSession {
5508
5570
  /** GitBook's unique identifier of the visitor. */
@@ -12496,16 +12558,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
12496
12558
  streamAiResponseInSite: (organizationId: string, siteId: string, data: {
12497
12559
  /** The ID of the previous response to continue from */
12498
12560
  previousResponseId?: string;
12561
+ /** The messages to send to the AI agent. */
12499
12562
  input: AIMessageInput[];
12500
- output: AIOutputFormat;
12563
+ /** @deprecated */
12564
+ output?: AIOutputFormat;
12501
12565
  model?: AIModel;
12502
- } & ({
12503
- mode: "custom";
12504
- /** Custom instructions for the AI */
12505
- instructions: string;
12506
- } | {
12507
- mode: "assistant";
12508
- }), params?: RequestParams) => EventIterator<AIStreamResponse>;
12566
+ /** Custom tools to provide to the AI agent. */
12567
+ tools?: AIToolDefinition[];
12568
+ /** Result of a tool call. */
12569
+ toolCall?: AIToolCallResult;
12570
+ }, params?: RequestParams) => EventIterator<AIStreamResponse>;
12509
12571
  /**
12510
12572
  * @description Experimental operation to get an existing AI response in a site.
12511
12573
  *
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.134.0";
282
+ var version = "0.136.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) => {
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.134.0";
175
+ var version = "0.136.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) => {
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.134.0",
7
+ "version": "0.136.0",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "README.md",
package/spec/openapi.json CHANGED
@@ -15032,70 +15032,40 @@
15032
15032
  "content": {
15033
15033
  "application/json": {
15034
15034
  "schema": {
15035
- "allOf": [
15036
- {
15037
- "type": "object",
15038
- "required": [
15039
- "input",
15040
- "output"
15041
- ],
15042
- "properties": {
15043
- "previousResponseId": {
15044
- "type": "string",
15045
- "description": "The ID of the previous response to continue from"
15046
- },
15047
- "input": {
15048
- "type": "array",
15049
- "items": {
15050
- "$ref": "#/components/schemas/AIMessageInput"
15051
- }
15052
- },
15053
- "output": {
15054
- "$ref": "#/components/schemas/AIOutputFormat"
15055
- },
15056
- "model": {
15057
- "$ref": "#/components/schemas/AIModel"
15058
- }
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"
15059
15049
  }
15060
15050
  },
15061
- {
15062
- "oneOf": [
15063
- {
15064
- "type": "object",
15065
- "required": [
15066
- "mode",
15067
- "instructions"
15068
- ],
15069
- "properties": {
15070
- "mode": {
15071
- "type": "string",
15072
- "enum": [
15073
- "custom"
15074
- ]
15075
- },
15076
- "instructions": {
15077
- "type": "string",
15078
- "description": "Custom instructions for the AI"
15079
- }
15080
- }
15081
- },
15082
- {
15083
- "type": "object",
15084
- "required": [
15085
- "mode"
15086
- ],
15087
- "properties": {
15088
- "mode": {
15089
- "type": "string",
15090
- "enum": [
15091
- "assistant"
15092
- ]
15093
- }
15094
- }
15095
- }
15096
- ]
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"
15097
15067
  }
15098
- ]
15068
+ }
15099
15069
  }
15100
15070
  }
15101
15071
  }
@@ -19613,7 +19583,8 @@
19613
19583
  "type": "number"
19614
19584
  },
19615
19585
  {
19616
- "type": "string"
19586
+ "type": "string",
19587
+ "nullable": true
19617
19588
  },
19618
19589
  {
19619
19590
  "type": "boolean"
@@ -25958,6 +25929,7 @@
25958
25929
  "site:visitor:auth",
25959
25930
  "site:adaptive:read",
25960
25931
  "site:adaptive:write",
25932
+ "site:ai:ask",
25961
25933
  "openapi:read",
25962
25934
  "openapi:write",
25963
25935
  "conversations:ingest"
@@ -33110,7 +33082,8 @@
33110
33082
  "enum": [
33111
33083
  "none",
33112
33084
  "search",
33113
- "assistant"
33085
+ "assistant",
33086
+ "integration"
33114
33087
  ]
33115
33088
  },
33116
33089
  "SiteExternalLinksTarget": {
@@ -33326,6 +33299,10 @@
33326
33299
  "properties": {
33327
33300
  "mode": {
33328
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\"."
33329
33306
  }
33330
33307
  },
33331
33308
  "required": [
@@ -34041,6 +34018,111 @@
34041
34018
  "reasoning-high"
34042
34019
  ]
34043
34020
  },
34021
+ "AIToolDefinition": {
34022
+ "type": "object",
34023
+ "description": "Description of a tool that can be called from an AI agent.",
34024
+ "properties": {
34025
+ "name": {
34026
+ "type": "string",
34027
+ "description": "The name of the tool. It should be unique within the agent."
34028
+ },
34029
+ "description": {
34030
+ "type": "string",
34031
+ "description": "The description of the tool, passed to the AI agent."
34032
+ },
34033
+ "inputSchema": {
34034
+ "type": "object",
34035
+ "description": "JSON schema describing the input of the tool.",
34036
+ "properties": {
34037
+ "type": {
34038
+ "type": "string",
34039
+ "enum": [
34040
+ "object"
34041
+ ]
34042
+ },
34043
+ "properties": {
34044
+ "type": "object",
34045
+ "additionalProperties": {
34046
+ "type": "object",
34047
+ "properties": {
34048
+ "type": {
34049
+ "type": "string",
34050
+ "enum": [
34051
+ "string",
34052
+ "number",
34053
+ "boolean",
34054
+ "array",
34055
+ "object"
34056
+ ]
34057
+ },
34058
+ "description": {
34059
+ "type": "string",
34060
+ "description": "Description of the property."
34061
+ }
34062
+ },
34063
+ "required": [
34064
+ "type",
34065
+ "description"
34066
+ ],
34067
+ "additionalProperties": true
34068
+ }
34069
+ }
34070
+ },
34071
+ "required": [
34072
+ "type",
34073
+ "properties"
34074
+ ]
34075
+ }
34076
+ },
34077
+ "required": [
34078
+ "name",
34079
+ "description",
34080
+ "confirmation"
34081
+ ]
34082
+ },
34083
+ "AIToolCallOtherSummary": {
34084
+ "type": "object",
34085
+ "description": "Summary of a generic tool call.",
34086
+ "properties": {
34087
+ "icon": {
34088
+ "$ref": "#/components/schemas/Icon"
34089
+ },
34090
+ "text": {
34091
+ "type": "string",
34092
+ "description": "Text to display to the user to describe the tool call."
34093
+ }
34094
+ },
34095
+ "required": [
34096
+ "icon",
34097
+ "text"
34098
+ ]
34099
+ },
34100
+ "AIToolCallResult": {
34101
+ "type": "object",
34102
+ "description": "Result of a tool call.",
34103
+ "required": [
34104
+ "tool",
34105
+ "toolCallId",
34106
+ "output"
34107
+ ],
34108
+ "properties": {
34109
+ "tool": {
34110
+ "type": "string",
34111
+ "description": "The name of the tool that was called."
34112
+ },
34113
+ "toolCallId": {
34114
+ "type": "string",
34115
+ "description": "The ID of the tool call."
34116
+ },
34117
+ "output": {
34118
+ "type": "object",
34119
+ "description": "The output to the tool call."
34120
+ },
34121
+ "summary": {
34122
+ "$ref": "#/components/schemas/AIToolCallOtherSummary"
34123
+ }
34124
+ }
34125
+ },
34044
34126
  "AIStreamResponseFinish": {
34045
34127
  "type": "object",
34046
34128
  "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",
@@ -34496,6 +34578,25 @@
34496
34578
  "mcpToolName"
34497
34579
  ]
34498
34580
  },
34581
+ "AIToolCallOther": {
34582
+ "type": "object",
34583
+ "description": "Any tool call that is unknown by GitBook",
34584
+ "properties": {
34585
+ "tool": {
34586
+ "type": "string",
34587
+ "enum": [
34588
+ "other"
34589
+ ]
34590
+ },
34591
+ "summary": {
34592
+ "$ref": "#/components/schemas/AIToolCallOtherSummary"
34593
+ }
34594
+ },
34595
+ "required": [
34596
+ "tool",
34597
+ "summary"
34598
+ ]
34599
+ },
34499
34600
  "AIToolCall": {
34500
34601
  "oneOf": [
34501
34602
  {
@@ -34533,6 +34634,9 @@
34533
34634
  },
34534
34635
  {
34535
34636
  "$ref": "#/components/schemas/AIToolCallMCP"
34637
+ },
34638
+ {
34639
+ "$ref": "#/components/schemas/AIToolCallOther"
34536
34640
  }
34537
34641
  ]
34538
34642
  },
@@ -34565,6 +34669,55 @@
34565
34669
  "toolCall"
34566
34670
  ]
34567
34671
  },
34672
+ "AIStreamResponseToolCallPending": {
34673
+ "type": "object",
34674
+ "description": "Message emitted by the server to indicate that the AI is calling a client-side tool.\n",
34675
+ "properties": {
34676
+ "type": {
34677
+ "type": "string",
34678
+ "enum": [
34679
+ "response_tool_call_pending"
34680
+ ]
34681
+ },
34682
+ "messageId": {
34683
+ "type": "string",
34684
+ "description": "The ID of the message that this event is composing.\n"
34685
+ },
34686
+ "stepIndex": {
34687
+ "type": "integer",
34688
+ "description": "The index of the step of the message that this event is composing.\n"
34689
+ },
34690
+ "toolCall": {
34691
+ "type": "object",
34692
+ "description": "The tool call that the AI is calling.",
34693
+ "required": [
34694
+ "tool",
34695
+ "input"
34696
+ ],
34697
+ "properties": {
34698
+ "tool": {
34699
+ "type": "string",
34700
+ "description": "The name of the tool that the AI is calling."
34701
+ },
34702
+ "input": {
34703
+ "type": "object",
34704
+ "description": "The input to the tool call."
34705
+ }
34706
+ }
34707
+ },
34708
+ "toolCallId": {
34709
+ "type": "string",
34710
+ "description": "The ID of the tool call that the AI is calling."
34711
+ }
34712
+ },
34713
+ "required": [
34714
+ "type",
34715
+ "messageId",
34716
+ "stepIndex",
34717
+ "toolCall",
34718
+ "toolCallId"
34719
+ ]
34720
+ },
34568
34721
  "AIStreamResponseFollowupSuggestion": {
34569
34722
  "type": "object",
34570
34723
  "description": "Message emitted by the server to suggest a followup message the user could respond with.\n",
@@ -34607,6 +34760,9 @@
34607
34760
  {
34608
34761
  "$ref": "#/components/schemas/AIStreamResponseToolCall"
34609
34762
  },
34763
+ {
34764
+ "$ref": "#/components/schemas/AIStreamResponseToolCallPending"
34765
+ },
34610
34766
  {
34611
34767
  "$ref": "#/components/schemas/AIStreamResponseFollowupSuggestion"
34612
34768
  }
package/spec/openapi.yaml CHANGED
@@ -8497,44 +8497,30 @@ paths:
8497
8497
  content:
8498
8498
  application/json:
8499
8499
  schema:
8500
- allOf:
8501
- - type: object
8502
- required:
8503
- - input
8504
- - output
8505
- properties:
8506
- previousResponseId:
8507
- type: string
8508
- description: The ID of the previous response to continue from
8509
- input:
8510
- type: array
8511
- items:
8512
- $ref: "#/components/schemas/AIMessageInput"
8513
- output:
8514
- $ref: "#/components/schemas/AIOutputFormat"
8515
- model:
8516
- $ref: "#/components/schemas/AIModel"
8517
- - oneOf:
8518
- - type: object
8519
- required:
8520
- - mode
8521
- - instructions
8522
- properties:
8523
- mode:
8524
- type: string
8525
- enum:
8526
- - custom
8527
- instructions:
8528
- type: string
8529
- description: Custom instructions for the AI
8530
- - type: object
8531
- required:
8532
- - mode
8533
- properties:
8534
- mode:
8535
- type: string
8536
- enum:
8537
- - 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"
8538
8524
  responses:
8539
8525
  "200":
8540
8526
  description: OK
@@ -11519,6 +11505,7 @@ components:
11519
11505
  oneOf:
11520
11506
  - type: number
11521
11507
  - type: string
11508
+ nullable: true
11522
11509
  - type: boolean
11523
11510
  - type: array
11524
11511
  items:
@@ -15594,6 +15581,7 @@ components:
15594
15581
  - site:visitor:auth
15595
15582
  - site:adaptive:read
15596
15583
  - site:adaptive:write
15584
+ - site:ai:ask
15597
15585
  - openapi:read
15598
15586
  - openapi:write
15599
15587
  - conversations:ingest
@@ -20422,6 +20410,7 @@ components:
20422
20410
  - none
20423
20411
  - search
20424
20412
  - assistant
20413
+ - integration
20425
20414
  SiteExternalLinksTarget:
20426
20415
  type: string
20427
20416
  description: |
@@ -20578,6 +20567,9 @@ components:
20578
20567
  properties:
20579
20568
  mode:
20580
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".
20581
20573
  required:
20582
20574
  - mode
20583
20575
  advancedCustomization:
@@ -21050,6 +21042,82 @@ components:
21050
21042
  - reasoning-low
21051
21043
  - reasoning-medium
21052
21044
  - reasoning-high
21045
+ AIToolDefinition:
21046
+ type: object
21047
+ description: Description of a tool that can be called from an AI agent.
21048
+ properties:
21049
+ name:
21050
+ type: string
21051
+ description: The name of the tool. It should be unique within the agent.
21052
+ description:
21053
+ type: string
21054
+ description: The description of the tool, passed to the AI agent.
21055
+ inputSchema:
21056
+ type: object
21057
+ description: JSON schema describing the input of the tool.
21058
+ properties:
21059
+ type:
21060
+ type: string
21061
+ enum:
21062
+ - object
21063
+ properties:
21064
+ type: object
21065
+ additionalProperties:
21066
+ type: object
21067
+ properties:
21068
+ type:
21069
+ type: string
21070
+ enum:
21071
+ - string
21072
+ - number
21073
+ - boolean
21074
+ - array
21075
+ - object
21076
+ description:
21077
+ type: string
21078
+ description: Description of the property.
21079
+ required:
21080
+ - type
21081
+ - description
21082
+ additionalProperties: true
21083
+ required:
21084
+ - type
21085
+ - properties
21086
+ required:
21087
+ - name
21088
+ - description
21089
+ - confirmation
21090
+ AIToolCallOtherSummary:
21091
+ type: object
21092
+ description: Summary of a generic tool call.
21093
+ properties:
21094
+ icon:
21095
+ $ref: "#/components/schemas/Icon"
21096
+ text:
21097
+ type: string
21098
+ description: Text to display to the user to describe the tool call.
21099
+ required:
21100
+ - icon
21101
+ - text
21102
+ AIToolCallResult:
21103
+ type: object
21104
+ description: Result of a tool call.
21105
+ required:
21106
+ - tool
21107
+ - toolCallId
21108
+ - output
21109
+ properties:
21110
+ tool:
21111
+ type: string
21112
+ description: The name of the tool that was called.
21113
+ toolCallId:
21114
+ type: string
21115
+ description: The ID of the tool call.
21116
+ output:
21117
+ type: object
21118
+ description: The output to the tool call.
21119
+ summary:
21120
+ $ref: "#/components/schemas/AIToolCallOtherSummary"
21053
21121
  AIStreamResponseFinish:
21054
21122
  type: object
21055
21123
  description: |
@@ -21386,6 +21454,19 @@ components:
21386
21454
  - tool
21387
21455
  - mcpServerId
21388
21456
  - mcpToolName
21457
+ AIToolCallOther:
21458
+ type: object
21459
+ description: Any tool call that is unknown by GitBook
21460
+ properties:
21461
+ tool:
21462
+ type: string
21463
+ enum:
21464
+ - other
21465
+ summary:
21466
+ $ref: "#/components/schemas/AIToolCallOtherSummary"
21467
+ required:
21468
+ - tool
21469
+ - summary
21389
21470
  AIToolCall:
21390
21471
  oneOf:
21391
21472
  - $ref: "#/components/schemas/AIToolCallGetPageContent"
@@ -21400,6 +21481,7 @@ components:
21400
21481
  - $ref: "#/components/schemas/AIToolCallGetPageDiff"
21401
21482
  - $ref: "#/components/schemas/AIToolCallCreateAgentTask"
21402
21483
  - $ref: "#/components/schemas/AIToolCallMCP"
21484
+ - $ref: "#/components/schemas/AIToolCallOther"
21403
21485
  AIStreamResponseToolCall:
21404
21486
  type: object
21405
21487
  description: |
@@ -21424,6 +21506,45 @@ components:
21424
21506
  - messageId
21425
21507
  - stepIndex
21426
21508
  - toolCall
21509
+ AIStreamResponseToolCallPending:
21510
+ type: object
21511
+ description: |
21512
+ Message emitted by the server to indicate that the AI is calling a client-side tool.
21513
+ properties:
21514
+ type:
21515
+ type: string
21516
+ enum:
21517
+ - response_tool_call_pending
21518
+ messageId:
21519
+ type: string
21520
+ description: |
21521
+ The ID of the message that this event is composing.
21522
+ stepIndex:
21523
+ type: integer
21524
+ description: |
21525
+ The index of the step of the message that this event is composing.
21526
+ toolCall:
21527
+ type: object
21528
+ description: The tool call that the AI is calling.
21529
+ required:
21530
+ - tool
21531
+ - input
21532
+ properties:
21533
+ tool:
21534
+ type: string
21535
+ description: The name of the tool that the AI is calling.
21536
+ input:
21537
+ type: object
21538
+ description: The input to the tool call.
21539
+ toolCallId:
21540
+ type: string
21541
+ description: The ID of the tool call that the AI is calling.
21542
+ required:
21543
+ - type
21544
+ - messageId
21545
+ - stepIndex
21546
+ - toolCall
21547
+ - toolCallId
21427
21548
  AIStreamResponseFollowupSuggestion:
21428
21549
  type: object
21429
21550
  description: |
@@ -21453,6 +21574,7 @@ components:
21453
21574
  - $ref: "#/components/schemas/AIStreamResponseDocument"
21454
21575
  - $ref: "#/components/schemas/AIStreamResponseObject"
21455
21576
  - $ref: "#/components/schemas/AIStreamResponseToolCall"
21577
+ - $ref: "#/components/schemas/AIStreamResponseToolCallPending"
21456
21578
  - $ref: "#/components/schemas/AIStreamResponseFollowupSuggestion"
21457
21579
  SiteInsightsEventSession:
21458
21580
  type: object