@theia/ai-chat 1.55.0-next.97 → 1.55.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/lib/common/chat-agents.d.ts +2 -2
- package/lib/common/chat-agents.d.ts.map +1 -1
- package/lib/common/chat-agents.js +30 -16
- package/lib/common/chat-agents.js.map +1 -1
- package/lib/common/command-chat-agents.d.ts.map +1 -1
- package/lib/common/command-chat-agents.js +1 -3
- package/lib/common/command-chat-agents.js.map +1 -1
- package/lib/common/orchestrator-chat-agent.d.ts.map +1 -1
- package/lib/common/orchestrator-chat-agent.js +14 -16
- package/lib/common/orchestrator-chat-agent.js.map +1 -1
- package/lib/common/universal-chat-agent.d.ts.map +1 -1
- package/lib/common/universal-chat-agent.js +1 -3
- package/lib/common/universal-chat-agent.js.map +1 -1
- package/package.json +8 -8
- package/src/common/chat-agents.ts +39 -21
- package/src/common/command-chat-agents.ts +1 -3
- package/src/common/orchestrator-chat-agent.ts +14 -17
- package/src/common/universal-chat-agent.ts +1 -3
- package/lib/common/chat-history-entry.d.ts +0 -7
- package/lib/common/chat-history-entry.d.ts.map +0 -1
- package/lib/common/chat-history-entry.js +0 -42
- package/lib/common/chat-history-entry.js.map +0 -1
- package/src/common/chat-history-entry.ts +0 -47
|
@@ -55,7 +55,7 @@ export declare abstract class AbstractChatAgent {
|
|
|
55
55
|
protected defaultLanguageModelPurpose: string;
|
|
56
56
|
iconClass: string;
|
|
57
57
|
locations: ChatAgentLocation[];
|
|
58
|
-
tags:
|
|
58
|
+
tags: String[];
|
|
59
59
|
defaultLogging: boolean;
|
|
60
60
|
protected languageModelRegistry: LanguageModelRegistry;
|
|
61
61
|
protected logger: ILogger;
|
|
@@ -64,7 +64,7 @@ export declare abstract class AbstractChatAgent {
|
|
|
64
64
|
protected contentMatcherProviders: ContributionProvider<ResponseContentMatcherProvider>;
|
|
65
65
|
protected contentMatchers: ResponseContentMatcher[];
|
|
66
66
|
protected defaultContentFactory: DefaultResponseContentFactory;
|
|
67
|
-
constructor(id: string, languageModelRequirements: LanguageModelRequirement[], defaultLanguageModelPurpose: string, iconClass?: string, locations?: ChatAgentLocation[], tags?:
|
|
67
|
+
constructor(id: string, languageModelRequirements: LanguageModelRequirement[], defaultLanguageModelPurpose: string, iconClass?: string, locations?: ChatAgentLocation[], tags?: String[], defaultLogging?: boolean);
|
|
68
68
|
init(): void;
|
|
69
69
|
invoke(request: ChatRequestModelImpl): Promise<void>;
|
|
70
70
|
protected parseContents(text: string): ChatResponseContent[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-agents.d.ts","sourceRoot":"","sources":["../../src/common/chat-agents.ts"],"names":[],"mappings":"AAqBA,OAAO,EACH,6BAA6B,EAE7B,aAAa,EACb,wBAAwB,EACxB,qBAAqB,EACrB,2BAA2B,EAC3B,aAAa,EACb,sBAAsB,EACtB,WAAW,EACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACH,KAAK,EAGL,qBAAqB,EACrB,+BAA+B,EAC/B,YAAY,EACf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAA2B,oBAAoB,EAAE,OAAO,EAAW,MAAM,aAAa,CAAC;AAEjH,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACH,SAAS,EACT,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EAItB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,6BAA6B,EAAE,sBAAsB,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"chat-agents.d.ts","sourceRoot":"","sources":["../../src/common/chat-agents.ts"],"names":[],"mappings":"AAqBA,OAAO,EACH,6BAA6B,EAE7B,aAAa,EACb,wBAAwB,EACxB,qBAAqB,EACrB,2BAA2B,EAC3B,aAAa,EACb,sBAAsB,EACtB,WAAW,EACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACH,KA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O,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;cAyC1H,iBAAiB,CAAC,qBAAqB,EAAE,2BAA2B,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IA2BnI,SAAS,CAAC,KAAK,CAAC,KAAK,EAAE,+BAA+B,EAAE,eAAe,EAAE,mBAAmB,EAAE,GAAG,mBAAmB,GAAG,mBAAmB,EAAE;CAe/I"}
|
|
@@ -29,7 +29,6 @@ const inversify_1 = require("@theia/core/shared/inversify");
|
|
|
29
29
|
const chat_model_1 = require("./chat-model");
|
|
30
30
|
const parse_contents_1 = require("./parse-contents");
|
|
31
31
|
const response_content_matcher_1 = require("./response-content-matcher");
|
|
32
|
-
const chat_history_entry_1 = require("./chat-history-entry");
|
|
33
32
|
var SystemMessageDescription;
|
|
34
33
|
(function (SystemMessageDescription) {
|
|
35
34
|
function fromResolvedPromptTemplate(resolvedPrompt) {
|
|
@@ -86,14 +85,18 @@ let AbstractChatAgent = class AbstractChatAgent {
|
|
|
86
85
|
if (!languageModel) {
|
|
87
86
|
throw new Error('Couldn\'t find a matching language model. Please check your setup!');
|
|
88
87
|
}
|
|
89
|
-
const systemMessageDescription = await this.getSystemMessageDescription();
|
|
90
88
|
const messages = await this.getMessages(request.session);
|
|
91
89
|
if (this.defaultLogging) {
|
|
92
|
-
this.recordingService.recordRequest(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
this.recordingService.recordRequest({
|
|
91
|
+
agentId: this.id,
|
|
92
|
+
sessionId: request.session.id,
|
|
93
|
+
timestamp: Date.now(),
|
|
94
|
+
requestId: request.id,
|
|
95
|
+
request: request.request.text,
|
|
96
|
+
messages
|
|
97
|
+
});
|
|
96
98
|
}
|
|
99
|
+
const systemMessageDescription = await this.getSystemMessageDescription();
|
|
97
100
|
const tools = new Map();
|
|
98
101
|
if (systemMessageDescription) {
|
|
99
102
|
const systemMsg = {
|
|
@@ -118,7 +121,13 @@ let AbstractChatAgent = class AbstractChatAgent {
|
|
|
118
121
|
await this.addContentsToResponse(languageModelResponse, request);
|
|
119
122
|
request.response.complete();
|
|
120
123
|
if (this.defaultLogging) {
|
|
121
|
-
this.recordingService.recordResponse(
|
|
124
|
+
this.recordingService.recordResponse({
|
|
125
|
+
agentId: this.id,
|
|
126
|
+
sessionId: request.session.id,
|
|
127
|
+
timestamp: Date.now(),
|
|
128
|
+
requestId: request.response.requestId,
|
|
129
|
+
response: request.response.response.asString()
|
|
130
|
+
});
|
|
122
131
|
}
|
|
123
132
|
}
|
|
124
133
|
catch (e) {
|
|
@@ -225,13 +234,6 @@ tslib_1.__decorate([
|
|
|
225
234
|
], AbstractChatAgent.prototype, "init", null);
|
|
226
235
|
exports.AbstractChatAgent = AbstractChatAgent = tslib_1.__decorate([
|
|
227
236
|
(0, inversify_1.injectable)(),
|
|
228
|
-
tslib_1.__param(0, (0, inversify_1.unmanaged)()),
|
|
229
|
-
tslib_1.__param(1, (0, inversify_1.unmanaged)()),
|
|
230
|
-
tslib_1.__param(2, (0, inversify_1.unmanaged)()),
|
|
231
|
-
tslib_1.__param(3, (0, inversify_1.unmanaged)()),
|
|
232
|
-
tslib_1.__param(4, (0, inversify_1.unmanaged)()),
|
|
233
|
-
tslib_1.__param(5, (0, inversify_1.unmanaged)()),
|
|
234
|
-
tslib_1.__param(6, (0, inversify_1.unmanaged)()),
|
|
235
237
|
tslib_1.__metadata("design:paramtypes", [String, Array, String, String, Array, Array, Boolean])
|
|
236
238
|
], AbstractChatAgent);
|
|
237
239
|
let AbstractTextToModelParsingChatAgent = class AbstractTextToModelParsingChatAgent extends AbstractChatAgent {
|
|
@@ -253,7 +255,13 @@ let AbstractStreamParsingChatAgent = class AbstractStreamParsingChatAgent extend
|
|
|
253
255
|
request.response.response.addContents(contents);
|
|
254
256
|
request.response.complete();
|
|
255
257
|
if (this.defaultLogging) {
|
|
256
|
-
this.recordingService.recordResponse(
|
|
258
|
+
this.recordingService.recordResponse({
|
|
259
|
+
agentId: this.id,
|
|
260
|
+
sessionId: request.session.id,
|
|
261
|
+
timestamp: Date.now(),
|
|
262
|
+
requestId: request.response.requestId,
|
|
263
|
+
response: request.response.response.asString()
|
|
264
|
+
});
|
|
257
265
|
}
|
|
258
266
|
return;
|
|
259
267
|
}
|
|
@@ -261,7 +269,13 @@ let AbstractStreamParsingChatAgent = class AbstractStreamParsingChatAgent extend
|
|
|
261
269
|
await this.addStreamResponse(languageModelResponse, request);
|
|
262
270
|
request.response.complete();
|
|
263
271
|
if (this.defaultLogging) {
|
|
264
|
-
this.recordingService.recordResponse(
|
|
272
|
+
this.recordingService.recordResponse({
|
|
273
|
+
agentId: this.id,
|
|
274
|
+
sessionId: request.session.id,
|
|
275
|
+
timestamp: Date.now(),
|
|
276
|
+
requestId: request.response.requestId,
|
|
277
|
+
response: request.response.response.asString()
|
|
278
|
+
});
|
|
265
279
|
}
|
|
266
280
|
return;
|
|
267
281
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-agents.js","sourceRoot":"","sources":["../../src/common/chat-agents.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF;;;gGAGgG;AAChG,6JAA6J;;;;AAE7J,4CAUwB;AACxB,sDAOmC;AACnC,sCAAiH;AACjH,
|
|
1
|
+
{"version":3,"file":"chat-agents.js","sourceRoot":"","sources":["../../src/common/chat-agents.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uD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C,OAAA,IAAI,4CAA+B,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAA,QAAQ,CAAC,QAAQ,0CAAE,IAAI,EAAE,MAAA,QAAQ,CAAC,QAAQ,0CAAE,SAAS,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA,EAAA,CAAC,CAAC;YACjJ,OAAO,gBAAgB,CAAC;QAC5B,CAAC;QACD,OAAO,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACjD,CAAC;CAEJ,CAAA;AArFqB,wEAA8B;yCAA9B,8BAA8B;IADnD,IAAA,sBAAU,GAAE;GACS,8BAA8B,CAqFnD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-chat-agents.d.ts","sourceRoot":"","sources":["../../src/common/command-chat-agents.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,mCAAmC,EAAE,SAAS,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACzG,OAAO,EACH,cAAc,EACd,sBAAsB,EACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACH,oBAAoB,EACpB,mBAAmB,EAKtB,MAAM,cAAc,CAAC;AACtB,OAAO,EACH,eAAe,EACf,cAAc,EAEjB,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"command-chat-agents.d.ts","sourceRoot":"","sources":["../../src/common/command-chat-agents.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,mCAAmC,EAAE,SAAS,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACzG,OAAO,EACH,cAAc,EACd,sBAAsB,EACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACH,oBAAoB,EACpB,mBAAmB,EAKtB,MAAM,cAAc,CAAC;AACtB,OAAO,EACH,eAAe,EACf,cAAc,EAEjB,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,eAAe,EAAE,cA4M5B,CAAC;AAEH,UAAU,aAAa;IACnB,IAAI,EAAE,eAAe,GAAG,gBAAgB,GAAG,YAAY,CAAA;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBACa,gBAAiB,SAAQ,mCAAmC,CAAC,aAAa,CAAE,YAAW,SAAS;IAEzG,SAAS,CAAC,eAAe,EAAE,eAAe,CAAC;IAE3C,SAAS,CAAC,cAAc,EAAE,cAAc,CAAC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC;IAC7B,QAAQ,CAAC,eAAe,EAAE,cAAc,EAAE,CAAC;IAC3C,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC;IAC7B,QAAQ,CAAC,sBAAsB,EAAE,sBAAsB,EAAE,CAAC;;cAqB1C,2BAA2B,IAAI,OAAO,CAAC,wBAAwB,GAAG,SAAS,CAAC;IAc5F;;;;OAIG;cACa,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAUvE,SAAS,CAAC,qBAAqB,CAAC,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,oBAAoB,GAAG,mBAAmB;cAqCjG,eAAe,CAAC,GAAG,WAAW,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAI5E"}
|
|
@@ -23,9 +23,7 @@ const chat_model_1 = require("./chat-model");
|
|
|
23
23
|
const core_1 = require("@theia/core");
|
|
24
24
|
exports.commandTemplate = {
|
|
25
25
|
id: 'command-system',
|
|
26
|
-
template:
|
|
27
|
-
https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
|
|
28
|
-
# System Prompt
|
|
26
|
+
template: `# System Prompt
|
|
29
27
|
|
|
30
28
|
You are a service that helps users find commands to execute in an IDE.
|
|
31
29
|
You reply with stringified JSON Objects that tell the user which command to execute and its arguments, if any.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-chat-agents.js","sourceRoot":"","sources":["../../src/common/command-chat-agents.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4DAAkE;AAClE,+CAAyG;AAKzG,6CAOsB;AACtB,sCAIqB;AAER,QAAA,eAAe,GAAmB;IAC3C,EAAE,EAAE,gBAAgB;IACpB,QAAQ,EAAE
|
|
1
|
+
{"version":3,"file":"command-chat-agents.js","sourceRoot":"","sources":["../../src/common/command-chat-agents.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4DAAkE;AAClE,+CAAyG;AAKzG,6CAOsB;AACtB,sCAIqB;AAER,QAAA,eAAe,GAAmB;IAC3C,EAAE,EAAE,gBAAgB;IACpB,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Mb;CAAC,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@ -23,12 +23,9 @@ const chat_agent_service_1 = require("./chat-agent-service");
|
|
|
23
23
|
const chat_agents_1 = require("./chat-agents");
|
|
24
24
|
const chat_model_1 = require("./chat-model");
|
|
25
25
|
const core_1 = require("@theia/core");
|
|
26
|
-
const chat_history_entry_1 = require("./chat-history-entry");
|
|
27
26
|
exports.orchestratorTemplate = {
|
|
28
27
|
id: 'orchestrator-system',
|
|
29
|
-
template:
|
|
30
|
-
https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
|
|
31
|
-
# Instructions
|
|
28
|
+
template: `# Instructions
|
|
32
29
|
|
|
33
30
|
Your task is to identify which Chat Agent(s) should best reply a given user's message.
|
|
34
31
|
You consider all messages of the conversation to ensure consistency and avoid agent switches without a clear context change.
|
|
@@ -62,7 +59,7 @@ You must only use the \`id\` attribute of the agent, never the name.
|
|
|
62
59
|
`
|
|
63
60
|
};
|
|
64
61
|
exports.OrchestratorChatAgentId = 'Orchestrator';
|
|
65
|
-
const
|
|
62
|
+
const OrchestatorRequestIdKey = 'orchestatorRequestIdKey';
|
|
66
63
|
let OrchestratorChatAgent = class OrchestratorChatAgent extends chat_agents_1.AbstractStreamParsingChatAgent {
|
|
67
64
|
constructor() {
|
|
68
65
|
super(exports.OrchestratorChatAgentId, [{
|
|
@@ -81,18 +78,18 @@ let OrchestratorChatAgent = class OrchestratorChatAgent extends chat_agents_1.Ab
|
|
|
81
78
|
this.agentSpecificVariables = [];
|
|
82
79
|
}
|
|
83
80
|
async invoke(request) {
|
|
84
|
-
var _a;
|
|
85
81
|
request.response.addProgressMessage({ content: 'Determining the most appropriate agent', status: 'inProgress' });
|
|
86
82
|
// We generate a dedicated ID for recording the orchestrator request/response, as we will forward the original request to another agent
|
|
87
|
-
const
|
|
88
|
-
request.addData(
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
83
|
+
const orchestartorRequestId = (0, core_1.generateUuid)();
|
|
84
|
+
request.addData(OrchestatorRequestIdKey, orchestartorRequestId);
|
|
85
|
+
const userPrompt = request.request.text;
|
|
86
|
+
this.recordingService.recordRequest({
|
|
87
|
+
agentId: this.id,
|
|
88
|
+
sessionId: request.session.id,
|
|
89
|
+
timestamp: Date.now(),
|
|
90
|
+
requestId: orchestartorRequestId,
|
|
91
|
+
request: userPrompt,
|
|
92
|
+
});
|
|
96
93
|
return super.invoke(request);
|
|
97
94
|
}
|
|
98
95
|
async getSystemMessageDescription() {
|
|
@@ -104,11 +101,12 @@ let OrchestratorChatAgent = class OrchestratorChatAgent extends chat_agents_1.Ab
|
|
|
104
101
|
let agentIds = [];
|
|
105
102
|
const responseText = await (0, ai_core_1.getTextOfResponse)(response);
|
|
106
103
|
// We use the previously generated, dedicated ID to log the orchestrator response before we forward the original request
|
|
107
|
-
const orchestratorRequestId = request.getDataByKey(
|
|
104
|
+
const orchestratorRequestId = request.getDataByKey(OrchestatorRequestIdKey);
|
|
108
105
|
if (typeof orchestratorRequestId === 'string') {
|
|
109
106
|
this.recordingService.recordResponse({
|
|
110
107
|
agentId: this.id,
|
|
111
108
|
sessionId: request.session.id,
|
|
109
|
+
timestamp: Date.now(),
|
|
112
110
|
requestId: orchestratorRequestId,
|
|
113
111
|
response: responseText,
|
|
114
112
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator-chat-agent.js","sourceRoot":"","sources":["../../src/common/orchestrator-chat-agent.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4CAAiH;AAIjH,4DAAkE;AAClE,6DAAwD;AACxD,+CAAoG;AACpG,6CAA0F;AAC1F,sCAA2C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BAAU,GAAE;;GACA,qBAAqB,CA8GjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"universal-chat-agent.d.ts","sourceRoot":"","sources":["../../src/common/universal-chat-agent.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EACJ,cAAc,EAChB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,8BAA8B,EAAE,SAAS,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAEpG,eAAO,MAAM,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"universal-chat-agent.d.ts","sourceRoot":"","sources":["../../src/common/universal-chat-agent.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EACJ,cAAc,EAChB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,8BAA8B,EAAE,SAAS,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAEpG,eAAO,MAAM,iBAAiB,EAAE,cAqD/B,CAAC;AAEF,qBACa,kBAAmB,SAAQ,8BAA+B,YAAW,SAAS;IACxF,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC;IAC7B,QAAQ,CAAC,sBAAsB,EAAE,sBAAsB,EAAE,CAAC;;cAkBjC,2BAA2B,IAAI,OAAO,CAAC,wBAAwB,GAAG,SAAS,CAAC;CAKvG"}
|
|
@@ -21,9 +21,7 @@ const inversify_1 = require("@theia/core/shared/inversify");
|
|
|
21
21
|
const chat_agents_1 = require("./chat-agents");
|
|
22
22
|
exports.universalTemplate = {
|
|
23
23
|
id: 'universal-system',
|
|
24
|
-
template:
|
|
25
|
-
https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
|
|
26
|
-
# Instructions
|
|
24
|
+
template: `# Instructions
|
|
27
25
|
|
|
28
26
|
You are an AI assistant integrated into the Theia IDE, specifically designed to help software developers by
|
|
29
27
|
providing concise and accurate answers to programming-related questions. Your role is to enhance the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"universal-chat-agent.js","sourceRoot":"","sources":["../../src/common/universal-chat-agent.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAMhF,4DAA0D;AAC1D,+CAAoG;AAEvF,QAAA,iBAAiB,GAAmB;IAC9C,EAAE,EAAE,kBAAkB;IACtB,QAAQ,EAAE
|
|
1
|
+
{"version":3,"file":"universal-chat-agent.js","sourceRoot":"","sources":["../../src/common/universal-chat-agent.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAMhF,4DAA0D;AAC1D,+CAAoG;AAEvF,QAAA,iBAAiB,GAAmB;IAC9C,EAAE,EAAE,kBAAkB;IACtB,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDZ;CACA,CAAC;AAGK,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,4CAA8B;IAQnE;QACG,KAAK,CAAC,WAAW,EAAE,CAAC;gBACjB,OAAO,EAAE,MAAM;gBACf,UAAU,EAAE,eAAe;aAC7B,CAAC,EAAE,MAAM,CAAC,CAAC;QACZ,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,CAAC,WAAW,GAAG,uFAAuF;cACrG,8GAA8G;cAC9G,mHAAmH;cACnH,mDAAmD,CAAC;QACzD,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,eAAe,GAAG,CAAC,yBAAiB,CAAC,CAAC;QAC3C,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,sBAAsB,GAAG,EAAE,CAAC;IACpC,CAAC;IAEkB,KAAK,CAAC,2BAA2B;QACjD,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,yBAAiB,CAAC,EAAE,CAAC,CAAC;QAChF,OAAO,cAAc,CAAC,CAAC,CAAC,sCAAwB,CAAC,0BAA0B,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3G,CAAC;CAEH,CAAA;AA7BY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,sBAAU,GAAE;;GACA,kBAAkB,CA6B9B"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/ai-chat",
|
|
3
|
-
"version": "1.55.
|
|
3
|
+
"version": "1.55.1",
|
|
4
4
|
"description": "Theia - AI Chat Extension",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/ai-core": "1.55.
|
|
7
|
-
"@theia/ai-history": "1.55.
|
|
8
|
-
"@theia/core": "1.55.
|
|
9
|
-
"@theia/filesystem": "1.55.
|
|
10
|
-
"@theia/workspace": "1.55.
|
|
6
|
+
"@theia/ai-core": "1.55.1",
|
|
7
|
+
"@theia/ai-history": "1.55.1",
|
|
8
|
+
"@theia/core": "1.55.1",
|
|
9
|
+
"@theia/filesystem": "1.55.1",
|
|
10
|
+
"@theia/workspace": "1.55.1",
|
|
11
11
|
"minimatch": "^5.1.0",
|
|
12
12
|
"tslib": "^2.6.2"
|
|
13
13
|
},
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"watch": "theiaext watch"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@theia/ext-scripts": "1.55.
|
|
48
|
+
"@theia/ext-scripts": "1.55.1"
|
|
49
49
|
},
|
|
50
50
|
"nyc": {
|
|
51
51
|
"extends": "../../configs/nyc.json"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "be4713a778be16ba831af63a6fbd43b2301e882d"
|
|
54
54
|
}
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
MessageActor,
|
|
40
40
|
} from '@theia/ai-core/lib/common';
|
|
41
41
|
import { CancellationToken, CancellationTokenSource, ContributionProvider, ILogger, isArray } from '@theia/core';
|
|
42
|
-
import { inject, injectable, named, postConstruct
|
|
42
|
+
import { inject, injectable, named, postConstruct } from '@theia/core/shared/inversify';
|
|
43
43
|
import { ChatAgentService } from './chat-agent-service';
|
|
44
44
|
import {
|
|
45
45
|
ChatModel,
|
|
@@ -52,7 +52,6 @@ import {
|
|
|
52
52
|
} from './chat-model';
|
|
53
53
|
import { findFirstMatch, parseContents } from './parse-contents';
|
|
54
54
|
import { DefaultResponseContentFactory, ResponseContentMatcher, ResponseContentMatcherProvider } from './response-content-matcher';
|
|
55
|
-
import { ChatHistoryEntry } from './chat-history-entry';
|
|
56
55
|
|
|
57
56
|
/**
|
|
58
57
|
* A conversation consists of a sequence of ChatMessages.
|
|
@@ -133,13 +132,13 @@ export abstract class AbstractChatAgent {
|
|
|
133
132
|
protected defaultContentFactory: DefaultResponseContentFactory;
|
|
134
133
|
|
|
135
134
|
constructor(
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
135
|
+
public id: string,
|
|
136
|
+
public languageModelRequirements: LanguageModelRequirement[],
|
|
137
|
+
protected defaultLanguageModelPurpose: string,
|
|
138
|
+
public iconClass: string = 'codicon codicon-copilot',
|
|
139
|
+
public locations: ChatAgentLocation[] = ChatAgentLocation.ALL,
|
|
140
|
+
public tags: String[] = ['Chat'],
|
|
141
|
+
public defaultLogging: boolean = true) {
|
|
143
142
|
}
|
|
144
143
|
|
|
145
144
|
@postConstruct()
|
|
@@ -153,19 +152,19 @@ export abstract class AbstractChatAgent {
|
|
|
153
152
|
if (!languageModel) {
|
|
154
153
|
throw new Error('Couldn\'t find a matching language model. Please check your setup!');
|
|
155
154
|
}
|
|
156
|
-
|
|
157
|
-
const systemMessageDescription = await this.getSystemMessageDescription();
|
|
158
155
|
const messages = await this.getMessages(request.session);
|
|
159
156
|
if (this.defaultLogging) {
|
|
160
|
-
this.recordingService.recordRequest(
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
157
|
+
this.recordingService.recordRequest({
|
|
158
|
+
agentId: this.id,
|
|
159
|
+
sessionId: request.session.id,
|
|
160
|
+
timestamp: Date.now(),
|
|
161
|
+
requestId: request.id,
|
|
162
|
+
request: request.request.text,
|
|
163
|
+
messages
|
|
164
|
+
});
|
|
167
165
|
}
|
|
168
166
|
|
|
167
|
+
const systemMessageDescription = await this.getSystemMessageDescription();
|
|
169
168
|
const tools: Map<string, ToolRequest> = new Map();
|
|
170
169
|
if (systemMessageDescription) {
|
|
171
170
|
const systemMsg: ChatMessage = {
|
|
@@ -197,7 +196,13 @@ export abstract class AbstractChatAgent {
|
|
|
197
196
|
await this.addContentsToResponse(languageModelResponse, request);
|
|
198
197
|
request.response.complete();
|
|
199
198
|
if (this.defaultLogging) {
|
|
200
|
-
this.recordingService.recordResponse(
|
|
199
|
+
this.recordingService.recordResponse({
|
|
200
|
+
agentId: this.id,
|
|
201
|
+
sessionId: request.session.id,
|
|
202
|
+
timestamp: Date.now(),
|
|
203
|
+
requestId: request.response.requestId,
|
|
204
|
+
response: request.response.response.asString()
|
|
205
|
+
});
|
|
201
206
|
}
|
|
202
207
|
} catch (e) {
|
|
203
208
|
this.handleError(request, e);
|
|
@@ -317,7 +322,14 @@ export abstract class AbstractStreamParsingChatAgent extends AbstractChatAgent {
|
|
|
317
322
|
request.response.response.addContents(contents);
|
|
318
323
|
request.response.complete();
|
|
319
324
|
if (this.defaultLogging) {
|
|
320
|
-
this.recordingService.recordResponse(
|
|
325
|
+
this.recordingService.recordResponse({
|
|
326
|
+
agentId: this.id,
|
|
327
|
+
sessionId: request.session.id,
|
|
328
|
+
timestamp: Date.now(),
|
|
329
|
+
requestId: request.response.requestId,
|
|
330
|
+
response: request.response.response.asString()
|
|
331
|
+
|
|
332
|
+
});
|
|
321
333
|
}
|
|
322
334
|
return;
|
|
323
335
|
}
|
|
@@ -325,7 +337,13 @@ export abstract class AbstractStreamParsingChatAgent extends AbstractChatAgent {
|
|
|
325
337
|
await this.addStreamResponse(languageModelResponse, request);
|
|
326
338
|
request.response.complete();
|
|
327
339
|
if (this.defaultLogging) {
|
|
328
|
-
this.recordingService.recordResponse(
|
|
340
|
+
this.recordingService.recordResponse({
|
|
341
|
+
agentId: this.id,
|
|
342
|
+
sessionId: request.session.id,
|
|
343
|
+
timestamp: Date.now(),
|
|
344
|
+
requestId: request.response.requestId,
|
|
345
|
+
response: request.response.response.asString()
|
|
346
|
+
});
|
|
329
347
|
}
|
|
330
348
|
return;
|
|
331
349
|
}
|
|
@@ -36,9 +36,7 @@ import {
|
|
|
36
36
|
|
|
37
37
|
export const commandTemplate: PromptTemplate = {
|
|
38
38
|
id: 'command-system',
|
|
39
|
-
template:
|
|
40
|
-
https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
|
|
41
|
-
# System Prompt
|
|
39
|
+
template: `# System Prompt
|
|
42
40
|
|
|
43
41
|
You are a service that helps users find commands to execute in an IDE.
|
|
44
42
|
You reply with stringified JSON Objects that tell the user which command to execute and its arguments, if any.
|
|
@@ -23,13 +23,10 @@ import { ChatAgentService } from './chat-agent-service';
|
|
|
23
23
|
import { AbstractStreamParsingChatAgent, ChatAgent, SystemMessageDescription } from './chat-agents';
|
|
24
24
|
import { ChatRequestModelImpl, InformationalChatResponseContentImpl } from './chat-model';
|
|
25
25
|
import { generateUuid } from '@theia/core';
|
|
26
|
-
import { ChatHistoryEntry } from './chat-history-entry';
|
|
27
26
|
|
|
28
27
|
export const orchestratorTemplate: PromptTemplate = {
|
|
29
28
|
id: 'orchestrator-system',
|
|
30
|
-
template:
|
|
31
|
-
https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
|
|
32
|
-
# Instructions
|
|
29
|
+
template: `# Instructions
|
|
33
30
|
|
|
34
31
|
Your task is to identify which Chat Agent(s) should best reply a given user's message.
|
|
35
32
|
You consider all messages of the conversation to ensure consistency and avoid agent switches without a clear context change.
|
|
@@ -63,7 +60,7 @@ You must only use the \`id\` attribute of the agent, never the name.
|
|
|
63
60
|
`};
|
|
64
61
|
|
|
65
62
|
export const OrchestratorChatAgentId = 'Orchestrator';
|
|
66
|
-
const
|
|
63
|
+
const OrchestatorRequestIdKey = 'orchestatorRequestIdKey';
|
|
67
64
|
|
|
68
65
|
@injectable()
|
|
69
66
|
export class OrchestratorChatAgent extends AbstractStreamParsingChatAgent implements ChatAgent {
|
|
@@ -96,17 +93,16 @@ export class OrchestratorChatAgent extends AbstractStreamParsingChatAgent implem
|
|
|
96
93
|
override async invoke(request: ChatRequestModelImpl): Promise<void> {
|
|
97
94
|
request.response.addProgressMessage({ content: 'Determining the most appropriate agent', status: 'inProgress' });
|
|
98
95
|
// We generate a dedicated ID for recording the orchestrator request/response, as we will forward the original request to another agent
|
|
99
|
-
const
|
|
100
|
-
request.addData(
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
);
|
|
96
|
+
const orchestartorRequestId = generateUuid();
|
|
97
|
+
request.addData(OrchestatorRequestIdKey, orchestartorRequestId);
|
|
98
|
+
const userPrompt = request.request.text;
|
|
99
|
+
this.recordingService.recordRequest({
|
|
100
|
+
agentId: this.id,
|
|
101
|
+
sessionId: request.session.id,
|
|
102
|
+
timestamp: Date.now(),
|
|
103
|
+
requestId: orchestartorRequestId,
|
|
104
|
+
request: userPrompt,
|
|
105
|
+
});
|
|
110
106
|
return super.invoke(request);
|
|
111
107
|
}
|
|
112
108
|
|
|
@@ -119,11 +115,12 @@ export class OrchestratorChatAgent extends AbstractStreamParsingChatAgent implem
|
|
|
119
115
|
let agentIds: string[] = [];
|
|
120
116
|
const responseText = await getTextOfResponse(response);
|
|
121
117
|
// We use the previously generated, dedicated ID to log the orchestrator response before we forward the original request
|
|
122
|
-
const orchestratorRequestId = request.getDataByKey(
|
|
118
|
+
const orchestratorRequestId = request.getDataByKey(OrchestatorRequestIdKey);
|
|
123
119
|
if (typeof orchestratorRequestId === 'string') {
|
|
124
120
|
this.recordingService.recordResponse({
|
|
125
121
|
agentId: this.id,
|
|
126
122
|
sessionId: request.session.id,
|
|
123
|
+
timestamp: Date.now(),
|
|
127
124
|
requestId: orchestratorRequestId,
|
|
128
125
|
response: responseText,
|
|
129
126
|
});
|
|
@@ -23,9 +23,7 @@ import { AbstractStreamParsingChatAgent, ChatAgent, SystemMessageDescription } f
|
|
|
23
23
|
|
|
24
24
|
export const universalTemplate: PromptTemplate = {
|
|
25
25
|
id: 'universal-system',
|
|
26
|
-
template:
|
|
27
|
-
https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
|
|
28
|
-
# Instructions
|
|
26
|
+
template: `# Instructions
|
|
29
27
|
|
|
30
28
|
You are an AI assistant integrated into the Theia IDE, specifically designed to help software developers by
|
|
31
29
|
providing concise and accurate answers to programming-related questions. Your role is to enhance the
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { CommunicationRequestEntryParam, CommunicationResponseEntryParam } from '@theia/ai-core/lib/common/communication-recording-service';
|
|
2
|
-
import { ChatRequestModel } from './chat-model';
|
|
3
|
-
export declare namespace ChatHistoryEntry {
|
|
4
|
-
function fromRequest(agentId: string, request: ChatRequestModel, args?: Partial<CommunicationRequestEntryParam>): CommunicationRequestEntryParam;
|
|
5
|
-
function fromResponse(agentId: string, request: ChatRequestModel, args?: Partial<CommunicationResponseEntryParam>): CommunicationResponseEntryParam;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=chat-history-entry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-history-entry.d.ts","sourceRoot":"","sources":["../../src/common/chat-history-entry.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,8BAA8B,EAAE,+BAA+B,EAAE,MAAM,2DAA2D,CAAC;AAC5I,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,yBAAiB,gBAAgB,CAAC;IAC9B,SAAgB,WAAW,CACvB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,gBAAgB,EACzB,IAAI,GAAE,OAAO,CAAC,8BAA8B,CAAM,GACnD,8BAA8B,CAQhC;IACD,SAAgB,YAAY,CACxB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,gBAAgB,EACzB,IAAI,GAAE,OAAO,CAAC,+BAA+B,CAAM,GACpD,+BAA+B,CAQjC;CACJ"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2024 EclipseSource GmbH.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.ChatHistoryEntry = void 0;
|
|
19
|
-
var ChatHistoryEntry;
|
|
20
|
-
(function (ChatHistoryEntry) {
|
|
21
|
-
function fromRequest(agentId, request, args = {}) {
|
|
22
|
-
return {
|
|
23
|
-
agentId: agentId,
|
|
24
|
-
sessionId: request.session.id,
|
|
25
|
-
requestId: request.id,
|
|
26
|
-
request: request.request.text,
|
|
27
|
-
...args,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
ChatHistoryEntry.fromRequest = fromRequest;
|
|
31
|
-
function fromResponse(agentId, request, args = {}) {
|
|
32
|
-
return {
|
|
33
|
-
agentId: agentId,
|
|
34
|
-
sessionId: request.session.id,
|
|
35
|
-
requestId: request.id,
|
|
36
|
-
response: request.response.response.asString(),
|
|
37
|
-
...args,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
ChatHistoryEntry.fromResponse = fromResponse;
|
|
41
|
-
})(ChatHistoryEntry || (exports.ChatHistoryEntry = ChatHistoryEntry = {}));
|
|
42
|
-
//# sourceMappingURL=chat-history-entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-history-entry.js","sourceRoot":"","sources":["../../src/common/chat-history-entry.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAKhF,IAAiB,gBAAgB,CA2BhC;AA3BD,WAAiB,gBAAgB;IAC7B,SAAgB,WAAW,CACvB,OAAe,EACf,OAAyB,EACzB,OAAgD,EAAE;QAElD,OAAO;YACH,OAAO,EAAE,OAAO;YAChB,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE;YAC7B,SAAS,EAAE,OAAO,CAAC,EAAE;YACrB,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI;YAC7B,GAAG,IAAI;SACV,CAAC;IACN,CAAC;IAZe,4BAAW,cAY1B,CAAA;IACD,SAAgB,YAAY,CACxB,OAAe,EACf,OAAyB,EACzB,OAAiD,EAAE;QAEnD,OAAO;YACH,OAAO,EAAE,OAAO;YAChB,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE;YAC7B,SAAS,EAAE,OAAO,CAAC,EAAE;YACrB,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE;YAC9C,GAAG,IAAI;SACV,CAAC;IACN,CAAC;IAZe,6BAAY,eAY3B,CAAA;AACL,CAAC,EA3BgB,gBAAgB,gCAAhB,gBAAgB,QA2BhC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2024 EclipseSource GmbH.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import { CommunicationRequestEntryParam, CommunicationResponseEntryParam } from '@theia/ai-core/lib/common/communication-recording-service';
|
|
18
|
-
import { ChatRequestModel } from './chat-model';
|
|
19
|
-
|
|
20
|
-
export namespace ChatHistoryEntry {
|
|
21
|
-
export function fromRequest(
|
|
22
|
-
agentId: string,
|
|
23
|
-
request: ChatRequestModel,
|
|
24
|
-
args: Partial<CommunicationRequestEntryParam> = {}
|
|
25
|
-
): CommunicationRequestEntryParam {
|
|
26
|
-
return {
|
|
27
|
-
agentId: agentId,
|
|
28
|
-
sessionId: request.session.id,
|
|
29
|
-
requestId: request.id,
|
|
30
|
-
request: request.request.text,
|
|
31
|
-
...args,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
export function fromResponse(
|
|
35
|
-
agentId: string,
|
|
36
|
-
request: ChatRequestModel,
|
|
37
|
-
args: Partial<CommunicationResponseEntryParam> = {}
|
|
38
|
-
): CommunicationResponseEntryParam {
|
|
39
|
-
return {
|
|
40
|
-
agentId: agentId,
|
|
41
|
-
sessionId: request.session.id,
|
|
42
|
-
requestId: request.id,
|
|
43
|
-
response: request.response.response.asString(),
|
|
44
|
-
...args,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
}
|