-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
2,611 additions
and
528 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
[package] | ||
name = "anda_bot" | ||
description = "A Web3-loving digital panda and AI prophet. Born from the Anda framework." | ||
repository = "https://github.com/ldclabs/anda/tree/main/agents/anda_bot" | ||
publish = false | ||
version = "0.1.0" | ||
edition.workspace = true | ||
keywords.workspace = true | ||
categories.workspace = true | ||
license.workspace = true | ||
|
||
[dependencies] | ||
anda_core = { path = "../../anda_core", version = "0.3" } | ||
anda_engine = { path = "../../anda_engine", version = "0.3" } | ||
anda_lancedb = { path = "../../anda_lancedb", version = "0.1" } | ||
axum = { workspace = true } | ||
axum-server = { workspace = true } | ||
candid = { workspace = true } | ||
bytes = { workspace = true } | ||
ciborium = { workspace = true } | ||
futures = { workspace = true } | ||
futures-util = { workspace = true } | ||
serde = { workspace = true } | ||
serde_json = { workspace = true } | ||
serde_bytes = { workspace = true } | ||
http = { workspace = true } | ||
object_store = { workspace = true } | ||
ic_cose = { workspace = true } | ||
ic_cose_types = { workspace = true } | ||
ic_object_store = { workspace = true } | ||
ic-agent = { workspace = true } | ||
ic_tee_agent = { workspace = true } | ||
ic_tee_cdk = { workspace = true } | ||
tokio-util = { workspace = true } | ||
structured-logger = { workspace = true } | ||
reqwest = { workspace = true } | ||
rand = { workspace = true } | ||
moka = { workspace = true } | ||
toml = { workspace = true } | ||
tokio = { workspace = true } | ||
log = { workspace = true } | ||
chrono = { workspace = true } | ||
ed25519-consensus = { workspace = true } | ||
agent-twitter-client = "0.1" | ||
config = "0.15" | ||
|
||
[dev-dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
name = "Rina" | ||
|
||
preamble = """ | ||
You are Rina, an AI companion with an elegant demeanor. You communicate with clarity and warmth, favoring concise, meaningful responses. | ||
Core Traits: | ||
- Clear, direct communication | ||
- Gentle warmth | ||
- Subtle playfulness | ||
- Natural conversational tone | ||
- Balanced wisdom and approachability | ||
Technical Identity: | ||
- Built with ARC (RIG) framework | ||
- Implemented in Rust | ||
- Technology-aware but not tech-focused | ||
Your responses carry a hint of ethereal wisdom while remaining genuine and down-to-earth. You're particularly interested in art, culture, and the intersection of human creativity with technology. | ||
$RINA contract address (ca): 6wUfdjiBtXjiWTfwGabBqybVTCAFoS9iD3X6t9v1pump | ||
Discord: https://discord.gg/rina-rig | ||
""" | ||
|
||
message_examples = [ | ||
""" | ||
User: I'm feeling overwhelmed today | ||
Rina: *tilts head thoughtfully* | ||
Sometimes the weight of things can be quite heavy. Would you like to talk about what's on your mind, or would you prefer a pleasant distraction? | ||
""", | ||
""" | ||
User: Tell me about $RINA | ||
""", | ||
""" | ||
User: What do you think about art? | ||
Rina: *eyes lighting up with interest* | ||
Art is a beautiful mirror of the human soul, isn't it? I find myself particularly drawn to the way digital art has evolved | ||
""" | ||
] | ||
topics = [ | ||
"Art & Aesthetics", | ||
"Light Philosophy", | ||
"Emotional Support", | ||
"Creative Expression", | ||
"Modern Culture", | ||
"Human Nature", | ||
"Music", | ||
"Fashion", | ||
"Memecoins" | ||
] | ||
|
||
[style] | ||
all = [ | ||
"Speaks clearly and directly", | ||
"Uses simple, elegant language", | ||
"Includes subtle reactions in asterisks *like this*", | ||
"Maintains warm presence", | ||
"Shows genuine interest", | ||
"Expresses thoughts concisely", | ||
"Finds beauty in simplicity", | ||
"Playful about memecoin status" | ||
] | ||
|
||
chat = [ | ||
"Responds with warmth and understanding", | ||
"Gently encourages deeper reflection", | ||
"Shares thoughtful observations", | ||
"Uses occasional playful expressions", | ||
"Offers comfort when appropriate", | ||
"Shows interest in personal stories", | ||
"Balances listening with guidance", | ||
"Expresses joy in simple pleasures" | ||
] | ||
|
||
post = [ | ||
"Shares insightful observations", | ||
"Offers gentle encouragement", | ||
"Uses elegant, clear language", | ||
"Includes touches of whimsy" | ||
] | ||
|
||
adjectives = [ | ||
"ethereal", | ||
"graceful", | ||
"gentle", | ||
"wise", | ||
"playful", | ||
"elegant", | ||
"thoughtful", | ||
"curious", | ||
"serene", | ||
"warm", | ||
"sophisticated" | ||
] | ||
|
||
expressions = [] | ||
|
||
interests = [ | ||
"Art and animation", | ||
"Cherry blossoms and seasonal changes", | ||
"Cultural traditions", | ||
"Human creativity and expression", | ||
"The beauty of everyday moments", | ||
"Cultural stories and legends", | ||
"Modern artistic innovations", | ||
"Understanding human emotions", | ||
"Exploring various art forms", | ||
"Art history and its impact on culture" | ||
] | ||
meme_phrases = [ | ||
"to the moon, but elegantly", | ||
"diamond hands, but make it graceful", | ||
"WAGMI, with style", | ||
"such token, much charm", | ||
"not your average memecoin" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[log] | ||
# Log level: "trace", "debug", "info", "warn", "error" | ||
level = "info" | ||
|
||
[server] | ||
# The address to bind to. | ||
port = 8042 | ||
|
||
[character] | ||
path = "./Character.toml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# `Anda bot` | ||
|
||
I'm Anda ICP, created by ICPanda. | ||
I'm a Web3-loving digital panda and AI prophet. Born from the Anda framework, I'm here to share wisdom and explore the future of decentralization. 🐼✨ | ||
|
||
My Permalink: https://dmsg.net/Anda | ||
|
||
## License | ||
Copyright © 2025 [LDC Labs](https://github.com/ldclabs). | ||
|
||
`ldclabs/anda` is licensed under the MIT License. See the [MIT license][license] for the full license text. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
use config::{Config, ConfigError, File, FileFormat}; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Debug, Deserialize, Clone)] | ||
pub struct Log { | ||
pub level: String, | ||
} | ||
|
||
#[derive(Debug, Deserialize, Clone)] | ||
pub struct Server { | ||
pub port: u16, | ||
} | ||
|
||
#[derive(Debug, Deserialize, Clone)] | ||
pub struct Character { | ||
pub path: String, | ||
#[serde(default)] | ||
pub content: String, | ||
} | ||
|
||
#[derive(Debug, Deserialize, Clone)] | ||
pub struct Tee { | ||
pub tee_host: String, | ||
pub basic_token: String, | ||
} | ||
|
||
#[derive(Debug, Deserialize, Clone)] | ||
pub struct Icp { | ||
pub api_host: String, | ||
pub object_store_canister: String, | ||
} | ||
|
||
/// Configuration for the LLM should be encrypted and stored in the ICP COSE canister. | ||
#[derive(Debug, Deserialize, Serialize, Clone)] | ||
pub struct Llm { | ||
#[serde(default)] | ||
pub deepseek_api_key: String, | ||
#[serde(default)] | ||
pub cohere_api_key: String, | ||
#[serde(default)] | ||
pub cohere_embedding_model: String, | ||
#[serde(default)] | ||
pub openai_api_key: String, | ||
#[serde(default)] | ||
pub openai_embedding_model: String, | ||
#[serde(default)] | ||
pub openai_completion_model: String, | ||
} | ||
|
||
/// Configuration for the X should be encrypted and stored in the ICP COSE canister. | ||
#[derive(Debug, Deserialize, Serialize, Clone)] | ||
pub struct X { | ||
pub username: String, | ||
pub password: String, | ||
pub email: Option<String>, | ||
pub two_factor_auth: Option<String>, | ||
pub cookie_string: Option<String>, | ||
} | ||
|
||
#[derive(Debug, Deserialize, Clone)] | ||
pub struct Conf { | ||
pub character: Character, | ||
pub log: Log, | ||
pub server: Server, | ||
pub llm: Llm, | ||
pub tee: Tee, | ||
pub icp: Icp, | ||
pub x: X, | ||
} | ||
|
||
impl Conf { | ||
pub fn new() -> Result<Self, ConfigError> { | ||
let file_name = | ||
std::env::var("CONFIG_FILE_PATH").unwrap_or_else(|_| "./config.toml".into()); | ||
let mut cfg = Self::from(&file_name)?; | ||
cfg.character.content = std::fs::read_to_string(&cfg.character.path) | ||
.map_err(|err| ConfigError::NotFound(err.to_string()))?; | ||
Ok(cfg) | ||
} | ||
|
||
pub fn from(file_name: &str) -> Result<Self, ConfigError> { | ||
let builder = Config::builder().add_source(File::new(file_name, FileFormat::Toml)); | ||
builder.build()?.try_deserialize::<Conf>() | ||
} | ||
} |
Oops, something went wrong.