Skip to content

Commit f187010

Browse files
Merge pull request #116 from SmythOS/dev
Dev merge
2 parents 7cf6fc7 + ceb9575 commit f187010

File tree

28 files changed

+1133
-61
lines changed

28 files changed

+1133
-61
lines changed

examples/01-agent-code-skill/04.1-chat-planner-coder.ts

Lines changed: 611 additions & 0 deletions
Large diffs are not rendered by default.

examples/03-agent-workflow-components/02-tavily-websearch.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ async function main() {
4444

4545
//#endregion
4646

47-
console.log(agent.data);
47+
//console.log(agent.data);
4848

4949
//const result = await agent.prompt('Hello, what is the price of bitcoin in USD');
5050

51-
const result = await agent.call('MarketData', { coin_id: 'bitcoin' });
51+
const result = await agent.call('WebSearch', { userQuery: 'bitcoin' });
5252

5353
console.log(result);
5454
}

examples/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"@smythos/sdk": "workspace:*",
1414
"@smythos/sre": "workspace:*",
1515
"chalk": "^5.4.1",
16-
"dotenv": "^16.5.0"
16+
"dotenv": "^16.5.0",
17+
"tokenloom": "^1.0.7"
1718
},
1819
"devDependencies": {
1920
"@types/node": "^20.19.0",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sre",
3-
"version": "0.1.9",
3+
"version": "0.2.0",
44
"description": "",
55
"author": "Alaa-eddine KADDOURI",
66
"license": "MIT",

packages/core/CHANGELOG

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to the SmythOS CORE Runtime Engine will be documented in thi
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [v1.5.60]
9+
10+
### Features
11+
12+
- Fixed memory leak in Agent context manager
13+
- Optimized performances and resolved a rare case causing CPU usage spikes
14+
815
## [v1.5.50]
916

1017
### Features

packages/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@smythos/sre",
3-
"version": "1.5.56",
3+
"version": "1.5.60",
44
"description": "Smyth Runtime Environment",
55
"author": "Alaa-eddine KADDOURI",
66
"license": "MIT",
@@ -65,7 +65,7 @@
6565
"@google/genai": "^1.10.0",
6666
"@google/generative-ai": "^0.14.1",
6767
"@huggingface/inference": "^2.8.0",
68-
"@modelcontextprotocol/sdk": "^1.10.1",
68+
"@modelcontextprotocol/sdk": "^1.17.4",
6969
"@pinecone-database/pinecone": "^3.0.0",
7070
"@runware/sdk-js": "^1.1.36",
7171
"@smithy/smithy-client": "^4.4.3",

packages/core/src/Components/ScrapflyWebScrape.class.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,30 @@ import { getCredentials } from '../subsystems/Security/Credentials.helper';
99
// const CREDITS_PER_URL = 0.2;
1010

1111
export class ScrapflyWebScrape extends Component {
12+
protected schema = {
13+
name: 'ScrapflyWebScrape',
14+
description: 'Use this component to scrape web pages',
15+
inputs: {
16+
URLs: {
17+
type: 'Array',
18+
description: 'The URLs to scrape',
19+
default: true,
20+
},
21+
},
22+
outputs: {
23+
Results: {
24+
type: 'Array',
25+
description: 'The scraped results',
26+
default: true,
27+
},
28+
FailedURLs: {
29+
type: 'Array',
30+
description: 'The URLs that failed to scrape',
31+
default: true,
32+
},
33+
},
34+
};
35+
1236
protected configSchema = Joi.object({
1337
// includeImages: Joi.boolean().default(false).label('Include Image Results'),
1438
antiScrapingProtection: Joi.boolean().default(false).label('Enable Anti-Scraping Protection'),

packages/core/src/Components/TavilyWebSearch.class.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ export class TavilyWebSearch extends Component {
8282
return { ...Output, _error, _debug: logger.output };
8383
} catch (err: any) {
8484
const _error = err?.message || err?.response?.data || err.toString();
85-
logger.error(` Error scraping web \n${JSON.stringify(_error)}\n`);
85+
86+
if (err?.status === 401) {
87+
logger.error(`Tavily Web Search Auth failed, make sure that you have the vault key "tavily" is present and valid`);
88+
} else {
89+
logger.error(` Error scraping web \n${JSON.stringify(_error)}\n`);
90+
}
8691
return { Output: undefined, _error, _debug: logger.output };
8792
}
8893
}

packages/core/src/Core/SmythRuntime.class.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { Logger } from '../helpers/Log.helper';
55
import { ConnectorService } from './ConnectorsService';
66
import { SystemEvents } from './SystemEvents';
77
import { findSmythPath } from '../helpers/Sysconfig.helper';
8+
import pkg from '../../package.json';
89

910
const logger = Logger('SRE');
1011

@@ -18,6 +19,10 @@ export class SmythRuntime {
1819
private _readyPromise: Promise<boolean>;
1920
private _readyResolve: (value: boolean) => void;
2021

22+
public get version() {
23+
return pkg.version;
24+
}
25+
2126
private defaultConfig: SREConfig = {
2227
Vault: {
2328
Connector: 'JSONFileVault',
@@ -88,6 +93,7 @@ export class SmythRuntime {
8893
private _initialized = false;
8994

9095
public init(_config?: SREConfig): SmythRuntime {
96+
logger.info(`SRE v${this.version} initializing...`);
9197
if (!_config || JSON.stringify(_config) === '{}') {
9298
this._smythDir = findSmythPath();
9399
logger.info('.smyth directory found in:', this._smythDir);

packages/core/src/helpers/Conversation.helper.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,11 @@ export class Conversation extends EventEmitter {
342342
this.emit(TLLMEvent.Thinking, thinking);
343343
});
344344

345+
eventEmitter.on(TLLMEvent.Data, (data) => {
346+
if (this.stop) return;
347+
this.emit(TLLMEvent.Data, data);
348+
});
349+
345350
eventEmitter.on(TLLMEvent.Content, (content) => {
346351
if (this.stop) return;
347352
// if (toolHeaders['x-passthrough']) {

0 commit comments

Comments
 (0)