@spaciv/sdk 0.1.0 → 0.1.1
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/.openapi-generator/FILES +3 -0
- package/README.md +2 -2
- package/dist/apis/AssistantApi.d.ts +28 -1
- package/dist/apis/AssistantApi.js +39 -0
- package/dist/esm/apis/AssistantApi.d.ts +28 -1
- package/dist/esm/apis/AssistantApi.js +40 -1
- package/dist/esm/models/AssistantTranscriptBody.d.ts +45 -0
- package/dist/esm/models/AssistantTranscriptBody.js +52 -0
- package/dist/esm/models/AssistantTranscriptMessage.d.ts +98 -0
- package/dist/esm/models/AssistantTranscriptMessage.js +90 -0
- package/dist/esm/models/AssistantTranscriptToolCall.d.ts +44 -0
- package/dist/esm/models/AssistantTranscriptToolCall.js +51 -0
- package/dist/esm/models/index.d.ts +3 -0
- package/dist/esm/models/index.js +3 -0
- package/dist/models/AssistantTranscriptBody.d.ts +45 -0
- package/dist/models/AssistantTranscriptBody.js +59 -0
- package/dist/models/AssistantTranscriptMessage.d.ts +98 -0
- package/dist/models/AssistantTranscriptMessage.js +98 -0
- package/dist/models/AssistantTranscriptToolCall.d.ts +44 -0
- package/dist/models/AssistantTranscriptToolCall.js +58 -0
- package/dist/models/index.d.ts +3 -0
- package/dist/models/index.js +3 -0
- package/package.json +1 -1
- package/src/apis/AssistantApi.ts +70 -0
- package/src/models/AssistantTranscriptBody.ts +92 -0
- package/src/models/AssistantTranscriptMessage.ts +175 -0
- package/src/models/AssistantTranscriptToolCall.ts +84 -0
- package/src/models/index.ts +3 -0
package/dist/esm/models/index.js
CHANGED
|
@@ -39,6 +39,9 @@ export * from './AssistantConversationFailureBody';
|
|
|
39
39
|
export * from './AssistantConversationListEntry';
|
|
40
40
|
export * from './AssistantConversationListRes';
|
|
41
41
|
export * from './AssistantModelListBody';
|
|
42
|
+
export * from './AssistantTranscriptBody';
|
|
43
|
+
export * from './AssistantTranscriptMessage';
|
|
44
|
+
export * from './AssistantTranscriptToolCall';
|
|
42
45
|
export * from './AuthAPIKeyTokenReqBody';
|
|
43
46
|
export * from './AuthAPIKeyTokenResBody';
|
|
44
47
|
export * from './AuthLoginPassReqBody';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* spaciv API
|
|
3
|
+
* The spaciv API powers workplace planning: modelling how many people an organisation has, how they work, and how much space that requires. ## Getting started 1. Exchange credentials for an access token using one of the operations under **Authentication**. 2. Send that token on every subsequent request as `Authorization: Bearer <token>`. 3. Access tokens are short lived. Call `POST /v1/auth/refresh-token` to obtain a new one before the old one expires. ## Conventions Every operation is versioned under `/v1`. Collections are plural (`GET /v1/dashboards` lists, `POST /v1/dashboards` creates) and individual records live beneath them (`/v1/dashboards/{id}`). Singular paths such as `/v1/account`, `/v1/project` and `/v1/user` refer to the record the access token was issued for. Request and response bodies are JSON. Timestamps are RFC 3339. Identifiers are opaque strings unless documented otherwise, and collection operations return the records visible to the account the token was issued for. Failures return an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem document with a `detail` field describing what went wrong.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
* Contact: support@spaciv.com
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import type { AssistantTranscriptMessage } from './AssistantTranscriptMessage';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface AssistantTranscriptBody
|
|
17
|
+
*/
|
|
18
|
+
export interface AssistantTranscriptBody {
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @type {Array<AssistantTranscriptMessage>}
|
|
22
|
+
* @memberof AssistantTranscriptBody
|
|
23
|
+
*/
|
|
24
|
+
messages: Array<AssistantTranscriptMessage>;
|
|
25
|
+
/**
|
|
26
|
+
* What the assistant is told of the messages it no longer replays, once the conversation has been compacted. Empty until then.
|
|
27
|
+
* @type {string}
|
|
28
|
+
* @memberof AssistantTranscriptBody
|
|
29
|
+
*/
|
|
30
|
+
summary: string;
|
|
31
|
+
/**
|
|
32
|
+
* How many of the leading messages the summary stands in for.
|
|
33
|
+
* @type {number}
|
|
34
|
+
* @memberof AssistantTranscriptBody
|
|
35
|
+
*/
|
|
36
|
+
summaryUpTo: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Check if a given object implements the AssistantTranscriptBody interface.
|
|
40
|
+
*/
|
|
41
|
+
export declare function instanceOfAssistantTranscriptBody(value: object): value is AssistantTranscriptBody;
|
|
42
|
+
export declare function AssistantTranscriptBodyFromJSON(json: any): AssistantTranscriptBody;
|
|
43
|
+
export declare function AssistantTranscriptBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): AssistantTranscriptBody;
|
|
44
|
+
export declare function AssistantTranscriptBodyToJSON(json: any): AssistantTranscriptBody;
|
|
45
|
+
export declare function AssistantTranscriptBodyToJSONTyped(value?: AssistantTranscriptBody | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* spaciv API
|
|
6
|
+
* The spaciv API powers workplace planning: modelling how many people an organisation has, how they work, and how much space that requires. ## Getting started 1. Exchange credentials for an access token using one of the operations under **Authentication**. 2. Send that token on every subsequent request as `Authorization: Bearer <token>`. 3. Access tokens are short lived. Call `POST /v1/auth/refresh-token` to obtain a new one before the old one expires. ## Conventions Every operation is versioned under `/v1`. Collections are plural (`GET /v1/dashboards` lists, `POST /v1/dashboards` creates) and individual records live beneath them (`/v1/dashboards/{id}`). Singular paths such as `/v1/account`, `/v1/project` and `/v1/user` refer to the record the access token was issued for. Request and response bodies are JSON. Timestamps are RFC 3339. Identifiers are opaque strings unless documented otherwise, and collection operations return the records visible to the account the token was issued for. Failures return an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem document with a `detail` field describing what went wrong.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
* Contact: support@spaciv.com
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.instanceOfAssistantTranscriptBody = instanceOfAssistantTranscriptBody;
|
|
17
|
+
exports.AssistantTranscriptBodyFromJSON = AssistantTranscriptBodyFromJSON;
|
|
18
|
+
exports.AssistantTranscriptBodyFromJSONTyped = AssistantTranscriptBodyFromJSONTyped;
|
|
19
|
+
exports.AssistantTranscriptBodyToJSON = AssistantTranscriptBodyToJSON;
|
|
20
|
+
exports.AssistantTranscriptBodyToJSONTyped = AssistantTranscriptBodyToJSONTyped;
|
|
21
|
+
const AssistantTranscriptMessage_1 = require("./AssistantTranscriptMessage");
|
|
22
|
+
/**
|
|
23
|
+
* Check if a given object implements the AssistantTranscriptBody interface.
|
|
24
|
+
*/
|
|
25
|
+
function instanceOfAssistantTranscriptBody(value) {
|
|
26
|
+
if (!('messages' in value) || value['messages'] === undefined)
|
|
27
|
+
return false;
|
|
28
|
+
if (!('summary' in value) || value['summary'] === undefined)
|
|
29
|
+
return false;
|
|
30
|
+
if (!('summaryUpTo' in value) || value['summaryUpTo'] === undefined)
|
|
31
|
+
return false;
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
function AssistantTranscriptBodyFromJSON(json) {
|
|
35
|
+
return AssistantTranscriptBodyFromJSONTyped(json, false);
|
|
36
|
+
}
|
|
37
|
+
function AssistantTranscriptBodyFromJSONTyped(json, ignoreDiscriminator) {
|
|
38
|
+
if (json == null) {
|
|
39
|
+
return json;
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
'messages': (json['messages'].map(AssistantTranscriptMessage_1.AssistantTranscriptMessageFromJSON)),
|
|
43
|
+
'summary': json['summary'],
|
|
44
|
+
'summaryUpTo': json['summaryUpTo'],
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function AssistantTranscriptBodyToJSON(json) {
|
|
48
|
+
return AssistantTranscriptBodyToJSONTyped(json, false);
|
|
49
|
+
}
|
|
50
|
+
function AssistantTranscriptBodyToJSONTyped(value, ignoreDiscriminator = false) {
|
|
51
|
+
if (value == null) {
|
|
52
|
+
return value;
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
'messages': (value['messages'].map(AssistantTranscriptMessage_1.AssistantTranscriptMessageToJSON)),
|
|
56
|
+
'summary': value['summary'],
|
|
57
|
+
'summaryUpTo': value['summaryUpTo'],
|
|
58
|
+
};
|
|
59
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* spaciv API
|
|
3
|
+
* The spaciv API powers workplace planning: modelling how many people an organisation has, how they work, and how much space that requires. ## Getting started 1. Exchange credentials for an access token using one of the operations under **Authentication**. 2. Send that token on every subsequent request as `Authorization: Bearer <token>`. 3. Access tokens are short lived. Call `POST /v1/auth/refresh-token` to obtain a new one before the old one expires. ## Conventions Every operation is versioned under `/v1`. Collections are plural (`GET /v1/dashboards` lists, `POST /v1/dashboards` creates) and individual records live beneath them (`/v1/dashboards/{id}`). Singular paths such as `/v1/account`, `/v1/project` and `/v1/user` refer to the record the access token was issued for. Request and response bodies are JSON. Timestamps are RFC 3339. Identifiers are opaque strings unless documented otherwise, and collection operations return the records visible to the account the token was issued for. Failures return an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem document with a `detail` field describing what went wrong.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
* Contact: support@spaciv.com
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import type { AssistantTranscriptToolCall } from './AssistantTranscriptToolCall';
|
|
13
|
+
import type { AssistantChatPollAttachment } from './AssistantChatPollAttachment';
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @export
|
|
17
|
+
* @interface AssistantTranscriptMessage
|
|
18
|
+
*/
|
|
19
|
+
export interface AssistantTranscriptMessage {
|
|
20
|
+
/**
|
|
21
|
+
* Files attached to a user message. Empty on every other message.
|
|
22
|
+
* @type {Array<AssistantChatPollAttachment>}
|
|
23
|
+
* @memberof AssistantTranscriptMessage
|
|
24
|
+
*/
|
|
25
|
+
attachments: Array<AssistantChatPollAttachment>;
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @type {string}
|
|
29
|
+
* @memberof AssistantTranscriptMessage
|
|
30
|
+
*/
|
|
31
|
+
createdAt: string;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the tool call a tool message answers failed: the tool refused it, returned an error, or was not available.
|
|
34
|
+
* @type {boolean}
|
|
35
|
+
* @memberof AssistantTranscriptMessage
|
|
36
|
+
*/
|
|
37
|
+
failed: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The message's index in the conversation. A poll's message ids start with it.
|
|
40
|
+
* @type {string}
|
|
41
|
+
* @memberof AssistantTranscriptMessage
|
|
42
|
+
*/
|
|
43
|
+
id: string;
|
|
44
|
+
/**
|
|
45
|
+
* Why a notice was given, as the id a poll shows it with.
|
|
46
|
+
* @type {string}
|
|
47
|
+
* @memberof AssistantTranscriptMessage
|
|
48
|
+
*/
|
|
49
|
+
reason: string;
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
* @type {string}
|
|
53
|
+
* @memberof AssistantTranscriptMessage
|
|
54
|
+
*/
|
|
55
|
+
requestId: string;
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
* @type {string}
|
|
59
|
+
* @memberof AssistantTranscriptMessage
|
|
60
|
+
*/
|
|
61
|
+
role: AssistantTranscriptMessageRoleEnum;
|
|
62
|
+
/**
|
|
63
|
+
* For a tool message, the result the assistant was given.
|
|
64
|
+
* @type {string}
|
|
65
|
+
* @memberof AssistantTranscriptMessage
|
|
66
|
+
*/
|
|
67
|
+
text: string;
|
|
68
|
+
/**
|
|
69
|
+
* The id of the tool call a tool message is the result of.
|
|
70
|
+
* @type {string}
|
|
71
|
+
* @memberof AssistantTranscriptMessage
|
|
72
|
+
*/
|
|
73
|
+
toolCallId: string;
|
|
74
|
+
/**
|
|
75
|
+
* The tools an assistant message called. Empty on every other message.
|
|
76
|
+
* @type {Array<AssistantTranscriptToolCall>}
|
|
77
|
+
* @memberof AssistantTranscriptMessage
|
|
78
|
+
*/
|
|
79
|
+
toolCalls: Array<AssistantTranscriptToolCall>;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* @export
|
|
83
|
+
*/
|
|
84
|
+
export declare const AssistantTranscriptMessageRoleEnum: {
|
|
85
|
+
readonly User: "user";
|
|
86
|
+
readonly Assistant: "assistant";
|
|
87
|
+
readonly Tool: "tool";
|
|
88
|
+
readonly Notice: "notice";
|
|
89
|
+
};
|
|
90
|
+
export type AssistantTranscriptMessageRoleEnum = typeof AssistantTranscriptMessageRoleEnum[keyof typeof AssistantTranscriptMessageRoleEnum];
|
|
91
|
+
/**
|
|
92
|
+
* Check if a given object implements the AssistantTranscriptMessage interface.
|
|
93
|
+
*/
|
|
94
|
+
export declare function instanceOfAssistantTranscriptMessage(value: object): value is AssistantTranscriptMessage;
|
|
95
|
+
export declare function AssistantTranscriptMessageFromJSON(json: any): AssistantTranscriptMessage;
|
|
96
|
+
export declare function AssistantTranscriptMessageFromJSONTyped(json: any, ignoreDiscriminator: boolean): AssistantTranscriptMessage;
|
|
97
|
+
export declare function AssistantTranscriptMessageToJSON(json: any): AssistantTranscriptMessage;
|
|
98
|
+
export declare function AssistantTranscriptMessageToJSONTyped(value?: AssistantTranscriptMessage | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* spaciv API
|
|
6
|
+
* The spaciv API powers workplace planning: modelling how many people an organisation has, how they work, and how much space that requires. ## Getting started 1. Exchange credentials for an access token using one of the operations under **Authentication**. 2. Send that token on every subsequent request as `Authorization: Bearer <token>`. 3. Access tokens are short lived. Call `POST /v1/auth/refresh-token` to obtain a new one before the old one expires. ## Conventions Every operation is versioned under `/v1`. Collections are plural (`GET /v1/dashboards` lists, `POST /v1/dashboards` creates) and individual records live beneath them (`/v1/dashboards/{id}`). Singular paths such as `/v1/account`, `/v1/project` and `/v1/user` refer to the record the access token was issued for. Request and response bodies are JSON. Timestamps are RFC 3339. Identifiers are opaque strings unless documented otherwise, and collection operations return the records visible to the account the token was issued for. Failures return an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem document with a `detail` field describing what went wrong.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
* Contact: support@spaciv.com
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.AssistantTranscriptMessageRoleEnum = void 0;
|
|
17
|
+
exports.instanceOfAssistantTranscriptMessage = instanceOfAssistantTranscriptMessage;
|
|
18
|
+
exports.AssistantTranscriptMessageFromJSON = AssistantTranscriptMessageFromJSON;
|
|
19
|
+
exports.AssistantTranscriptMessageFromJSONTyped = AssistantTranscriptMessageFromJSONTyped;
|
|
20
|
+
exports.AssistantTranscriptMessageToJSON = AssistantTranscriptMessageToJSON;
|
|
21
|
+
exports.AssistantTranscriptMessageToJSONTyped = AssistantTranscriptMessageToJSONTyped;
|
|
22
|
+
const AssistantTranscriptToolCall_1 = require("./AssistantTranscriptToolCall");
|
|
23
|
+
const AssistantChatPollAttachment_1 = require("./AssistantChatPollAttachment");
|
|
24
|
+
/**
|
|
25
|
+
* @export
|
|
26
|
+
*/
|
|
27
|
+
exports.AssistantTranscriptMessageRoleEnum = {
|
|
28
|
+
User: 'user',
|
|
29
|
+
Assistant: 'assistant',
|
|
30
|
+
Tool: 'tool',
|
|
31
|
+
Notice: 'notice'
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Check if a given object implements the AssistantTranscriptMessage interface.
|
|
35
|
+
*/
|
|
36
|
+
function instanceOfAssistantTranscriptMessage(value) {
|
|
37
|
+
if (!('attachments' in value) || value['attachments'] === undefined)
|
|
38
|
+
return false;
|
|
39
|
+
if (!('createdAt' in value) || value['createdAt'] === undefined)
|
|
40
|
+
return false;
|
|
41
|
+
if (!('failed' in value) || value['failed'] === undefined)
|
|
42
|
+
return false;
|
|
43
|
+
if (!('id' in value) || value['id'] === undefined)
|
|
44
|
+
return false;
|
|
45
|
+
if (!('reason' in value) || value['reason'] === undefined)
|
|
46
|
+
return false;
|
|
47
|
+
if (!('requestId' in value) || value['requestId'] === undefined)
|
|
48
|
+
return false;
|
|
49
|
+
if (!('role' in value) || value['role'] === undefined)
|
|
50
|
+
return false;
|
|
51
|
+
if (!('text' in value) || value['text'] === undefined)
|
|
52
|
+
return false;
|
|
53
|
+
if (!('toolCallId' in value) || value['toolCallId'] === undefined)
|
|
54
|
+
return false;
|
|
55
|
+
if (!('toolCalls' in value) || value['toolCalls'] === undefined)
|
|
56
|
+
return false;
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
function AssistantTranscriptMessageFromJSON(json) {
|
|
60
|
+
return AssistantTranscriptMessageFromJSONTyped(json, false);
|
|
61
|
+
}
|
|
62
|
+
function AssistantTranscriptMessageFromJSONTyped(json, ignoreDiscriminator) {
|
|
63
|
+
if (json == null) {
|
|
64
|
+
return json;
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
'attachments': (json['attachments'].map(AssistantChatPollAttachment_1.AssistantChatPollAttachmentFromJSON)),
|
|
68
|
+
'createdAt': json['createdAt'],
|
|
69
|
+
'failed': json['failed'],
|
|
70
|
+
'id': json['id'],
|
|
71
|
+
'reason': json['reason'],
|
|
72
|
+
'requestId': json['requestId'],
|
|
73
|
+
'role': json['role'],
|
|
74
|
+
'text': json['text'],
|
|
75
|
+
'toolCallId': json['toolCallId'],
|
|
76
|
+
'toolCalls': (json['toolCalls'].map(AssistantTranscriptToolCall_1.AssistantTranscriptToolCallFromJSON)),
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function AssistantTranscriptMessageToJSON(json) {
|
|
80
|
+
return AssistantTranscriptMessageToJSONTyped(json, false);
|
|
81
|
+
}
|
|
82
|
+
function AssistantTranscriptMessageToJSONTyped(value, ignoreDiscriminator = false) {
|
|
83
|
+
if (value == null) {
|
|
84
|
+
return value;
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
'attachments': (value['attachments'].map(AssistantChatPollAttachment_1.AssistantChatPollAttachmentToJSON)),
|
|
88
|
+
'createdAt': value['createdAt'],
|
|
89
|
+
'failed': value['failed'],
|
|
90
|
+
'id': value['id'],
|
|
91
|
+
'reason': value['reason'],
|
|
92
|
+
'requestId': value['requestId'],
|
|
93
|
+
'role': value['role'],
|
|
94
|
+
'text': value['text'],
|
|
95
|
+
'toolCallId': value['toolCallId'],
|
|
96
|
+
'toolCalls': (value['toolCalls'].map(AssistantTranscriptToolCall_1.AssistantTranscriptToolCallToJSON)),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* spaciv API
|
|
3
|
+
* The spaciv API powers workplace planning: modelling how many people an organisation has, how they work, and how much space that requires. ## Getting started 1. Exchange credentials for an access token using one of the operations under **Authentication**. 2. Send that token on every subsequent request as `Authorization: Bearer <token>`. 3. Access tokens are short lived. Call `POST /v1/auth/refresh-token` to obtain a new one before the old one expires. ## Conventions Every operation is versioned under `/v1`. Collections are plural (`GET /v1/dashboards` lists, `POST /v1/dashboards` creates) and individual records live beneath them (`/v1/dashboards/{id}`). Singular paths such as `/v1/account`, `/v1/project` and `/v1/user` refer to the record the access token was issued for. Request and response bodies are JSON. Timestamps are RFC 3339. Identifiers are opaque strings unless documented otherwise, and collection operations return the records visible to the account the token was issued for. Failures return an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem document with a `detail` field describing what went wrong.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
* Contact: support@spaciv.com
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface AssistantTranscriptToolCall
|
|
16
|
+
*/
|
|
17
|
+
export interface AssistantTranscriptToolCall {
|
|
18
|
+
/**
|
|
19
|
+
* The call's JSON arguments.
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof AssistantTranscriptToolCall
|
|
22
|
+
*/
|
|
23
|
+
arguments: string;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof AssistantTranscriptToolCall
|
|
28
|
+
*/
|
|
29
|
+
id: string;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof AssistantTranscriptToolCall
|
|
34
|
+
*/
|
|
35
|
+
name: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Check if a given object implements the AssistantTranscriptToolCall interface.
|
|
39
|
+
*/
|
|
40
|
+
export declare function instanceOfAssistantTranscriptToolCall(value: object): value is AssistantTranscriptToolCall;
|
|
41
|
+
export declare function AssistantTranscriptToolCallFromJSON(json: any): AssistantTranscriptToolCall;
|
|
42
|
+
export declare function AssistantTranscriptToolCallFromJSONTyped(json: any, ignoreDiscriminator: boolean): AssistantTranscriptToolCall;
|
|
43
|
+
export declare function AssistantTranscriptToolCallToJSON(json: any): AssistantTranscriptToolCall;
|
|
44
|
+
export declare function AssistantTranscriptToolCallToJSONTyped(value?: AssistantTranscriptToolCall | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* spaciv API
|
|
6
|
+
* The spaciv API powers workplace planning: modelling how many people an organisation has, how they work, and how much space that requires. ## Getting started 1. Exchange credentials for an access token using one of the operations under **Authentication**. 2. Send that token on every subsequent request as `Authorization: Bearer <token>`. 3. Access tokens are short lived. Call `POST /v1/auth/refresh-token` to obtain a new one before the old one expires. ## Conventions Every operation is versioned under `/v1`. Collections are plural (`GET /v1/dashboards` lists, `POST /v1/dashboards` creates) and individual records live beneath them (`/v1/dashboards/{id}`). Singular paths such as `/v1/account`, `/v1/project` and `/v1/user` refer to the record the access token was issued for. Request and response bodies are JSON. Timestamps are RFC 3339. Identifiers are opaque strings unless documented otherwise, and collection operations return the records visible to the account the token was issued for. Failures return an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem document with a `detail` field describing what went wrong.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
* Contact: support@spaciv.com
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.instanceOfAssistantTranscriptToolCall = instanceOfAssistantTranscriptToolCall;
|
|
17
|
+
exports.AssistantTranscriptToolCallFromJSON = AssistantTranscriptToolCallFromJSON;
|
|
18
|
+
exports.AssistantTranscriptToolCallFromJSONTyped = AssistantTranscriptToolCallFromJSONTyped;
|
|
19
|
+
exports.AssistantTranscriptToolCallToJSON = AssistantTranscriptToolCallToJSON;
|
|
20
|
+
exports.AssistantTranscriptToolCallToJSONTyped = AssistantTranscriptToolCallToJSONTyped;
|
|
21
|
+
/**
|
|
22
|
+
* Check if a given object implements the AssistantTranscriptToolCall interface.
|
|
23
|
+
*/
|
|
24
|
+
function instanceOfAssistantTranscriptToolCall(value) {
|
|
25
|
+
if (!('arguments' in value) || value['arguments'] === undefined)
|
|
26
|
+
return false;
|
|
27
|
+
if (!('id' in value) || value['id'] === undefined)
|
|
28
|
+
return false;
|
|
29
|
+
if (!('name' in value) || value['name'] === undefined)
|
|
30
|
+
return false;
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
function AssistantTranscriptToolCallFromJSON(json) {
|
|
34
|
+
return AssistantTranscriptToolCallFromJSONTyped(json, false);
|
|
35
|
+
}
|
|
36
|
+
function AssistantTranscriptToolCallFromJSONTyped(json, ignoreDiscriminator) {
|
|
37
|
+
if (json == null) {
|
|
38
|
+
return json;
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
'arguments': json['arguments'],
|
|
42
|
+
'id': json['id'],
|
|
43
|
+
'name': json['name'],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function AssistantTranscriptToolCallToJSON(json) {
|
|
47
|
+
return AssistantTranscriptToolCallToJSONTyped(json, false);
|
|
48
|
+
}
|
|
49
|
+
function AssistantTranscriptToolCallToJSONTyped(value, ignoreDiscriminator = false) {
|
|
50
|
+
if (value == null) {
|
|
51
|
+
return value;
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
'arguments': value['arguments'],
|
|
55
|
+
'id': value['id'],
|
|
56
|
+
'name': value['name'],
|
|
57
|
+
};
|
|
58
|
+
}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -37,6 +37,9 @@ export * from './AssistantConversationFailureBody';
|
|
|
37
37
|
export * from './AssistantConversationListEntry';
|
|
38
38
|
export * from './AssistantConversationListRes';
|
|
39
39
|
export * from './AssistantModelListBody';
|
|
40
|
+
export * from './AssistantTranscriptBody';
|
|
41
|
+
export * from './AssistantTranscriptMessage';
|
|
42
|
+
export * from './AssistantTranscriptToolCall';
|
|
40
43
|
export * from './AuthAPIKeyTokenReqBody';
|
|
41
44
|
export * from './AuthAPIKeyTokenResBody';
|
|
42
45
|
export * from './AuthLoginPassReqBody';
|
package/dist/models/index.js
CHANGED
|
@@ -55,6 +55,9 @@ __exportStar(require("./AssistantConversationFailureBody"), exports);
|
|
|
55
55
|
__exportStar(require("./AssistantConversationListEntry"), exports);
|
|
56
56
|
__exportStar(require("./AssistantConversationListRes"), exports);
|
|
57
57
|
__exportStar(require("./AssistantModelListBody"), exports);
|
|
58
|
+
__exportStar(require("./AssistantTranscriptBody"), exports);
|
|
59
|
+
__exportStar(require("./AssistantTranscriptMessage"), exports);
|
|
60
|
+
__exportStar(require("./AssistantTranscriptToolCall"), exports);
|
|
58
61
|
__exportStar(require("./AuthAPIKeyTokenReqBody"), exports);
|
|
59
62
|
__exportStar(require("./AuthAPIKeyTokenResBody"), exports);
|
|
60
63
|
__exportStar(require("./AuthLoginPassReqBody"), exports);
|
package/package.json
CHANGED
package/src/apis/AssistantApi.ts
CHANGED
|
@@ -22,6 +22,7 @@ import type {
|
|
|
22
22
|
AssistantConfigPutReq,
|
|
23
23
|
AssistantConversationListRes,
|
|
24
24
|
AssistantModelListBody,
|
|
25
|
+
AssistantTranscriptBody,
|
|
25
26
|
ErrorModel,
|
|
26
27
|
} from '../models/index';
|
|
27
28
|
import {
|
|
@@ -39,6 +40,8 @@ import {
|
|
|
39
40
|
AssistantConversationListResToJSON,
|
|
40
41
|
AssistantModelListBodyFromJSON,
|
|
41
42
|
AssistantModelListBodyToJSON,
|
|
43
|
+
AssistantTranscriptBodyFromJSON,
|
|
44
|
+
AssistantTranscriptBodyToJSON,
|
|
42
45
|
ErrorModelFromJSON,
|
|
43
46
|
ErrorModelToJSON,
|
|
44
47
|
} from '../models/index';
|
|
@@ -51,6 +54,10 @@ export interface AssistantApiDeleteConversationsRequest {
|
|
|
51
54
|
id: string;
|
|
52
55
|
}
|
|
53
56
|
|
|
57
|
+
export interface AssistantApiGetConversationsTranscriptRequest {
|
|
58
|
+
id: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
54
61
|
export interface AssistantApiPollConversationsRequest {
|
|
55
62
|
id: string;
|
|
56
63
|
since?: string;
|
|
@@ -118,6 +125,22 @@ export interface AssistantApiInterface {
|
|
|
118
125
|
*/
|
|
119
126
|
getConfig(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AssistantConfigBody>;
|
|
120
127
|
|
|
128
|
+
/**
|
|
129
|
+
* Returns the conversation as it is stored, for debugging and evaluating the assistant: every message the assistant has been shown, including the results of its tool calls and the ids that pair each result with its call, and the summary that replaces the earliest messages once the conversation has been compacted. Returns `404` if the conversation does not exist. Requires the *AI assistant* and *Download AI assistant conversation* permissions.
|
|
130
|
+
* @summary Get a conversation\'s transcript
|
|
131
|
+
* @param {string} id UUID of the conversation to read.
|
|
132
|
+
* @param {*} [options] Override http request option.
|
|
133
|
+
* @throws {RequiredError}
|
|
134
|
+
* @memberof AssistantApiInterface
|
|
135
|
+
*/
|
|
136
|
+
getConversationsTranscriptRaw(requestParameters: AssistantApiGetConversationsTranscriptRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AssistantTranscriptBody>>;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Returns the conversation as it is stored, for debugging and evaluating the assistant: every message the assistant has been shown, including the results of its tool calls and the ids that pair each result with its call, and the summary that replaces the earliest messages once the conversation has been compacted. Returns `404` if the conversation does not exist. Requires the *AI assistant* and *Download AI assistant conversation* permissions.
|
|
140
|
+
* Get a conversation\'s transcript
|
|
141
|
+
*/
|
|
142
|
+
getConversationsTranscript(requestParameters: AssistantApiGetConversationsTranscriptRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AssistantTranscriptBody>;
|
|
143
|
+
|
|
121
144
|
/**
|
|
122
145
|
* Returns the caller\'s own assistant conversations in the current project. A conversation belongs to the user who started it and is not visible to anyone else. Requires the *AI assistant* permission.
|
|
123
146
|
* @summary List conversations
|
|
@@ -331,6 +354,53 @@ export class AssistantApi extends runtime.BaseAPI implements AssistantApiInterfa
|
|
|
331
354
|
return await response.value();
|
|
332
355
|
}
|
|
333
356
|
|
|
357
|
+
/**
|
|
358
|
+
* Returns the conversation as it is stored, for debugging and evaluating the assistant: every message the assistant has been shown, including the results of its tool calls and the ids that pair each result with its call, and the summary that replaces the earliest messages once the conversation has been compacted. Returns `404` if the conversation does not exist. Requires the *AI assistant* and *Download AI assistant conversation* permissions.
|
|
359
|
+
* Get a conversation\'s transcript
|
|
360
|
+
*/
|
|
361
|
+
async getConversationsTranscriptRaw(requestParameters: AssistantApiGetConversationsTranscriptRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AssistantTranscriptBody>> {
|
|
362
|
+
if (requestParameters['id'] == null) {
|
|
363
|
+
throw new runtime.RequiredError(
|
|
364
|
+
'id',
|
|
365
|
+
'Required parameter "id" was null or undefined when calling getConversationsTranscript().'
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
const queryParameters: any = {};
|
|
370
|
+
|
|
371
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
372
|
+
|
|
373
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
374
|
+
const token = this.configuration.accessToken;
|
|
375
|
+
const tokenString = await token("accessToken", []);
|
|
376
|
+
|
|
377
|
+
if (tokenString) {
|
|
378
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
let urlPath = `/v1/assistant/conversations/{id}/transcript`;
|
|
383
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
384
|
+
|
|
385
|
+
const response = await this.request({
|
|
386
|
+
path: urlPath,
|
|
387
|
+
method: 'GET',
|
|
388
|
+
headers: headerParameters,
|
|
389
|
+
query: queryParameters,
|
|
390
|
+
}, initOverrides);
|
|
391
|
+
|
|
392
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AssistantTranscriptBodyFromJSON(jsonValue));
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Returns the conversation as it is stored, for debugging and evaluating the assistant: every message the assistant has been shown, including the results of its tool calls and the ids that pair each result with its call, and the summary that replaces the earliest messages once the conversation has been compacted. Returns `404` if the conversation does not exist. Requires the *AI assistant* and *Download AI assistant conversation* permissions.
|
|
397
|
+
* Get a conversation\'s transcript
|
|
398
|
+
*/
|
|
399
|
+
async getConversationsTranscript(requestParameters: AssistantApiGetConversationsTranscriptRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AssistantTranscriptBody> {
|
|
400
|
+
const response = await this.getConversationsTranscriptRaw(requestParameters, initOverrides);
|
|
401
|
+
return await response.value();
|
|
402
|
+
}
|
|
403
|
+
|
|
334
404
|
/**
|
|
335
405
|
* Returns the caller\'s own assistant conversations in the current project. A conversation belongs to the user who started it and is not visible to anyone else. Requires the *AI assistant* permission.
|
|
336
406
|
* List conversations
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* spaciv API
|
|
5
|
+
* The spaciv API powers workplace planning: modelling how many people an organisation has, how they work, and how much space that requires. ## Getting started 1. Exchange credentials for an access token using one of the operations under **Authentication**. 2. Send that token on every subsequent request as `Authorization: Bearer <token>`. 3. Access tokens are short lived. Call `POST /v1/auth/refresh-token` to obtain a new one before the old one expires. ## Conventions Every operation is versioned under `/v1`. Collections are plural (`GET /v1/dashboards` lists, `POST /v1/dashboards` creates) and individual records live beneath them (`/v1/dashboards/{id}`). Singular paths such as `/v1/account`, `/v1/project` and `/v1/user` refer to the record the access token was issued for. Request and response bodies are JSON. Timestamps are RFC 3339. Identifiers are opaque strings unless documented otherwise, and collection operations return the records visible to the account the token was issued for. Failures return an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem document with a `detail` field describing what went wrong.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
* Contact: support@spaciv.com
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { AssistantTranscriptMessage } from './AssistantTranscriptMessage';
|
|
17
|
+
import {
|
|
18
|
+
AssistantTranscriptMessageFromJSON,
|
|
19
|
+
AssistantTranscriptMessageFromJSONTyped,
|
|
20
|
+
AssistantTranscriptMessageToJSON,
|
|
21
|
+
AssistantTranscriptMessageToJSONTyped,
|
|
22
|
+
} from './AssistantTranscriptMessage';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface AssistantTranscriptBody
|
|
28
|
+
*/
|
|
29
|
+
export interface AssistantTranscriptBody {
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {Array<AssistantTranscriptMessage>}
|
|
33
|
+
* @memberof AssistantTranscriptBody
|
|
34
|
+
*/
|
|
35
|
+
messages: Array<AssistantTranscriptMessage>;
|
|
36
|
+
/**
|
|
37
|
+
* What the assistant is told of the messages it no longer replays, once the conversation has been compacted. Empty until then.
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof AssistantTranscriptBody
|
|
40
|
+
*/
|
|
41
|
+
summary: string;
|
|
42
|
+
/**
|
|
43
|
+
* How many of the leading messages the summary stands in for.
|
|
44
|
+
* @type {number}
|
|
45
|
+
* @memberof AssistantTranscriptBody
|
|
46
|
+
*/
|
|
47
|
+
summaryUpTo: number;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Check if a given object implements the AssistantTranscriptBody interface.
|
|
52
|
+
*/
|
|
53
|
+
export function instanceOfAssistantTranscriptBody(value: object): value is AssistantTranscriptBody {
|
|
54
|
+
if (!('messages' in value) || value['messages'] === undefined) return false;
|
|
55
|
+
if (!('summary' in value) || value['summary'] === undefined) return false;
|
|
56
|
+
if (!('summaryUpTo' in value) || value['summaryUpTo'] === undefined) return false;
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function AssistantTranscriptBodyFromJSON(json: any): AssistantTranscriptBody {
|
|
61
|
+
return AssistantTranscriptBodyFromJSONTyped(json, false);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function AssistantTranscriptBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): AssistantTranscriptBody {
|
|
65
|
+
if (json == null) {
|
|
66
|
+
return json;
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
|
|
70
|
+
'messages': ((json['messages'] as Array<any>).map(AssistantTranscriptMessageFromJSON)),
|
|
71
|
+
'summary': json['summary'],
|
|
72
|
+
'summaryUpTo': json['summaryUpTo'],
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function AssistantTranscriptBodyToJSON(json: any): AssistantTranscriptBody {
|
|
77
|
+
return AssistantTranscriptBodyToJSONTyped(json, false);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function AssistantTranscriptBodyToJSONTyped(value?: AssistantTranscriptBody | null, ignoreDiscriminator: boolean = false): any {
|
|
81
|
+
if (value == null) {
|
|
82
|
+
return value;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return {
|
|
86
|
+
|
|
87
|
+
'messages': ((value['messages'] as Array<any>).map(AssistantTranscriptMessageToJSON)),
|
|
88
|
+
'summary': value['summary'],
|
|
89
|
+
'summaryUpTo': value['summaryUpTo'],
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|