Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- fix: failing tests bc wrong tool id #53

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/shinkai-tool-aave-loan-requester/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ test('run definition', async () => {
assetSymbol: 'ETH',
});
console.log(run_result);
}, 25000);
}, 45000);
4 changes: 0 additions & 4 deletions apps/shinkai-tool-download-page/package.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable */
export default {
displayName: '@shinkai_protocol/shinkai-tool-download-page',
displayName: '@shinkai_protocol/shinkai-tool-download-pages',
preset: '../../jest.preset.js',
coverageDirectory: '../../coverage/apps/shinkai-tool-download-page'
coverageDirectory: '../../coverage/apps/shinkai-tool-download-pages'
};
4 changes: 4 additions & 0 deletions apps/shinkai-tool-download-pages/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "@shinkai_protocol/shinkai-tool-download-pages",
"type": "commonjs"
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@shinkai_protocol/shinkai-tool-download-page",
"name": "@shinkai_protocol/shinkai-tool-download-pages",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/shinkai-tool-download-page/src",
"sourceRoot": "apps/shinkai-tool-download-pages/src",
"projectType": "library",
"tags": ["tool"],
"targets": {
"build": {
"executor": "nx:run-commands",
"defaultConfiguration": "production",
"options": {
"command": "npx ts-node scripts/tool-bundler.ts --entry ./apps/shinkai-tool-download-page/src/index.ts --outputFolder ./dist/apps/shinkai-tool-download-page"
"command": "npx ts-node scripts/tool-bundler.ts --entry ./apps/shinkai-tool-download-pages/src/index.ts --outputFolder ./dist/apps/shinkai-tool-download-pages"
},
"configurations": {
"development": {},
Expand All @@ -21,8 +21,8 @@
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"apps/shinkai-tool-download-page/**/*.ts",
"apps/shinkai-tool-download-page/package.json"
"apps/shinkai-tool-download-pages/**/*.ts",
"apps/shinkai-tool-download-pages/package.json"
]
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Tool } from '../src/index';
import { Tool } from './index';
test('exists definition', () => {
const tool = new Tool({});
const definition = tool.getDefinition();
Expand Down
2 changes: 1 addition & 1 deletion apps/shinkai-tool-perplexity/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ test('run', async () => {
});
const run_result = await tool.run({ query: 'What is the meaning of life?' });
expect(run_result.data.response).toEqual(expect.any(String));
}, 15000);
}, 30000);
4 changes: 2 additions & 2 deletions libs/shinkai-tools-runner/src/built_in_tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ lazy_static! {
)),
);
m.insert(
"shinkai-tool-download-page",
"shinkai-tool-download-pages",
&*Box::leak(Box::new(
serde_json::from_str::<ToolDefinition>(include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/tools/shinkai-tool-download-page/definition.json"
"/tools/shinkai-tool-download-pages/definition.json"
)))
.unwrap(),
)),
Expand Down
4 changes: 2 additions & 2 deletions libs/shinkai-tools-runner/src/lib.test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ async fn shinkai_tool_web3_eth_uniswap() {

#[tokio::test]
async fn shinkai_tool_download_page() {
let tool_definition = get_tool("shinkai-tool-download-page").unwrap();
let tool_definition = get_tool("shinkai-tool-download-pages").unwrap();
let tool = Tool::new(
tool_definition.code.clone().unwrap(),
serde_json::Value::Null,
Expand Down Expand Up @@ -181,7 +181,7 @@ async fn shinkai_tool_download_page_stack_overflow() {
let managed_runtime =
tokio::runtime::Runtime::new().expect("Failed to create Tokio runtime");
managed_runtime.block_on(async {
let tool_definition = get_tool("shinkai-tool-download-page").unwrap();
let tool_definition = get_tool("shinkai-tool-download-pages").unwrap();
let tool = Tool::new(
tool_definition.code.clone().unwrap(),
serde_json::Value::Null,
Expand Down
Loading