- Remove external AI API dependency (no more OpenAI/Claude API calls) - Claude Code now does all interpretation and scoring locally - Zero cost: No API fees - Complete privacy: No data sent to external servers - Simplified dependencies: Removed openai crate and ai-analysis feature Changes: - ai_interpreter.rs: Simplified to lightweight wrapper - Cargo.toml: Removed ai-analysis feature and openai dependency - mcp/base.rs: Updated create_memory_with_ai to accept interpreted_content and priority_score from Claude Code - memory.rs: Added create_memory_with_interpretation() method - Documentation: Updated README, QUICKSTART, USAGE to reflect local-only operation - Added CHANGELOG.md to track changes How it works now: User → Claude Code (interprets & scores) → aigpt (stores) → game result Benefits: ✅ 完全ローカル (Fully local) ✅ ゼロコスト (Zero cost) ✅ プライバシー保護 (Privacy protected) ✅ 高速 (Faster - no network latency) ✅ シンプル (Simpler - fewer dependencies)
37 lines
1.2 KiB
Rust
37 lines
1.2 KiB
Rust
use anyhow::Result;
|
||
|
||
/// AIInterpreter - Claude Code による解釈を期待する軽量ラッパー
|
||
///
|
||
/// このモジュールは外部 AI API を呼び出しません。
|
||
/// 代わりに、Claude Code 自身がコンテンツを解釈し、スコアを計算することを期待します。
|
||
///
|
||
/// 完全にローカルで動作し、API コストはゼロです。
|
||
pub struct AIInterpreter;
|
||
|
||
impl AIInterpreter {
|
||
pub fn new() -> Self {
|
||
AIInterpreter
|
||
}
|
||
|
||
/// コンテンツをそのまま返す(Claude Code が解釈を担当)
|
||
pub async fn interpret_content(&self, content: &str) -> Result<String> {
|
||
Ok(content.to_string())
|
||
}
|
||
|
||
/// デフォルトスコアを返す(Claude Code が実際のスコアを決定)
|
||
pub async fn calculate_priority_score(&self, _content: &str, _user_context: Option<&str>) -> Result<f32> {
|
||
Ok(0.5) // デフォルト値
|
||
}
|
||
|
||
/// 解釈とスコアリングを Claude Code に委ねる
|
||
pub async fn analyze(&self, content: &str, _user_context: Option<&str>) -> Result<(String, f32)> {
|
||
Ok((content.to_string(), 0.5))
|
||
}
|
||
}
|
||
|
||
impl Default for AIInterpreter {
|
||
fn default() -> Self {
|
||
Self::new()
|
||
}
|
||
}
|