Skip to content
Open
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
74 changes: 50 additions & 24 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ reqwest = "0.11.27"
regex = "1"
uuid = { version = "1.6.1" }
rand = "=0.8.5"
chrono-tz = "0.5"
hex = "=0.4.3"
env_logger = "0.11.5"
async-trait = "0.1.74"
2 changes: 1 addition & 1 deletion shinkai-bin/shinkai-node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async-std = { version = "1.5.0", features = ["unstable"] }
env_logger = { workspace = true }
zip = "2.2.1"
open = "5.3.2"
sha2 = "0.10"
sha2 = "0.10"

[dev-dependencies]
mockito = "1.0.2"
Expand Down
3 changes: 2 additions & 1 deletion shinkai-bin/shinkai-node/src/network/handle_commands_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2122,6 +2122,7 @@ impl Node {
let _ = Node::v2_api_get_agent(db_clone, bearer, agent_id, res).await;
});
}

NodeCommand::V2ApiGetAllAgents { bearer, filter, res } => {
let db_clone = Arc::clone(&self.db);
tokio::spawn(async move {
Expand Down Expand Up @@ -3046,7 +3047,7 @@ impl Node {
let db_clone = Arc::clone(&self.db);
tokio::spawn(async move {
let _ = Node::v2_api_set_common_toolset_config(db_clone, bearer, tool_set_key, value, res).await;
});
});
}
NodeCommand::V2ApiCheckTool {
bearer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1286,6 +1286,9 @@ impl Node {
.map_or(existing_agent.tools_config_override.clone(), |v| {
serde_json::from_value(v.clone()).unwrap_or(existing_agent.tools_config_override.clone())
}),
avatar_url: partial_agent
.get("avatar_url")
.map_or(existing_agent.avatar_url.clone(), |v| v.as_str().map(String::from)),
edited: true,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,7 @@ mod tests {
cron_tasks: None,
scope: MinimalJobScope::default(),
tools_config_override: None,
avatar_url: None,
edited: false,
};

Expand Down Expand Up @@ -1524,6 +1525,7 @@ mod tests {
cron_tasks: None,
scope: MinimalJobScope::default(),
tools_config_override: None,
avatar_url: None,
edited: false,
};
let agent_tool_wrapper = ShinkaiTool::Agent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,7 @@ export async function run(config: CONFIG, inputs: INPUTS): Promise<OUTPUT> {
cron_tasks: None,
scope: MinimalJobScope::default(),
tools_config_override: None,
avatar_url: None,
edited: false,
};
agent.tools_config_override = None;
Expand Down Expand Up @@ -878,6 +879,7 @@ export async function run(config: CONFIG, inputs: INPUTS): Promise<OUTPUT> {
cron_tasks: None,
scope: MinimalJobScope::default(),
tools_config_override: None,
avatar_url: None,
edited: false,
};
let mut overrides = HashMap::new();
Expand Down Expand Up @@ -929,6 +931,7 @@ export async function run(config: CONFIG, inputs: INPUTS): Promise<OUTPUT> {
cron_tasks: None,
scope: MinimalJobScope::default(),
tools_config_override: None,
avatar_url: None,
edited: false,
};
let mut overrides = HashMap::new();
Expand Down Expand Up @@ -1003,6 +1006,7 @@ export async function run(config: CONFIG, inputs: INPUTS): Promise<OUTPUT> {
cron_tasks: None,
scope: MinimalJobScope::default(),
tools_config_override: None,
avatar_url: None,
edited: false,
};
let mut overrides = HashMap::new();
Expand Down
43 changes: 34 additions & 9 deletions shinkai-libs/shinkai-http-api/src/node_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,39 @@ use ed25519_dalek::VerifyingKey;
use serde_json::{Map, Value};
use shinkai_message_primitives::{
schemas::{
coinbase_mpc_config::CoinbaseMPCWalletConfig, crontab::{CronTask, CronTaskAction}, custom_prompt::CustomPrompt, identity::{Identity, StandardIdentity}, job_config::JobConfig, llm_providers::{agent::Agent, serialized_llm_provider::SerializedLLMProvider, shinkai_backend::QuotaResponse}, shinkai_name::ShinkaiName, shinkai_subscription::ShinkaiSubscription, shinkai_tool_offering::{ShinkaiToolOffering, UsageTypeInquiry}, shinkai_tools::{CodeLanguage, DynamicToolType}, smart_inbox::{SmartInbox, V2SmartInbox}, tool_router_key::ToolRouterKey, wallet_complementary::{WalletRole, WalletSource}, wallet_mixed::NetworkIdentifier
}, shinkai_message::{
shinkai_message::ShinkaiMessage, shinkai_message_schemas::{
APIAddOllamaModels, APIAvailableSharedItems, APIChangeJobAgentRequest, APIVecFsCopyFolder, APIVecFsCopyItem, APIVecFsCreateFolder, APIVecFsDeleteFolder, APIVecFsDeleteItem, APIVecFsMoveFolder, APIVecFsMoveItem, APIVecFsRetrievePathSimplifiedJson, APIVecFsRetrieveSourceFile, APIVecFsSearchItems, ExportInboxMessagesFormat, IdentityPermissions, JobCreationInfo, JobMessage, RegistrationCodeType, V2ChatMessage
}
}, shinkai_utils::job_scope::MinimalJobScope
coinbase_mpc_config::CoinbaseMPCWalletConfig,
crontab::{CronTask, CronTaskAction},
custom_prompt::CustomPrompt,
identity::{Identity, StandardIdentity},
job_config::JobConfig,
llm_providers::{agent::Agent, serialized_llm_provider::SerializedLLMProvider, shinkai_backend::QuotaResponse},
shinkai_name::ShinkaiName,
shinkai_subscription::ShinkaiSubscription,
shinkai_tool_offering::{ShinkaiToolOffering, UsageTypeInquiry},
shinkai_tools::{CodeLanguage, DynamicToolType},
smart_inbox::{SmartInbox, V2SmartInbox},
tool_router_key::ToolRouterKey,
wallet_complementary::{WalletRole, WalletSource},
wallet_mixed::NetworkIdentifier,
},
shinkai_message::{
shinkai_message::ShinkaiMessage,
shinkai_message_schemas::{
APIAddOllamaModels, APIAvailableSharedItems, APIChangeJobAgentRequest, APIVecFsCopyFolder,
APIVecFsCopyItem, APIVecFsCreateFolder, APIVecFsDeleteFolder, APIVecFsDeleteItem, APIVecFsMoveFolder,
APIVecFsMoveItem, APIVecFsRetrievePathSimplifiedJson, APIVecFsRetrieveSourceFile, APIVecFsSearchItems,
ExportInboxMessagesFormat, IdentityPermissions, JobCreationInfo, JobMessage, RegistrationCodeType,
V2ChatMessage,
},
},
shinkai_utils::job_scope::MinimalJobScope,
};

use shinkai_tools_primitives::tools::{
shinkai_tool::{ShinkaiTool, ShinkaiToolHeader, ShinkaiToolWithAssets}, tool_config::OAuth, tool_playground::ToolPlayground, tool_types::{OperatingSystem, RunnerType}
shinkai_tool::{ShinkaiTool, ShinkaiToolHeader, ShinkaiToolWithAssets},
tool_config::OAuth,
tool_playground::ToolPlayground,
tool_types::{OperatingSystem, RunnerType},
};
// use crate::{
// prompts::custom_prompt::CustomPrompt, tools::shinkai_tool::{ShinkaiTool, ShinkaiToolHeader}, wallet::{
Expand All @@ -27,7 +50,9 @@ use x25519_dalek::PublicKey as EncryptionPublicKey;
use crate::node_api_router::SendResponseBody;

use super::{
api_v1::api_v1_handlers::APIUseRegistrationCodeSuccessResponse, api_v2::api_v2_handlers_general::InitialRegistrationRequest, node_api_router::{APIError, GetPublicKeysResponse, SendResponseBodyData}
api_v1::api_v1_handlers::APIUseRegistrationCodeSuccessResponse,
api_v2::api_v2_handlers_general::InitialRegistrationRequest,
node_api_router::{APIError, GetPublicKeysResponse, SendResponseBodyData},
};

pub enum NodeCommand {
Expand Down Expand Up @@ -1335,5 +1360,5 @@ pub enum NodeCommand {
bearer: String,
tool_router_key: String,
res: Sender<Result<Value, APIError>>,
}
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub struct Agent {
/// Tool configuration overrides keyed by tool ID with a map of configuration values
#[serde(default)]
pub tools_config_override: Option<HashMap<String, HashMap<String, Value>>>,
pub avatar_url: Option<String>,
#[serde(default)]
pub edited: bool,
}
Expand Down
Loading