@gitbook/api 0.102.0 → 0.103.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 +95 -0
- package/dist/index.cjs +25 -1
- package/dist/index.js +23 -1
- package/package.json +1 -1
- package/spec/openapi.json +358 -0
- package/spec/openapi.yaml +238 -0
package/dist/client.d.ts
CHANGED
|
@@ -4566,6 +4566,85 @@ export interface UserSitePermission {
|
|
|
4566
4566
|
/** The content or organization that enforced this permission level. */
|
|
4567
4567
|
origin: SpacePointer | OrganizationPointer;
|
|
4568
4568
|
}
|
|
4569
|
+
export declare enum AIMessageRole {
|
|
4570
|
+
User = "user",
|
|
4571
|
+
Developer = "developer"
|
|
4572
|
+
}
|
|
4573
|
+
/** Attachment to extract knowledge matching a given query. */
|
|
4574
|
+
export interface AIMessageAttachmentKnowledge {
|
|
4575
|
+
type: 'knowledge';
|
|
4576
|
+
/** The query to use to extract the knowledge. */
|
|
4577
|
+
query: string;
|
|
4578
|
+
}
|
|
4579
|
+
/** Attachment representing the profile of the visitor */
|
|
4580
|
+
export interface AIMessageAttachmentVisitorProfile {
|
|
4581
|
+
type: 'visitor_profile';
|
|
4582
|
+
}
|
|
4583
|
+
/** Attachment to extract and pass the content of a page to the AI */
|
|
4584
|
+
export interface AIMessageAttachmentPage {
|
|
4585
|
+
type: 'page';
|
|
4586
|
+
/** The ID of the space to extract the content from */
|
|
4587
|
+
spaceId: string;
|
|
4588
|
+
/** The ID of the revision to extract the content from */
|
|
4589
|
+
revisionId: string;
|
|
4590
|
+
/** The ID of the page to extract the content from */
|
|
4591
|
+
pageId: string;
|
|
4592
|
+
}
|
|
4593
|
+
/** Attachment to pass the tree of pages to the AI */
|
|
4594
|
+
export interface AIMessageAttachmentPages {
|
|
4595
|
+
type: 'pages';
|
|
4596
|
+
/** The ID of the space to extract the content from */
|
|
4597
|
+
spaceId: string;
|
|
4598
|
+
/** The ID of the revision to extract the content from */
|
|
4599
|
+
revisionId: string;
|
|
4600
|
+
}
|
|
4601
|
+
export type AIMessageAttachment = AIMessageAttachmentKnowledge | AIMessageAttachmentVisitorProfile | AIMessageAttachmentPage | AIMessageAttachmentPages;
|
|
4602
|
+
export interface AIMessageInput {
|
|
4603
|
+
role: AIMessageRole;
|
|
4604
|
+
/** @maxLength 2048 */
|
|
4605
|
+
content: string;
|
|
4606
|
+
attachments?: AIMessageAttachment[];
|
|
4607
|
+
}
|
|
4608
|
+
/** Indicate that the AI should response with a JSON object corresponding to the provided schema. */
|
|
4609
|
+
export interface AIOutputFormatObject {
|
|
4610
|
+
type: 'object';
|
|
4611
|
+
/** The JSON schema to use for the object. */
|
|
4612
|
+
schema: {
|
|
4613
|
+
type?: 'object';
|
|
4614
|
+
properties?: any;
|
|
4615
|
+
required?: string[];
|
|
4616
|
+
};
|
|
4617
|
+
}
|
|
4618
|
+
/** Indicate that the AI should respond with a rich text document. */
|
|
4619
|
+
export interface AIOutputFormatDocument {
|
|
4620
|
+
type: 'document';
|
|
4621
|
+
}
|
|
4622
|
+
export type AIOutputFormat = AIOutputFormatObject | AIOutputFormatDocument;
|
|
4623
|
+
export declare enum AIModel {
|
|
4624
|
+
Fast = "fast",
|
|
4625
|
+
ReasoningLow = "reasoning-low",
|
|
4626
|
+
ReasoningMedium = "reasoning-medium",
|
|
4627
|
+
ReasoningHigh = "reasoning-high"
|
|
4628
|
+
}
|
|
4629
|
+
/** 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. */
|
|
4630
|
+
export interface AIStreamResponseFinish {
|
|
4631
|
+
type: 'response_finish';
|
|
4632
|
+
/** The ID of the response */
|
|
4633
|
+
responseId: string;
|
|
4634
|
+
}
|
|
4635
|
+
/** Message emitted by the server to indicate the latest block of the document. The block can either be a new block or an update to the previous block. */
|
|
4636
|
+
export interface AIStreamResponseDocument {
|
|
4637
|
+
type: 'response_document';
|
|
4638
|
+
operation: 'insert' | 'update';
|
|
4639
|
+
blocks: DocumentBlock[];
|
|
4640
|
+
}
|
|
4641
|
+
/** Message emitted by the server to indicate a chunk of the JSON object response. */
|
|
4642
|
+
export interface AIStreamResponseObject {
|
|
4643
|
+
type: 'response_object';
|
|
4644
|
+
/** The chunk of the JSON object response */
|
|
4645
|
+
jsonChunk: string;
|
|
4646
|
+
}
|
|
4647
|
+
export type AIStreamResponse = AIStreamResponseFinish | AIStreamResponseDocument | AIStreamResponseObject;
|
|
4569
4648
|
/** Analytics info on the GitBook's site session. */
|
|
4570
4649
|
export interface SiteInsightsEventSession {
|
|
4571
4650
|
/** GitBook's unique identifier of the visitor. */
|
|
@@ -10869,6 +10948,22 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10869
10948
|
}, params?: RequestParams) => Promise<HttpResponse<List & {
|
|
10870
10949
|
items: UserSitePermission[];
|
|
10871
10950
|
}, Error>>;
|
|
10951
|
+
/**
|
|
10952
|
+
* @description Experimental operation to generate an AI response in a site.
|
|
10953
|
+
*
|
|
10954
|
+
* @tags sites
|
|
10955
|
+
* @name StreamAiResponseInSite
|
|
10956
|
+
* @summary Generate an AI response in a site
|
|
10957
|
+
* @request POST:/orgs/{organizationId}/sites/{siteId}/ai/response
|
|
10958
|
+
* @secure
|
|
10959
|
+
*/
|
|
10960
|
+
streamAiResponseInSite: (organizationId: string, siteId: string, data: {
|
|
10961
|
+
/** The ID of the previous response to continue from */
|
|
10962
|
+
previousResponseId?: string;
|
|
10963
|
+
input: AIMessageInput[];
|
|
10964
|
+
output: AIOutputFormat;
|
|
10965
|
+
model?: AIModel;
|
|
10966
|
+
}, params?: RequestParams) => EventIterator<AIStreamResponse>;
|
|
10872
10967
|
/**
|
|
10873
10968
|
* @description Track events in a site.
|
|
10874
10969
|
*
|
package/dist/index.cjs
CHANGED
|
@@ -179,6 +179,8 @@ var require_node = __commonJS({
|
|
|
179
179
|
// src/index.ts
|
|
180
180
|
var src_exports = {};
|
|
181
181
|
__export(src_exports, {
|
|
182
|
+
AIMessageRole: () => AIMessageRole,
|
|
183
|
+
AIModel: () => AIModel,
|
|
182
184
|
APIIntegrationScope: () => APIIntegrationScope,
|
|
183
185
|
Api: () => Api,
|
|
184
186
|
BillingInterval: () => BillingInterval,
|
|
@@ -265,7 +267,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
265
267
|
|
|
266
268
|
// package.json
|
|
267
269
|
var name = "@gitbook/api";
|
|
268
|
-
var version = "0.
|
|
270
|
+
var version = "0.103.0";
|
|
269
271
|
|
|
270
272
|
// src/client.ts
|
|
271
273
|
var import_event_iterator = __toESM(require_node(), 1);
|
|
@@ -763,6 +765,18 @@ var CustomizationThemeMode = /* @__PURE__ */ ((CustomizationThemeMode2) => {
|
|
|
763
765
|
CustomizationThemeMode2["Dark"] = "dark";
|
|
764
766
|
return CustomizationThemeMode2;
|
|
765
767
|
})(CustomizationThemeMode || {});
|
|
768
|
+
var AIMessageRole = /* @__PURE__ */ ((AIMessageRole2) => {
|
|
769
|
+
AIMessageRole2["User"] = "user";
|
|
770
|
+
AIMessageRole2["Developer"] = "developer";
|
|
771
|
+
return AIMessageRole2;
|
|
772
|
+
})(AIMessageRole || {});
|
|
773
|
+
var AIModel = /* @__PURE__ */ ((AIModel2) => {
|
|
774
|
+
AIModel2["Fast"] = "fast";
|
|
775
|
+
AIModel2["ReasoningLow"] = "reasoning-low";
|
|
776
|
+
AIModel2["ReasoningMedium"] = "reasoning-medium";
|
|
777
|
+
AIModel2["ReasoningHigh"] = "reasoning-high";
|
|
778
|
+
return AIModel2;
|
|
779
|
+
})(AIModel || {});
|
|
766
780
|
var PageFeedbackRating = /* @__PURE__ */ ((PageFeedbackRating2) => {
|
|
767
781
|
PageFeedbackRating2["Bad"] = "bad";
|
|
768
782
|
PageFeedbackRating2["Ok"] = "ok";
|
|
@@ -3141,6 +3155,14 @@ var Api = class extends HttpClient {
|
|
|
3141
3155
|
format: "json",
|
|
3142
3156
|
...params
|
|
3143
3157
|
}),
|
|
3158
|
+
streamAiResponseInSite: (organizationId, siteId, data, params = {}) => this.streamRequest({
|
|
3159
|
+
path: `/orgs/${organizationId}/sites/${siteId}/ai/response`,
|
|
3160
|
+
method: "POST",
|
|
3161
|
+
body: data,
|
|
3162
|
+
secure: true,
|
|
3163
|
+
type: "application/json" /* Json */,
|
|
3164
|
+
...params
|
|
3165
|
+
}),
|
|
3144
3166
|
trackEventsInSiteById: (organizationId, siteId, data, params = {}) => this.request({
|
|
3145
3167
|
path: `/orgs/${organizationId}/sites/${siteId}/insights/events`,
|
|
3146
3168
|
method: "POST",
|
|
@@ -3365,6 +3387,8 @@ var GitBookAPI = class extends Api {
|
|
|
3365
3387
|
};
|
|
3366
3388
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3367
3389
|
0 && (module.exports = {
|
|
3390
|
+
AIMessageRole,
|
|
3391
|
+
AIModel,
|
|
3368
3392
|
APIIntegrationScope,
|
|
3369
3393
|
Api,
|
|
3370
3394
|
BillingInterval,
|
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.
|
|
175
|
+
var version = "0.103.0";
|
|
176
176
|
|
|
177
177
|
// src/client.ts
|
|
178
178
|
var import_event_iterator = __toESM(require_node(), 1);
|
|
@@ -670,6 +670,18 @@ var CustomizationThemeMode = /* @__PURE__ */ ((CustomizationThemeMode2) => {
|
|
|
670
670
|
CustomizationThemeMode2["Dark"] = "dark";
|
|
671
671
|
return CustomizationThemeMode2;
|
|
672
672
|
})(CustomizationThemeMode || {});
|
|
673
|
+
var AIMessageRole = /* @__PURE__ */ ((AIMessageRole2) => {
|
|
674
|
+
AIMessageRole2["User"] = "user";
|
|
675
|
+
AIMessageRole2["Developer"] = "developer";
|
|
676
|
+
return AIMessageRole2;
|
|
677
|
+
})(AIMessageRole || {});
|
|
678
|
+
var AIModel = /* @__PURE__ */ ((AIModel2) => {
|
|
679
|
+
AIModel2["Fast"] = "fast";
|
|
680
|
+
AIModel2["ReasoningLow"] = "reasoning-low";
|
|
681
|
+
AIModel2["ReasoningMedium"] = "reasoning-medium";
|
|
682
|
+
AIModel2["ReasoningHigh"] = "reasoning-high";
|
|
683
|
+
return AIModel2;
|
|
684
|
+
})(AIModel || {});
|
|
673
685
|
var PageFeedbackRating = /* @__PURE__ */ ((PageFeedbackRating2) => {
|
|
674
686
|
PageFeedbackRating2["Bad"] = "bad";
|
|
675
687
|
PageFeedbackRating2["Ok"] = "ok";
|
|
@@ -3048,6 +3060,14 @@ var Api = class extends HttpClient {
|
|
|
3048
3060
|
format: "json",
|
|
3049
3061
|
...params
|
|
3050
3062
|
}),
|
|
3063
|
+
streamAiResponseInSite: (organizationId, siteId, data, params = {}) => this.streamRequest({
|
|
3064
|
+
path: `/orgs/${organizationId}/sites/${siteId}/ai/response`,
|
|
3065
|
+
method: "POST",
|
|
3066
|
+
body: data,
|
|
3067
|
+
secure: true,
|
|
3068
|
+
type: "application/json" /* Json */,
|
|
3069
|
+
...params
|
|
3070
|
+
}),
|
|
3051
3071
|
trackEventsInSiteById: (organizationId, siteId, data, params = {}) => this.request({
|
|
3052
3072
|
path: `/orgs/${organizationId}/sites/${siteId}/insights/events`,
|
|
3053
3073
|
method: "POST",
|
|
@@ -3271,6 +3291,8 @@ var GitBookAPI = class extends Api {
|
|
|
3271
3291
|
}
|
|
3272
3292
|
};
|
|
3273
3293
|
export {
|
|
3294
|
+
AIMessageRole,
|
|
3295
|
+
AIModel,
|
|
3274
3296
|
APIIntegrationScope,
|
|
3275
3297
|
Api,
|
|
3276
3298
|
BillingInterval,
|
package/package.json
CHANGED
package/spec/openapi.json
CHANGED
|
@@ -13974,6 +13974,77 @@
|
|
|
13974
13974
|
}
|
|
13975
13975
|
}
|
|
13976
13976
|
},
|
|
13977
|
+
"/orgs/{organizationId}/sites/{siteId}/ai/response": {
|
|
13978
|
+
"post": {
|
|
13979
|
+
"operationId": "streamAIResponseInSite",
|
|
13980
|
+
"summary": "Generate an AI response in a site",
|
|
13981
|
+
"description": "Experimental operation to generate an AI response in a site.\n",
|
|
13982
|
+
"tags": [
|
|
13983
|
+
"sites"
|
|
13984
|
+
],
|
|
13985
|
+
"x-internal": true,
|
|
13986
|
+
"security": [
|
|
13987
|
+
{
|
|
13988
|
+
"user": []
|
|
13989
|
+
}
|
|
13990
|
+
],
|
|
13991
|
+
"parameters": [
|
|
13992
|
+
{
|
|
13993
|
+
"$ref": "#/components/parameters/organizationId"
|
|
13994
|
+
},
|
|
13995
|
+
{
|
|
13996
|
+
"$ref": "#/components/parameters/siteId"
|
|
13997
|
+
}
|
|
13998
|
+
],
|
|
13999
|
+
"requestBody": {
|
|
14000
|
+
"required": true,
|
|
14001
|
+
"content": {
|
|
14002
|
+
"application/json": {
|
|
14003
|
+
"schema": {
|
|
14004
|
+
"type": "object",
|
|
14005
|
+
"required": [
|
|
14006
|
+
"input",
|
|
14007
|
+
"output"
|
|
14008
|
+
],
|
|
14009
|
+
"properties": {
|
|
14010
|
+
"previousResponseId": {
|
|
14011
|
+
"type": "string",
|
|
14012
|
+
"description": "The ID of the previous response to continue from"
|
|
14013
|
+
},
|
|
14014
|
+
"input": {
|
|
14015
|
+
"type": "array",
|
|
14016
|
+
"items": {
|
|
14017
|
+
"$ref": "#/components/schemas/AIMessageInput"
|
|
14018
|
+
}
|
|
14019
|
+
},
|
|
14020
|
+
"output": {
|
|
14021
|
+
"$ref": "#/components/schemas/AIOutputFormat"
|
|
14022
|
+
},
|
|
14023
|
+
"model": {
|
|
14024
|
+
"$ref": "#/components/schemas/AIModel"
|
|
14025
|
+
}
|
|
14026
|
+
}
|
|
14027
|
+
}
|
|
14028
|
+
}
|
|
14029
|
+
}
|
|
14030
|
+
},
|
|
14031
|
+
"responses": {
|
|
14032
|
+
"200": {
|
|
14033
|
+
"description": "OK",
|
|
14034
|
+
"content": {
|
|
14035
|
+
"text/event-stream": {
|
|
14036
|
+
"schema": {
|
|
14037
|
+
"$ref": "#/components/schemas/AIStreamResponse"
|
|
14038
|
+
}
|
|
14039
|
+
}
|
|
14040
|
+
}
|
|
14041
|
+
},
|
|
14042
|
+
"default": {
|
|
14043
|
+
"$ref": "#/components/responses/UnexpectedError"
|
|
14044
|
+
}
|
|
14045
|
+
}
|
|
14046
|
+
}
|
|
14047
|
+
},
|
|
13977
14048
|
"/orgs/{organizationId}/sites/{siteId}/insights/events": {
|
|
13978
14049
|
"post": {
|
|
13979
14050
|
"operationId": "trackEventsInSiteById",
|
|
@@ -30073,6 +30144,293 @@
|
|
|
30073
30144
|
"origin"
|
|
30074
30145
|
]
|
|
30075
30146
|
},
|
|
30147
|
+
"AIMessageRole": {
|
|
30148
|
+
"type": "string",
|
|
30149
|
+
"enum": [
|
|
30150
|
+
"user",
|
|
30151
|
+
"developer"
|
|
30152
|
+
]
|
|
30153
|
+
},
|
|
30154
|
+
"AIMessageAttachmentKnowledge": {
|
|
30155
|
+
"type": "object",
|
|
30156
|
+
"description": "Attachment to extract knowledge matching a given query.",
|
|
30157
|
+
"properties": {
|
|
30158
|
+
"type": {
|
|
30159
|
+
"type": "string",
|
|
30160
|
+
"enum": [
|
|
30161
|
+
"knowledge"
|
|
30162
|
+
]
|
|
30163
|
+
},
|
|
30164
|
+
"query": {
|
|
30165
|
+
"type": "string",
|
|
30166
|
+
"description": "The query to use to extract the knowledge."
|
|
30167
|
+
}
|
|
30168
|
+
},
|
|
30169
|
+
"required": [
|
|
30170
|
+
"type",
|
|
30171
|
+
"query"
|
|
30172
|
+
]
|
|
30173
|
+
},
|
|
30174
|
+
"AIMessageAttachmentVisitorProfile": {
|
|
30175
|
+
"type": "object",
|
|
30176
|
+
"description": "Attachment representing the profile of the visitor",
|
|
30177
|
+
"properties": {
|
|
30178
|
+
"type": {
|
|
30179
|
+
"type": "string",
|
|
30180
|
+
"enum": [
|
|
30181
|
+
"visitor_profile"
|
|
30182
|
+
]
|
|
30183
|
+
}
|
|
30184
|
+
},
|
|
30185
|
+
"required": [
|
|
30186
|
+
"type"
|
|
30187
|
+
]
|
|
30188
|
+
},
|
|
30189
|
+
"AIMessageAttachmentPage": {
|
|
30190
|
+
"type": "object",
|
|
30191
|
+
"description": "Attachment to extract and pass the content of a page to the AI",
|
|
30192
|
+
"properties": {
|
|
30193
|
+
"type": {
|
|
30194
|
+
"type": "string",
|
|
30195
|
+
"enum": [
|
|
30196
|
+
"page"
|
|
30197
|
+
]
|
|
30198
|
+
},
|
|
30199
|
+
"spaceId": {
|
|
30200
|
+
"type": "string",
|
|
30201
|
+
"description": "The ID of the space to extract the content from"
|
|
30202
|
+
},
|
|
30203
|
+
"revisionId": {
|
|
30204
|
+
"type": "string",
|
|
30205
|
+
"description": "The ID of the revision to extract the content from"
|
|
30206
|
+
},
|
|
30207
|
+
"pageId": {
|
|
30208
|
+
"type": "string",
|
|
30209
|
+
"description": "The ID of the page to extract the content from"
|
|
30210
|
+
}
|
|
30211
|
+
},
|
|
30212
|
+
"required": [
|
|
30213
|
+
"type",
|
|
30214
|
+
"spaceId",
|
|
30215
|
+
"revisionId",
|
|
30216
|
+
"pageId"
|
|
30217
|
+
]
|
|
30218
|
+
},
|
|
30219
|
+
"AIMessageAttachmentPages": {
|
|
30220
|
+
"type": "object",
|
|
30221
|
+
"description": "Attachment to pass the tree of pages to the AI",
|
|
30222
|
+
"properties": {
|
|
30223
|
+
"type": {
|
|
30224
|
+
"type": "string",
|
|
30225
|
+
"enum": [
|
|
30226
|
+
"pages"
|
|
30227
|
+
]
|
|
30228
|
+
},
|
|
30229
|
+
"spaceId": {
|
|
30230
|
+
"type": "string",
|
|
30231
|
+
"description": "The ID of the space to extract the content from"
|
|
30232
|
+
},
|
|
30233
|
+
"revisionId": {
|
|
30234
|
+
"type": "string",
|
|
30235
|
+
"description": "The ID of the revision to extract the content from"
|
|
30236
|
+
}
|
|
30237
|
+
},
|
|
30238
|
+
"required": [
|
|
30239
|
+
"type",
|
|
30240
|
+
"spaceId",
|
|
30241
|
+
"revisionId"
|
|
30242
|
+
]
|
|
30243
|
+
},
|
|
30244
|
+
"AIMessageAttachment": {
|
|
30245
|
+
"oneOf": [
|
|
30246
|
+
{
|
|
30247
|
+
"$ref": "#/components/schemas/AIMessageAttachmentKnowledge"
|
|
30248
|
+
},
|
|
30249
|
+
{
|
|
30250
|
+
"$ref": "#/components/schemas/AIMessageAttachmentVisitorProfile"
|
|
30251
|
+
},
|
|
30252
|
+
{
|
|
30253
|
+
"$ref": "#/components/schemas/AIMessageAttachmentPage"
|
|
30254
|
+
},
|
|
30255
|
+
{
|
|
30256
|
+
"$ref": "#/components/schemas/AIMessageAttachmentPages"
|
|
30257
|
+
}
|
|
30258
|
+
]
|
|
30259
|
+
},
|
|
30260
|
+
"AIMessageInput": {
|
|
30261
|
+
"type": "object",
|
|
30262
|
+
"properties": {
|
|
30263
|
+
"role": {
|
|
30264
|
+
"$ref": "#/components/schemas/AIMessageRole"
|
|
30265
|
+
},
|
|
30266
|
+
"content": {
|
|
30267
|
+
"type": "string",
|
|
30268
|
+
"maxLength": 2048
|
|
30269
|
+
},
|
|
30270
|
+
"attachments": {
|
|
30271
|
+
"type": "array",
|
|
30272
|
+
"items": {
|
|
30273
|
+
"$ref": "#/components/schemas/AIMessageAttachment"
|
|
30274
|
+
}
|
|
30275
|
+
}
|
|
30276
|
+
},
|
|
30277
|
+
"required": [
|
|
30278
|
+
"role",
|
|
30279
|
+
"content"
|
|
30280
|
+
]
|
|
30281
|
+
},
|
|
30282
|
+
"AIOutputFormatObject": {
|
|
30283
|
+
"type": "object",
|
|
30284
|
+
"description": "Indicate that the AI should response with a JSON object corresponding to the provided schema.\n",
|
|
30285
|
+
"properties": {
|
|
30286
|
+
"type": {
|
|
30287
|
+
"type": "string",
|
|
30288
|
+
"enum": [
|
|
30289
|
+
"object"
|
|
30290
|
+
]
|
|
30291
|
+
},
|
|
30292
|
+
"schema": {
|
|
30293
|
+
"type": "object",
|
|
30294
|
+
"description": "The JSON schema to use for the object.",
|
|
30295
|
+
"properties": {
|
|
30296
|
+
"type": {
|
|
30297
|
+
"type": "string",
|
|
30298
|
+
"enum": [
|
|
30299
|
+
"object"
|
|
30300
|
+
]
|
|
30301
|
+
},
|
|
30302
|
+
"properties": {},
|
|
30303
|
+
"required": {
|
|
30304
|
+
"type": "array",
|
|
30305
|
+
"items": {
|
|
30306
|
+
"type": "string"
|
|
30307
|
+
}
|
|
30308
|
+
}
|
|
30309
|
+
}
|
|
30310
|
+
}
|
|
30311
|
+
},
|
|
30312
|
+
"required": [
|
|
30313
|
+
"type",
|
|
30314
|
+
"schema"
|
|
30315
|
+
]
|
|
30316
|
+
},
|
|
30317
|
+
"AIOutputFormatDocument": {
|
|
30318
|
+
"type": "object",
|
|
30319
|
+
"description": "Indicate that the AI should respond with a rich text document.\n",
|
|
30320
|
+
"properties": {
|
|
30321
|
+
"type": {
|
|
30322
|
+
"type": "string",
|
|
30323
|
+
"enum": [
|
|
30324
|
+
"document"
|
|
30325
|
+
]
|
|
30326
|
+
}
|
|
30327
|
+
},
|
|
30328
|
+
"required": [
|
|
30329
|
+
"type"
|
|
30330
|
+
]
|
|
30331
|
+
},
|
|
30332
|
+
"AIOutputFormat": {
|
|
30333
|
+
"oneOf": [
|
|
30334
|
+
{
|
|
30335
|
+
"$ref": "#/components/schemas/AIOutputFormatObject"
|
|
30336
|
+
},
|
|
30337
|
+
{
|
|
30338
|
+
"$ref": "#/components/schemas/AIOutputFormatDocument"
|
|
30339
|
+
}
|
|
30340
|
+
]
|
|
30341
|
+
},
|
|
30342
|
+
"AIModel": {
|
|
30343
|
+
"type": "string",
|
|
30344
|
+
"enum": [
|
|
30345
|
+
"fast",
|
|
30346
|
+
"reasoning-low",
|
|
30347
|
+
"reasoning-medium",
|
|
30348
|
+
"reasoning-high"
|
|
30349
|
+
]
|
|
30350
|
+
},
|
|
30351
|
+
"AIStreamResponseFinish": {
|
|
30352
|
+
"type": "object",
|
|
30353
|
+
"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",
|
|
30354
|
+
"properties": {
|
|
30355
|
+
"type": {
|
|
30356
|
+
"type": "string",
|
|
30357
|
+
"enum": [
|
|
30358
|
+
"response_finish"
|
|
30359
|
+
]
|
|
30360
|
+
},
|
|
30361
|
+
"responseId": {
|
|
30362
|
+
"type": "string",
|
|
30363
|
+
"description": "The ID of the response"
|
|
30364
|
+
}
|
|
30365
|
+
},
|
|
30366
|
+
"required": [
|
|
30367
|
+
"type",
|
|
30368
|
+
"responseId"
|
|
30369
|
+
]
|
|
30370
|
+
},
|
|
30371
|
+
"AIStreamResponseDocument": {
|
|
30372
|
+
"type": "object",
|
|
30373
|
+
"description": "Message emitted by the server to indicate the latest block of the document. The block can either be a new block or an update to the previous block.\n",
|
|
30374
|
+
"properties": {
|
|
30375
|
+
"type": {
|
|
30376
|
+
"type": "string",
|
|
30377
|
+
"enum": [
|
|
30378
|
+
"response_document"
|
|
30379
|
+
]
|
|
30380
|
+
},
|
|
30381
|
+
"operation": {
|
|
30382
|
+
"type": "string",
|
|
30383
|
+
"enum": [
|
|
30384
|
+
"insert",
|
|
30385
|
+
"update"
|
|
30386
|
+
]
|
|
30387
|
+
},
|
|
30388
|
+
"blocks": {
|
|
30389
|
+
"type": "array",
|
|
30390
|
+
"items": {
|
|
30391
|
+
"$ref": "#/components/schemas/DocumentBlock"
|
|
30392
|
+
}
|
|
30393
|
+
}
|
|
30394
|
+
},
|
|
30395
|
+
"required": [
|
|
30396
|
+
"type",
|
|
30397
|
+
"operation",
|
|
30398
|
+
"blocks"
|
|
30399
|
+
]
|
|
30400
|
+
},
|
|
30401
|
+
"AIStreamResponseObject": {
|
|
30402
|
+
"type": "object",
|
|
30403
|
+
"description": "Message emitted by the server to indicate a chunk of the JSON object response.\n",
|
|
30404
|
+
"properties": {
|
|
30405
|
+
"type": {
|
|
30406
|
+
"type": "string",
|
|
30407
|
+
"enum": [
|
|
30408
|
+
"response_object"
|
|
30409
|
+
]
|
|
30410
|
+
},
|
|
30411
|
+
"jsonChunk": {
|
|
30412
|
+
"type": "string",
|
|
30413
|
+
"description": "The chunk of the JSON object response"
|
|
30414
|
+
}
|
|
30415
|
+
},
|
|
30416
|
+
"required": [
|
|
30417
|
+
"type",
|
|
30418
|
+
"jsonChunk"
|
|
30419
|
+
]
|
|
30420
|
+
},
|
|
30421
|
+
"AIStreamResponse": {
|
|
30422
|
+
"oneOf": [
|
|
30423
|
+
{
|
|
30424
|
+
"$ref": "#/components/schemas/AIStreamResponseFinish"
|
|
30425
|
+
},
|
|
30426
|
+
{
|
|
30427
|
+
"$ref": "#/components/schemas/AIStreamResponseDocument"
|
|
30428
|
+
},
|
|
30429
|
+
{
|
|
30430
|
+
"$ref": "#/components/schemas/AIStreamResponseObject"
|
|
30431
|
+
}
|
|
30432
|
+
]
|
|
30433
|
+
},
|
|
30076
30434
|
"SiteInsightsEventSession": {
|
|
30077
30435
|
"type": "object",
|
|
30078
30436
|
"description": "Analytics info on the GitBook's site session.",
|
package/spec/openapi.yaml
CHANGED
|
@@ -7769,6 +7769,50 @@ paths:
|
|
|
7769
7769
|
$ref: "#/components/schemas/UserSitePermission"
|
|
7770
7770
|
default:
|
|
7771
7771
|
$ref: "#/components/responses/UnexpectedError"
|
|
7772
|
+
"/orgs/{organizationId}/sites/{siteId}/ai/response":
|
|
7773
|
+
post:
|
|
7774
|
+
operationId: streamAIResponseInSite
|
|
7775
|
+
summary: Generate an AI response in a site
|
|
7776
|
+
description: |
|
|
7777
|
+
Experimental operation to generate an AI response in a site.
|
|
7778
|
+
tags:
|
|
7779
|
+
- sites
|
|
7780
|
+
x-internal: true
|
|
7781
|
+
security:
|
|
7782
|
+
- user: []
|
|
7783
|
+
parameters:
|
|
7784
|
+
- $ref: "#/components/parameters/organizationId"
|
|
7785
|
+
- $ref: "#/components/parameters/siteId"
|
|
7786
|
+
requestBody:
|
|
7787
|
+
required: true
|
|
7788
|
+
content:
|
|
7789
|
+
application/json:
|
|
7790
|
+
schema:
|
|
7791
|
+
type: object
|
|
7792
|
+
required:
|
|
7793
|
+
- input
|
|
7794
|
+
- output
|
|
7795
|
+
properties:
|
|
7796
|
+
previousResponseId:
|
|
7797
|
+
type: string
|
|
7798
|
+
description: The ID of the previous response to continue from
|
|
7799
|
+
input:
|
|
7800
|
+
type: array
|
|
7801
|
+
items:
|
|
7802
|
+
$ref: "#/components/schemas/AIMessageInput"
|
|
7803
|
+
output:
|
|
7804
|
+
$ref: "#/components/schemas/AIOutputFormat"
|
|
7805
|
+
model:
|
|
7806
|
+
$ref: "#/components/schemas/AIModel"
|
|
7807
|
+
responses:
|
|
7808
|
+
"200":
|
|
7809
|
+
description: OK
|
|
7810
|
+
content:
|
|
7811
|
+
text/event-stream:
|
|
7812
|
+
schema:
|
|
7813
|
+
$ref: "#/components/schemas/AIStreamResponse"
|
|
7814
|
+
default:
|
|
7815
|
+
$ref: "#/components/responses/UnexpectedError"
|
|
7772
7816
|
"/orgs/{organizationId}/sites/{siteId}/insights/events":
|
|
7773
7817
|
post:
|
|
7774
7818
|
operationId: trackEventsInSiteById
|
|
@@ -18384,6 +18428,200 @@ components:
|
|
|
18384
18428
|
- permission
|
|
18385
18429
|
- user
|
|
18386
18430
|
- origin
|
|
18431
|
+
AIMessageRole:
|
|
18432
|
+
type: string
|
|
18433
|
+
enum:
|
|
18434
|
+
- user
|
|
18435
|
+
- developer
|
|
18436
|
+
AIMessageAttachmentKnowledge:
|
|
18437
|
+
type: object
|
|
18438
|
+
description: Attachment to extract knowledge matching a given query.
|
|
18439
|
+
properties:
|
|
18440
|
+
type:
|
|
18441
|
+
type: string
|
|
18442
|
+
enum:
|
|
18443
|
+
- knowledge
|
|
18444
|
+
query:
|
|
18445
|
+
type: string
|
|
18446
|
+
description: The query to use to extract the knowledge.
|
|
18447
|
+
required:
|
|
18448
|
+
- type
|
|
18449
|
+
- query
|
|
18450
|
+
AIMessageAttachmentVisitorProfile:
|
|
18451
|
+
type: object
|
|
18452
|
+
description: Attachment representing the profile of the visitor
|
|
18453
|
+
properties:
|
|
18454
|
+
type:
|
|
18455
|
+
type: string
|
|
18456
|
+
enum:
|
|
18457
|
+
- visitor_profile
|
|
18458
|
+
required:
|
|
18459
|
+
- type
|
|
18460
|
+
AIMessageAttachmentPage:
|
|
18461
|
+
type: object
|
|
18462
|
+
description: Attachment to extract and pass the content of a page to the AI
|
|
18463
|
+
properties:
|
|
18464
|
+
type:
|
|
18465
|
+
type: string
|
|
18466
|
+
enum:
|
|
18467
|
+
- page
|
|
18468
|
+
spaceId:
|
|
18469
|
+
type: string
|
|
18470
|
+
description: The ID of the space to extract the content from
|
|
18471
|
+
revisionId:
|
|
18472
|
+
type: string
|
|
18473
|
+
description: The ID of the revision to extract the content from
|
|
18474
|
+
pageId:
|
|
18475
|
+
type: string
|
|
18476
|
+
description: The ID of the page to extract the content from
|
|
18477
|
+
required:
|
|
18478
|
+
- type
|
|
18479
|
+
- spaceId
|
|
18480
|
+
- revisionId
|
|
18481
|
+
- pageId
|
|
18482
|
+
AIMessageAttachmentPages:
|
|
18483
|
+
type: object
|
|
18484
|
+
description: Attachment to pass the tree of pages to the AI
|
|
18485
|
+
properties:
|
|
18486
|
+
type:
|
|
18487
|
+
type: string
|
|
18488
|
+
enum:
|
|
18489
|
+
- pages
|
|
18490
|
+
spaceId:
|
|
18491
|
+
type: string
|
|
18492
|
+
description: The ID of the space to extract the content from
|
|
18493
|
+
revisionId:
|
|
18494
|
+
type: string
|
|
18495
|
+
description: The ID of the revision to extract the content from
|
|
18496
|
+
required:
|
|
18497
|
+
- type
|
|
18498
|
+
- spaceId
|
|
18499
|
+
- revisionId
|
|
18500
|
+
AIMessageAttachment:
|
|
18501
|
+
oneOf:
|
|
18502
|
+
- $ref: "#/components/schemas/AIMessageAttachmentKnowledge"
|
|
18503
|
+
- $ref: "#/components/schemas/AIMessageAttachmentVisitorProfile"
|
|
18504
|
+
- $ref: "#/components/schemas/AIMessageAttachmentPage"
|
|
18505
|
+
- $ref: "#/components/schemas/AIMessageAttachmentPages"
|
|
18506
|
+
AIMessageInput:
|
|
18507
|
+
type: object
|
|
18508
|
+
properties:
|
|
18509
|
+
role:
|
|
18510
|
+
$ref: "#/components/schemas/AIMessageRole"
|
|
18511
|
+
content:
|
|
18512
|
+
type: string
|
|
18513
|
+
maxLength: 2048
|
|
18514
|
+
attachments:
|
|
18515
|
+
type: array
|
|
18516
|
+
items:
|
|
18517
|
+
$ref: "#/components/schemas/AIMessageAttachment"
|
|
18518
|
+
required:
|
|
18519
|
+
- role
|
|
18520
|
+
- content
|
|
18521
|
+
AIOutputFormatObject:
|
|
18522
|
+
type: object
|
|
18523
|
+
description: |
|
|
18524
|
+
Indicate that the AI should response with a JSON object corresponding to the provided schema.
|
|
18525
|
+
properties:
|
|
18526
|
+
type:
|
|
18527
|
+
type: string
|
|
18528
|
+
enum:
|
|
18529
|
+
- object
|
|
18530
|
+
schema:
|
|
18531
|
+
type: object
|
|
18532
|
+
description: The JSON schema to use for the object.
|
|
18533
|
+
properties:
|
|
18534
|
+
type:
|
|
18535
|
+
type: string
|
|
18536
|
+
enum:
|
|
18537
|
+
- object
|
|
18538
|
+
properties: {}
|
|
18539
|
+
required:
|
|
18540
|
+
type: array
|
|
18541
|
+
items:
|
|
18542
|
+
type: string
|
|
18543
|
+
required:
|
|
18544
|
+
- type
|
|
18545
|
+
- schema
|
|
18546
|
+
AIOutputFormatDocument:
|
|
18547
|
+
type: object
|
|
18548
|
+
description: |
|
|
18549
|
+
Indicate that the AI should respond with a rich text document.
|
|
18550
|
+
properties:
|
|
18551
|
+
type:
|
|
18552
|
+
type: string
|
|
18553
|
+
enum:
|
|
18554
|
+
- document
|
|
18555
|
+
required:
|
|
18556
|
+
- type
|
|
18557
|
+
AIOutputFormat:
|
|
18558
|
+
oneOf:
|
|
18559
|
+
- $ref: "#/components/schemas/AIOutputFormatObject"
|
|
18560
|
+
- $ref: "#/components/schemas/AIOutputFormatDocument"
|
|
18561
|
+
AIModel:
|
|
18562
|
+
type: string
|
|
18563
|
+
enum:
|
|
18564
|
+
- fast
|
|
18565
|
+
- reasoning-low
|
|
18566
|
+
- reasoning-medium
|
|
18567
|
+
- reasoning-high
|
|
18568
|
+
AIStreamResponseFinish:
|
|
18569
|
+
type: object
|
|
18570
|
+
description: |
|
|
18571
|
+
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.
|
|
18572
|
+
properties:
|
|
18573
|
+
type:
|
|
18574
|
+
type: string
|
|
18575
|
+
enum:
|
|
18576
|
+
- response_finish
|
|
18577
|
+
responseId:
|
|
18578
|
+
type: string
|
|
18579
|
+
description: The ID of the response
|
|
18580
|
+
required:
|
|
18581
|
+
- type
|
|
18582
|
+
- responseId
|
|
18583
|
+
AIStreamResponseDocument:
|
|
18584
|
+
type: object
|
|
18585
|
+
description: |
|
|
18586
|
+
Message emitted by the server to indicate the latest block of the document. The block can either be a new block or an update to the previous block.
|
|
18587
|
+
properties:
|
|
18588
|
+
type:
|
|
18589
|
+
type: string
|
|
18590
|
+
enum:
|
|
18591
|
+
- response_document
|
|
18592
|
+
operation:
|
|
18593
|
+
type: string
|
|
18594
|
+
enum:
|
|
18595
|
+
- insert
|
|
18596
|
+
- update
|
|
18597
|
+
blocks:
|
|
18598
|
+
type: array
|
|
18599
|
+
items:
|
|
18600
|
+
$ref: "#/components/schemas/DocumentBlock"
|
|
18601
|
+
required:
|
|
18602
|
+
- type
|
|
18603
|
+
- operation
|
|
18604
|
+
- blocks
|
|
18605
|
+
AIStreamResponseObject:
|
|
18606
|
+
type: object
|
|
18607
|
+
description: |
|
|
18608
|
+
Message emitted by the server to indicate a chunk of the JSON object response.
|
|
18609
|
+
properties:
|
|
18610
|
+
type:
|
|
18611
|
+
type: string
|
|
18612
|
+
enum:
|
|
18613
|
+
- response_object
|
|
18614
|
+
jsonChunk:
|
|
18615
|
+
type: string
|
|
18616
|
+
description: The chunk of the JSON object response
|
|
18617
|
+
required:
|
|
18618
|
+
- type
|
|
18619
|
+
- jsonChunk
|
|
18620
|
+
AIStreamResponse:
|
|
18621
|
+
oneOf:
|
|
18622
|
+
- $ref: "#/components/schemas/AIStreamResponseFinish"
|
|
18623
|
+
- $ref: "#/components/schemas/AIStreamResponseDocument"
|
|
18624
|
+
- $ref: "#/components/schemas/AIStreamResponseObject"
|
|
18387
18625
|
SiteInsightsEventSession:
|
|
18388
18626
|
type: object
|
|
18389
18627
|
description: Analytics info on the GitBook's site session.
|