@simfinity/constellation-client 1.0.15 → 1.0.17
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/index.cjs +0 -35
- package/dist/index.d.cts +0 -6
- package/dist/index.d.ts +0 -6
- package/dist/index.js +0 -35
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -31,41 +31,6 @@ var WebClient = class {
|
|
|
31
31
|
this.sessionId = null;
|
|
32
32
|
this.config = config;
|
|
33
33
|
}
|
|
34
|
-
/* /!**
|
|
35
|
-
* Retrieve the list of available tools:
|
|
36
|
-
* Tools, or functions, can be exposed to & added to the model's context, allowing it
|
|
37
|
-
* to use them during the session as part of its response creation process. In order to add
|
|
38
|
-
* a tool to the session context, it must be listed (by name) at session creation time
|
|
39
|
-
* (see startSession(...) function)
|
|
40
|
-
*
|
|
41
|
-
* @remarks
|
|
42
|
-
* Tools are remote functions exposed by MCP servers and integrated by the constellation server
|
|
43
|
-
*
|
|
44
|
-
* @exception
|
|
45
|
-
* This method throws new Error(...) if unable to execute successfully for any reason.
|
|
46
|
-
*!/
|
|
47
|
-
public async fetchSupportedTools(): Promise<ToolDescription[]> {
|
|
48
|
-
const response = await fetch(`${this.config.sessionEndpoint}/supported_tools`, {
|
|
49
|
-
method: 'GET',
|
|
50
|
-
headers: {
|
|
51
|
-
'Authorization': `Bearer ${this.config.key}`,
|
|
52
|
-
'Content-Type': 'application/json',
|
|
53
|
-
'Accept': 'application/json'
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
if (!response.ok) {
|
|
58
|
-
throw new Error(`Could not fetch the list of available tools\n[${response.status}:${response.statusText}]`)
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
try {
|
|
62
|
-
const result: ToolDescription[] = await response.json();
|
|
63
|
-
return result ?? [];
|
|
64
|
-
}
|
|
65
|
-
catch(error) {
|
|
66
|
-
throw `Failed to read session create response: ${error}`;
|
|
67
|
-
}
|
|
68
|
-
}*/
|
|
69
34
|
/**
|
|
70
35
|
* Start a persistent chat room on the server, allowing for re-connection,
|
|
71
36
|
* when the streaming connection is lost. Once a session was started it must
|
package/dist/index.d.cts
CHANGED
|
@@ -70,12 +70,6 @@ interface EventHandlers {
|
|
|
70
70
|
onTranscriptResponse?: (transcript: string) => void;
|
|
71
71
|
onTechnicalError?: (error: string) => void;
|
|
72
72
|
}
|
|
73
|
-
/**
|
|
74
|
-
* Description of an available tool that can be added to a session context.
|
|
75
|
-
* Tools included in the session context can be used by the AI model during the session.
|
|
76
|
-
* Tools (or functions) can be many things, for example a calendar manager, allowing
|
|
77
|
-
* the model to manage the user's schedule.
|
|
78
|
-
*/
|
|
79
73
|
/**
|
|
80
74
|
* This class is a code wrapper to integrate the Simfinity constellation server.
|
|
81
75
|
* The constellation server is a proxy managing streaming sessions with third party LLMs.
|
package/dist/index.d.ts
CHANGED
|
@@ -70,12 +70,6 @@ interface EventHandlers {
|
|
|
70
70
|
onTranscriptResponse?: (transcript: string) => void;
|
|
71
71
|
onTechnicalError?: (error: string) => void;
|
|
72
72
|
}
|
|
73
|
-
/**
|
|
74
|
-
* Description of an available tool that can be added to a session context.
|
|
75
|
-
* Tools included in the session context can be used by the AI model during the session.
|
|
76
|
-
* Tools (or functions) can be many things, for example a calendar manager, allowing
|
|
77
|
-
* the model to manage the user's schedule.
|
|
78
|
-
*/
|
|
79
73
|
/**
|
|
80
74
|
* This class is a code wrapper to integrate the Simfinity constellation server.
|
|
81
75
|
* The constellation server is a proxy managing streaming sessions with third party LLMs.
|
package/dist/index.js
CHANGED
|
@@ -5,41 +5,6 @@ var WebClient = class {
|
|
|
5
5
|
this.sessionId = null;
|
|
6
6
|
this.config = config;
|
|
7
7
|
}
|
|
8
|
-
/* /!**
|
|
9
|
-
* Retrieve the list of available tools:
|
|
10
|
-
* Tools, or functions, can be exposed to & added to the model's context, allowing it
|
|
11
|
-
* to use them during the session as part of its response creation process. In order to add
|
|
12
|
-
* a tool to the session context, it must be listed (by name) at session creation time
|
|
13
|
-
* (see startSession(...) function)
|
|
14
|
-
*
|
|
15
|
-
* @remarks
|
|
16
|
-
* Tools are remote functions exposed by MCP servers and integrated by the constellation server
|
|
17
|
-
*
|
|
18
|
-
* @exception
|
|
19
|
-
* This method throws new Error(...) if unable to execute successfully for any reason.
|
|
20
|
-
*!/
|
|
21
|
-
public async fetchSupportedTools(): Promise<ToolDescription[]> {
|
|
22
|
-
const response = await fetch(`${this.config.sessionEndpoint}/supported_tools`, {
|
|
23
|
-
method: 'GET',
|
|
24
|
-
headers: {
|
|
25
|
-
'Authorization': `Bearer ${this.config.key}`,
|
|
26
|
-
'Content-Type': 'application/json',
|
|
27
|
-
'Accept': 'application/json'
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
if (!response.ok) {
|
|
32
|
-
throw new Error(`Could not fetch the list of available tools\n[${response.status}:${response.statusText}]`)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
try {
|
|
36
|
-
const result: ToolDescription[] = await response.json();
|
|
37
|
-
return result ?? [];
|
|
38
|
-
}
|
|
39
|
-
catch(error) {
|
|
40
|
-
throw `Failed to read session create response: ${error}`;
|
|
41
|
-
}
|
|
42
|
-
}*/
|
|
43
8
|
/**
|
|
44
9
|
* Start a persistent chat room on the server, allowing for re-connection,
|
|
45
10
|
* when the streaming connection is lost. Once a session was started it must
|