@ixo/common 1.1.32 → 1.1.33
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/.turbo/turbo-build.log +1 -1
- package/dist/ai/models/openai.d.ts +16 -0
- package/dist/ai/models/openai.d.ts.map +1 -1
- package/dist/ai/models/openai.js +26 -0
- package/dist/ai/models/openai.js.map +1 -1
- package/dist/ai/nodes/generic-chat/generic-chat.node.d.ts +1 -1
- package/dist/ai/semantic-router-factory/create-semantic-router.d.ts +1 -2
- package/dist/ai/semantic-router-factory/create-semantic-router.d.ts.map +1 -1
- package/dist/ai/semantic-router-factory/create-semantic-router.js +2 -3
- package/dist/ai/semantic-router-factory/create-semantic-router.js.map +1 -1
- package/dist/ai/tools/ask-ixo-guru/ask-ixo-guru.d.ts +1 -1
- package/dist/ai/tools/ask-ixo-guru/ask-ixo-guru.d.ts.map +1 -1
- package/dist/ai/tools/parser-action-tool.d.ts +1 -1
- package/dist/ai/tools/parser-action-tool.d.ts.map +1 -1
- package/dist/ai/tools/parser-browser-tool.d.ts +1 -1
- package/dist/ai/tools/parser-browser-tool.d.ts.map +1 -1
- package/dist/ai/tools/scrape-web-page.d.ts +1 -1
- package/dist/ai/tools/scrape-web-page.d.ts.map +1 -1
- package/dist/ai/tools/web-search-tool.d.ts +1 -1
- package/dist/ai/tools/web-search-tool.d.ts.map +1 -1
- package/dist/ai/utils/transformGraphStateMessageToListMessageResponse.d.ts.map +1 -1
- package/dist/ai/utils/transformGraphStateMessageToListMessageResponse.js +1 -3
- package/dist/ai/utils/transformGraphStateMessageToListMessageResponse.js.map +1 -1
- package/dist/services/env/env.service.js.map +1 -1
- package/dist/services/session-manager/session-manager.service.d.ts.map +1 -1
- package/dist/services/session-manager/session-manager.service.js +24 -15
- package/dist/services/session-manager/session-manager.service.js.map +1 -1
- package/package.json +15 -16
- package/src/ai/models/openai.ts +31 -0
- package/src/ai/semantic-router-factory/create-semantic-router.test.ts +0 -3
- package/src/ai/semantic-router-factory/create-semantic-router.ts +2 -7
- package/src/ai/utils/transformGraphStateMessageToListMessageResponse.ts +1 -3
- package/src/services/env/env.service.ts +1 -1
- package/src/services/session-manager/session-manager.service.ts +32 -15
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -2,7 +2,12 @@ import { Logger } from '@ixo/logger';
|
|
|
2
2
|
import { MatrixManager } from '@ixo/matrix';
|
|
3
3
|
import { getMatrixHomeServerCroppedForDid } from '@ixo/oracles-chain-client';
|
|
4
4
|
import { type Database } from 'better-sqlite3';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
getChatOpenAiModel,
|
|
7
|
+
getLLMProvider,
|
|
8
|
+
getOpenRouterChatModel,
|
|
9
|
+
getProviderConfig,
|
|
10
|
+
} from '../../ai/index.js';
|
|
6
11
|
import { type MemoryEngineService } from '../memory-engine/memory-engine.service.js';
|
|
7
12
|
import { type UserContextData } from '../memory-engine/types.js';
|
|
8
13
|
import {
|
|
@@ -41,15 +46,25 @@ export class SessionManagerService {
|
|
|
41
46
|
if (messages.length === 0) {
|
|
42
47
|
return 'Untitled';
|
|
43
48
|
}
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
const provider = getLLMProvider();
|
|
50
|
+
const config = getProviderConfig();
|
|
51
|
+
|
|
52
|
+
const llm =
|
|
53
|
+
provider === 'openrouter'
|
|
54
|
+
? getOpenRouterChatModel({
|
|
55
|
+
model: 'meta-llama/llama-3.1-8b-instruct',
|
|
56
|
+
temperature: 0.3,
|
|
57
|
+
timeout: 60_000,
|
|
58
|
+
})
|
|
59
|
+
: getChatOpenAiModel({
|
|
60
|
+
model: 'meta-llama/Meta-Llama-3.1-8B-Instruct',
|
|
61
|
+
temperature: 0.3,
|
|
62
|
+
apiKey: config.apiKey,
|
|
63
|
+
timeout: 60_000,
|
|
64
|
+
configuration: {
|
|
65
|
+
baseURL: config.baseURL,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
53
68
|
const response = await llm.invoke(
|
|
54
69
|
`Based on this messages messages, Add a title for this convo and only based on the messages? MAKE SURE TO ONLY RESPOND WITH THE TITLE.
|
|
55
70
|
|
|
@@ -374,11 +389,13 @@ ___________________________________________________________
|
|
|
374
389
|
if (!roomId) {
|
|
375
390
|
throw new Error('Room ID not found');
|
|
376
391
|
}
|
|
377
|
-
const eventId =
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
392
|
+
const eventId =
|
|
393
|
+
overrideEventId ??
|
|
394
|
+
(await this.matrixManger.sendMessage({
|
|
395
|
+
message: 'New Conversation Started',
|
|
396
|
+
roomId,
|
|
397
|
+
isOracleAdmin: true,
|
|
398
|
+
}));
|
|
382
399
|
|
|
383
400
|
// Gather user context from Memory Engine
|
|
384
401
|
let userContext: UserContextData | undefined;
|