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: bump to shinkai-node v0.9.2 to implement uv #559

Merged
merged 2 commits into from
Dec 11, 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
4 changes: 2 additions & 2 deletions .github/workflows/pr-ci-healchecks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
- name: Download side binaries
env:
ARCH: x86_64-unknown-linux-gnu
SHINKAI_NODE_VERSION: v0.9.0
OLLAMA_VERSION: v0.4.7
SHINKAI_NODE_VERSION: v0.9.2
OLLAMA_VERSION: v0.5.1
run: |
npx ts-node ./ci-scripts/download-side-binaries.ts

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ jobs:
- name: Download side binaries
env:
ARCH: ${{ matrix.arch }}
SHINKAI_NODE_VERSION: v0.9.0
OLLAMA_VERSION: v0.4.7
SHINKAI_NODE_VERSION: v0.9.2
OLLAMA_VERSION: v0.5.1
run: |
npx ts-node ./ci-scripts/download-side-binaries.ts

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ jobs:
- name: Download side binaries
env:
ARCH: ${{ matrix.arch }}
SHINKAI_NODE_VERSION: v0.9.0
OLLAMA_VERSION: v0.4.7
SHINKAI_NODE_VERSION: v0.9.2
OLLAMA_VERSION: v0.5.1
run: |
npx ts-node ./ci-scripts/download-side-binaries.ts

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,23 @@ $ git clone https://github.com/dcSpark/shinkai-apps
#### Macos
```
ARCH="aarch64-apple-darwin" \
OLLAMA_VERSION="v0.4.7" \
SHINKAI_NODE_VERSION="v0.9.0" \
OLLAMA_VERSION="v0.5.1" \
SHINKAI_NODE_VERSION="v0.9.2" \
npx ts-node ./ci-scripts/download-side-binaries.ts
```

#### Linux
```
ARCH="x86_64-unknown-linux-gnu" \
OLLAMA_VERSION="v0.4.7"\
SHINKAI_NODE_VERSION="v0.9.0" \
OLLAMA_VERSION="v0.5.1"\
SHINKAI_NODE_VERSION="v0.9.2" \
npx ts-node ./ci-scripts/download-side-binaries.ts
```

#### Windows
```
$ENV:OLLAMA_VERSION="v0.4.7"
$ENV:SHINKAI_NODE_VERSION="v0.9.0"
$ENV:OLLAMA_VERSION="v0.5.1"
$ENV:SHINKAI_NODE_VERSION="v0.9.2"
$ENV:ARCH="x86_64-pc-windows-msvc"
npx ts-node ./ci-scripts/download-side-binaries.ts
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ pub struct ShinkaiNodeOptions {
pub default_embedding_model: Option<String>,
pub supported_embedding_models: Option<String>,
pub shinkai_tools_runner_deno_binary_path: Option<String>,
pub shinkai_tools_runner_uv_binary_path: Option<String>,
pub pdfium_dynamic_lib_path: Option<String>,
}

Expand Down Expand Up @@ -195,6 +196,12 @@ impl ShinkaiNodeOptions {
.or(base_options.shinkai_tools_runner_deno_binary_path)
.unwrap_or_default(),
),
shinkai_tools_runner_uv_binary_path: Some(
options
.shinkai_tools_runner_uv_binary_path
.or(base_options.shinkai_tools_runner_uv_binary_path)
.unwrap_or_default(),
),
pdfium_dynamic_lib_path: Some(match options.pdfium_dynamic_lib_path {
Some(ref path) if !path.is_empty() => path.clone(),
_ => base_options.pdfium_dynamic_lib_path.unwrap_or_default(),
Expand Down Expand Up @@ -223,6 +230,18 @@ impl Default for ShinkaiNodeOptions {
.to_string_lossy()
.to_string();

let shinkai_tools_runner_uv_binary_path = std::env::current_exe()
.unwrap()
.parent()
.unwrap()
.join(if cfg!(target_os = "windows") {
"uv.exe"
} else {
"uv"
})
.to_string_lossy()
.to_string();

ShinkaiNodeOptions {
node_api_ip: Some("127.0.0.1".to_string()),
node_api_port: Some("9550".to_string()),
Expand All @@ -246,6 +265,7 @@ impl Default for ShinkaiNodeOptions {
default_embedding_model: Some("snowflake-arctic-embed:xs".to_string()),
supported_embedding_models: Some("snowflake-arctic-embed:xs".to_string()),
shinkai_tools_runner_deno_binary_path: Some(shinkai_tools_runner_deno_binary_path),
shinkai_tools_runner_uv_binary_path: Some(shinkai_tools_runner_uv_binary_path),
pdfium_dynamic_lib_path: None,
}
}
Expand Down
1 change: 1 addition & 0 deletions apps/shinkai-desktop/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"externalBin": [
"external-binaries/shinkai-node/shinkai-node",
"external-binaries/shinkai-node/shinkai-tools-runner-resources/deno",
"external-binaries/shinkai-node/shinkai-tools-runner-resources/uv",
"external-binaries/ollama/ollama"
],
"icon": [
Expand Down
13 changes: 12 additions & 1 deletion ci-scripts/download-side-binaries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ const downloadShinkaiNodeBinary = async (arch: Arch, version: string) => {
arch,
`./apps/shinkai-desktop/src-tauri/external-binaries/shinkai-node/shinkai-tools-runner-resources/deno`,
);
const shinkaiToolsRunnerUvBinaryPath = asBinaryName(
arch,
`./apps/shinkai-desktop/src-tauri/external-binaries/shinkai-node/shinkai-tools-runner-resources/uv`,
);
await rename(
shinkaiNodeBinaryPath,
asSidecarName(arch, shinkaiNodeBinaryPath),
Expand All @@ -113,9 +117,16 @@ const downloadShinkaiNodeBinary = async (arch: Arch, version: string) => {
shinkaiToolsRunnerDenoBinaryPath,
asSidecarName(arch, shinkaiToolsRunnerDenoBinaryPath),
);
await rename(
shinkaiToolsRunnerUvBinaryPath,
asSidecarName(arch, shinkaiToolsRunnerUvBinaryPath),
);

await addExecPermissions(asSidecarName(arch, shinkaiNodeBinaryPath));
await addExecPermissions(asSidecarName(arch, shinkaiToolsRunnerDenoBinaryPath));
await addExecPermissions(
asSidecarName(arch, shinkaiToolsRunnerDenoBinaryPath),
);
await addExecPermissions(asSidecarName(arch, shinkaiToolsRunnerUvBinaryPath));
};

const downloadOllamaAarch64AppleDarwin = async (version: string) => {
Expand Down