Skip to content
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 Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions amico-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
[package]
name = "amico-core"
version = "1.1.0"
version = "1.2.0"
edition = "2024"
description = "The core Agent components of the Amico AI Agent Framework"
repository = "https://github.com/AIMOverse/amico"
license = "MIT OR Apache-2.0"

[features]
default = []
wasm = ["tokio_with_wasm"]

[dependencies]
serde = { workspace = true, features = ["derive"] }
thiserror = { workspace = true }
Expand All @@ -17,8 +21,10 @@ evenio = { workspace = true }

# Check: For WASM support, only `sync`, `macros`, `io-util`, `rt` and `time` features are supported
tokio = { workspace = true, features = ["rt", "sync"] }
tokio_with_wasm = { workspace = true, features = ["rt", "sync"] }
tokio_with_wasm = { workspace = true, features = ["rt", "sync"], optional = true }

[dev-dependencies]
tokio = { workspace = true, features = ["rt", "sync", "macros", "time"] }
tracing-subscriber = "0.3.19"
# Enable for tests
tokio_with_wasm = { workspace = true, features = ["rt", "sync"] }
2 changes: 2 additions & 0 deletions amico-core/src/agent.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use tokio::sync::mpsc::{Receiver, Sender, channel};

#[cfg(feature = "wasm")]
use tokio_with_wasm::alias as tokio;

use crate::{
Expand Down
2 changes: 2 additions & 0 deletions amico-core/src/traits/event_source.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use tokio::task::JoinHandle;

#[cfg(feature = "wasm")]
use tokio_with_wasm::alias as tokio;

use crate::types::AgentEvent;
Expand Down
2 changes: 2 additions & 0 deletions amico-core/tests/strategy_interaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ use amico_core::{
types::{AgentEvent, Chat, Interaction},
};
use tokio::{task::JoinHandle, time::sleep};

#[cfg(feature = "wasm")]
use tokio_with_wasm::alias as tokio;

struct InteractionSource;
Expand Down
4 changes: 2 additions & 2 deletions amico-hal/src/os/common/audio/control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub enum AudioRecordingError {
// We'll record to a temporary WAV file and then convert it to MP3 after recording
pub async fn record_blocking(filepath: &str) -> Result<(), AudioRecordingError> {
// Create a temporary WAV file path
let temp_wav_path = format!("{}.temp.wav", filepath);
let temp_wav_path = format!("{filepath}.temp.wav");

// Record to the temporary WAV file
record_to_wav(&temp_wav_path)?;
Expand Down Expand Up @@ -113,7 +113,7 @@ fn record_to_wav(filepath: &str) -> Result<(), AudioRecordingError> {
let samples = Arc::new(Mutex::new(Vec::<f32>::new()));
let samples_clone = Arc::clone(&samples);

let err_fn = |err| eprintln!("Stream error: {}", err);
let err_fn = |err| eprintln!("Stream error: {err}");

let stream = device
.build_input_stream(
Expand Down
Loading