Skip to content

Commit 3e41aa7

Browse files
authored
Merge pull request #547 from objectstack-ai/copilot/improve-api-specifications
2 parents c81474c + 7bf879d commit 3e41aa7

80 files changed

Lines changed: 15166 additions & 286 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"$ref": "#/definitions/AiChatRequest",
3+
"definitions": {
4+
"AiChatRequest": {
5+
"type": "object",
6+
"properties": {
7+
"message": {
8+
"type": "string",
9+
"description": "User message"
10+
},
11+
"conversationId": {
12+
"type": "string",
13+
"description": "Conversation ID for context"
14+
},
15+
"context": {
16+
"type": "object",
17+
"additionalProperties": {},
18+
"description": "Additional context data"
19+
}
20+
},
21+
"required": [
22+
"message"
23+
],
24+
"additionalProperties": false
25+
}
26+
},
27+
"$schema": "http://json-schema.org/draft-07/schema#"
28+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"$ref": "#/definitions/AiChatResponse",
3+
"definitions": {
4+
"AiChatResponse": {
5+
"type": "object",
6+
"properties": {
7+
"message": {
8+
"type": "string",
9+
"description": "Assistant response message"
10+
},
11+
"conversationId": {
12+
"type": "string",
13+
"description": "Conversation ID"
14+
},
15+
"actions": {
16+
"type": "array",
17+
"items": {
18+
"type": "object",
19+
"properties": {
20+
"type": {
21+
"type": "string",
22+
"description": "Action type"
23+
},
24+
"label": {
25+
"type": "string",
26+
"description": "Action display label"
27+
},
28+
"data": {
29+
"type": "object",
30+
"additionalProperties": {},
31+
"description": "Action data"
32+
}
33+
},
34+
"required": [
35+
"type",
36+
"label"
37+
],
38+
"additionalProperties": false
39+
},
40+
"description": "Suggested actions"
41+
}
42+
},
43+
"required": [
44+
"message",
45+
"conversationId"
46+
],
47+
"additionalProperties": false
48+
}
49+
},
50+
"$schema": "http://json-schema.org/draft-07/schema#"
51+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"$ref": "#/definitions/AiInsightsRequest",
3+
"definitions": {
4+
"AiInsightsRequest": {
5+
"type": "object",
6+
"properties": {
7+
"object": {
8+
"type": "string",
9+
"description": "Object name to analyze"
10+
},
11+
"recordId": {
12+
"type": "string",
13+
"description": "Specific record to analyze"
14+
},
15+
"type": {
16+
"type": "string",
17+
"enum": [
18+
"summary",
19+
"trends",
20+
"anomalies",
21+
"recommendations"
22+
],
23+
"description": "Type of insight"
24+
}
25+
},
26+
"required": [
27+
"object"
28+
],
29+
"additionalProperties": false
30+
}
31+
},
32+
"$schema": "http://json-schema.org/draft-07/schema#"
33+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"$ref": "#/definitions/AiInsightsResponse",
3+
"definitions": {
4+
"AiInsightsResponse": {
5+
"type": "object",
6+
"properties": {
7+
"insights": {
8+
"type": "array",
9+
"items": {
10+
"type": "object",
11+
"properties": {
12+
"type": {
13+
"type": "string",
14+
"description": "Insight type"
15+
},
16+
"title": {
17+
"type": "string",
18+
"description": "Insight title"
19+
},
20+
"description": {
21+
"type": "string",
22+
"description": "Detailed description"
23+
},
24+
"confidence": {
25+
"type": "number",
26+
"minimum": 0,
27+
"maximum": 1,
28+
"description": "Confidence score (0-1)"
29+
},
30+
"data": {
31+
"type": "object",
32+
"additionalProperties": {},
33+
"description": "Supporting data"
34+
}
35+
},
36+
"required": [
37+
"type",
38+
"title",
39+
"description"
40+
],
41+
"additionalProperties": false
42+
},
43+
"description": "Generated insights"
44+
}
45+
},
46+
"required": [
47+
"insights"
48+
],
49+
"additionalProperties": false
50+
}
51+
},
52+
"$schema": "http://json-schema.org/draft-07/schema#"
53+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"$ref": "#/definitions/AiNlqRequest",
3+
"definitions": {
4+
"AiNlqRequest": {
5+
"type": "object",
6+
"properties": {
7+
"query": {
8+
"type": "string",
9+
"description": "Natural language query string"
10+
},
11+
"object": {
12+
"type": "string",
13+
"description": "Target object context"
14+
},
15+
"conversationId": {
16+
"type": "string",
17+
"description": "Conversation ID for multi-turn queries"
18+
}
19+
},
20+
"required": [
21+
"query"
22+
],
23+
"additionalProperties": false
24+
}
25+
},
26+
"$schema": "http://json-schema.org/draft-07/schema#"
27+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"$ref": "#/definitions/AiNlqResponse",
3+
"definitions": {
4+
"AiNlqResponse": {
5+
"type": "object",
6+
"properties": {
7+
"query": {
8+
"description": "Generated structured query (AST)"
9+
},
10+
"explanation": {
11+
"type": "string",
12+
"description": "Human-readable explanation of the query"
13+
},
14+
"confidence": {
15+
"type": "number",
16+
"minimum": 0,
17+
"maximum": 1,
18+
"description": "Confidence score (0-1)"
19+
},
20+
"suggestions": {
21+
"type": "array",
22+
"items": {
23+
"type": "string"
24+
},
25+
"description": "Suggested follow-up queries"
26+
}
27+
},
28+
"additionalProperties": false
29+
}
30+
},
31+
"$schema": "http://json-schema.org/draft-07/schema#"
32+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"$ref": "#/definitions/AiSuggestRequest",
3+
"definitions": {
4+
"AiSuggestRequest": {
5+
"type": "object",
6+
"properties": {
7+
"object": {
8+
"type": "string",
9+
"description": "Object name for context"
10+
},
11+
"field": {
12+
"type": "string",
13+
"description": "Field to suggest values for"
14+
},
15+
"recordId": {
16+
"type": "string",
17+
"description": "Record ID for context"
18+
},
19+
"partial": {
20+
"type": "string",
21+
"description": "Partial input for completion"
22+
}
23+
},
24+
"required": [
25+
"object"
26+
],
27+
"additionalProperties": false
28+
}
29+
},
30+
"$schema": "http://json-schema.org/draft-07/schema#"
31+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"$ref": "#/definitions/AiSuggestResponse",
3+
"definitions": {
4+
"AiSuggestResponse": {
5+
"type": "object",
6+
"properties": {
7+
"suggestions": {
8+
"type": "array",
9+
"items": {
10+
"type": "object",
11+
"properties": {
12+
"value": {
13+
"description": "Suggested value"
14+
},
15+
"label": {
16+
"type": "string",
17+
"description": "Display label"
18+
},
19+
"confidence": {
20+
"type": "number",
21+
"minimum": 0,
22+
"maximum": 1,
23+
"description": "Confidence score (0-1)"
24+
},
25+
"reason": {
26+
"type": "string",
27+
"description": "Reason for this suggestion"
28+
}
29+
},
30+
"required": [
31+
"label"
32+
],
33+
"additionalProperties": false
34+
},
35+
"description": "Suggested values"
36+
}
37+
},
38+
"required": [
39+
"suggestions"
40+
],
41+
"additionalProperties": false
42+
}
43+
},
44+
"$schema": "http://json-schema.org/draft-07/schema#"
45+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"$ref": "#/definitions/CheckPermissionRequest",
3+
"definitions": {
4+
"CheckPermissionRequest": {
5+
"type": "object",
6+
"properties": {
7+
"object": {
8+
"type": "string",
9+
"description": "Object name to check permissions for"
10+
},
11+
"action": {
12+
"type": "string",
13+
"enum": [
14+
"create",
15+
"read",
16+
"edit",
17+
"delete",
18+
"transfer",
19+
"restore",
20+
"purge"
21+
],
22+
"description": "Action to check"
23+
},
24+
"recordId": {
25+
"type": "string",
26+
"description": "Specific record ID (for record-level checks)"
27+
},
28+
"field": {
29+
"type": "string",
30+
"description": "Specific field name (for field-level checks)"
31+
}
32+
},
33+
"required": [
34+
"object",
35+
"action"
36+
],
37+
"additionalProperties": false
38+
}
39+
},
40+
"$schema": "http://json-schema.org/draft-07/schema#"
41+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"$ref": "#/definitions/CheckPermissionResponse",
3+
"definitions": {
4+
"CheckPermissionResponse": {
5+
"type": "object",
6+
"properties": {
7+
"allowed": {
8+
"type": "boolean",
9+
"description": "Whether the action is permitted"
10+
},
11+
"reason": {
12+
"type": "string",
13+
"description": "Reason if denied"
14+
}
15+
},
16+
"required": [
17+
"allowed"
18+
],
19+
"additionalProperties": false
20+
}
21+
},
22+
"$schema": "http://json-schema.org/draft-07/schema#"
23+
}

0 commit comments

Comments
 (0)