diff --git a/MoneyMap/Services/AIVisionClient.cs b/MoneyMap/Services/AIVisionClient.cs
index 44d279a..d289cfd 100644
--- a/MoneyMap/Services/AIVisionClient.cs
+++ b/MoneyMap/Services/AIVisionClient.cs
@@ -1,3 +1,4 @@
+using MoneyMap.Services.AITools;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
@@ -29,9 +30,226 @@ namespace MoneyMap.Services
}
///
- /// OpenAI Vision API client.
+ /// Extended interface for vision clients that support tool use / function calling.
///
- public class OpenAIVisionClient : IAIVisionClient
+ public interface IAIToolAwareVisionClient : IAIVisionClient
+ {
+ bool SupportsToolUse { get; }
+
+ Task AnalyzeImageWithToolsAsync(
+ string base64Image,
+ string mediaType,
+ string prompt,
+ string model,
+ List tools,
+ Func> toolExecutor,
+ int maxToolRounds = 5);
+ }
+
+ ///
+ /// Shared helper for the OpenAI-compatible tool-use wire format.
+ /// Used by both OpenAIVisionClient and LlamaCppVisionClient since they share /v1/chat/completions.
+ ///
+ public static class OpenAIToolUseHelper
+ {
+ ///
+ /// Convert AIToolDefinitions to the OpenAI tools array format.
+ ///
+ public static List