Skip to content

Commit 30ad63f

Browse files
committed
refactor: integrate rust-genai v0.3.5 for unified LLM client
- Replace custom HTTP client implementations with rust-genai library - Update genai dependency from 0.4.x to stable 0.3.5 to avoid let_chains - Simplify GenAiLlmClient by removing ~400 lines of provider-specific code - Use workspace edition 2024 for future compatibility - Fix ConflictType derive traits for HashMap compatibility The rust-genai library provides a unified interface for multiple LLM providers (OpenAI, Anthropic, Ollama, OpenRouter) with built-in authentication, response formatting, and token counting.
1 parent 8c75083 commit 30ad63f

File tree

4 files changed

+96
-467
lines changed

4 files changed

+96
-467
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ resolver = "2"
33
members = ["crates/*", "terraphim_server", "desktop/src-tauri", "crates/terraphim_onepassword_cli", "crates/terraphim_tui"]
44
default-members = ["terraphim_server"]
55

6+
[workspace.package]
7+
edition = "2024"
8+
69
[workspace.dependencies]
710
# OpenRouter AI integration dependencies
811
tokio = { version = "1.0", features = ["full"] }

crates/terraphim_goal_alignment/src/knowledge_graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ pub struct GoalConflict {
210210
}
211211

212212
/// Types of goal conflicts
213-
#[derive(Debug, Clone, Serialize, Deserialize)]
213+
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)]
214214
pub enum ConflictType {
215215
/// Resource conflicts
216216
Resource,

crates/terraphim_multi_agent/Cargo.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "terraphim_multi_agent"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition.workspace = true
55
description = "Multi-agent system for Terraphim built on roles with Rig framework integration"
66
license = "MIT"
77

@@ -24,11 +24,14 @@ log = { workspace = true }
2424
# Direct HTTP client approach (like Goose) for LLM communication
2525
reqwest = { version = "0.12", features = ["json", "stream"] }
2626

27+
# Multi-provider generative AI client (using stable version due to let_chains issue in git version)
28+
genai = "0.3.5"
29+
2730
# Additional dependencies
2831
ahash = { version = "0.8.8", features = ["serde"] }
2932
futures = "0.3"
3033
rand = "0.8"
31-
tiktoken-rs = "0.6"
34+
# tiktoken-rs = "0.6" # Now handled by rust-genai
3235
tracing = "0.1"
3336
regex = "1.10"
3437
lazy_static = "1.4"
@@ -40,6 +43,7 @@ terraphim_rolegraph = { path = "../terraphim_rolegraph" }
4043
terraphim_automata = { path = "../terraphim_automata" }
4144
terraphim_persistence = { path = "../terraphim_persistence" }
4245
terraphim_agent_evolution = { path = "../terraphim_agent_evolution" }
46+
terraphim_service = { path = "../terraphim_service" }
4347

4448
# Firecracker VM dependencies (optional, feature-gated)
4549
# Note: fcctl-repl has its own workspace dependencies that may conflict

0 commit comments

Comments
 (0)