Conversation
- Add ToolCallingBridge in C++ for parsing tool_call tags from LLM output - Handle edge cases: missing closing tags, unquoted JSON keys - Add tool registration and prompt formatting in C++ bridge - TypeScript orchestration layer calls C++ for parsing, handles execution - Add Llama 3.2 3B model to example app (suitable for tool calling) - Update ChatScreen with tool calling demo (weather API example) Architecture: - C++ handles: parsing, validation, prompt formatting - TypeScript handles: tool registration (stores executors), execution (needs JS APIs) Co-Authored-By: jm
- Replace console.log with SDKLogger for consistency - Use ?? instead of || for maxToolCalls to respect explicit 0 - Parse argumentsJson if it's a string from C++ - Update comments to accurately reflect architecture (C++ parses, TS handles registry) - Remove toolsUsed field from analytics (not in type) - Fix doc comment for parseToolCallFromOutput return format
Signed-off-by: Hyunoh-Yeo <hyunoh.yeo@gmail.com>
Signed-off-by: Hyunoh-Yeo <hyunoh.yeo@gmail.com>
Signed-off-by: Hyunoh-Yeo <hyunoh.yeo@gmail.com>
Signed-off-by: Hyunoh-Yeo <hyunoh.yeo@gmail.com>
Signed-off-by: Hyunoh-Yeo <hyunoh.yeo@gmail.com>
Signed-off-by: Hyunoh-Yeo <hyunoh.yeo@gmail.com>
feat: Add tool calling support with C++
updating git ignore
fix: ios swift app is not deleting models once downloaded + Metadata display bug
SDK Changes: - Add ToolValue enum for type-safe JSON representation (string, number, bool, array, object, null) - Add ToolCallingTypes.swift with type definitions using ToolValue - Add ToolCallParser.swift with pure Swift parser for <tool_call> tags - Add RunAnywhere+ToolCalling.swift with public API (registerTool, executeTool, generateWithTools) Example App Changes: - Add ToolCallInfo to Message model using ToolValue for serialization - Add ToolCallViews.swift with minimal UI (indicator + detail sheet) - Add ToolSettingsView.swift with tool registration settings and 3 demo tools - Update ChatMessageComponents to show tool call indicator on messages - Update ChatInterfaceView to show "Tools enabled" badge - Update LLMViewModel to integrate tool calling into generation flow Bug Fixes: - Fix LLMViewModel+Analytics.swift nil coalescing warnings - Simplify ModelSelectionSheet VLM handling
…ved argument handling - Updated ToolCallViews to use ToolValue for arguments and results. - Refactored ToolSettingsView to implement real API calls for weather and time tools using Open-Meteo API. - Improved ToolCallParser to extract tool names and arguments with multiple fallback strategies. - Added WeatherService for fetching real-time weather data and handling geocoding. - Enhanced error handling in tool execution and argument parsing.
Implements VLM feature with clean, minimal API: C++ Core (runanywhere-commons): - Add rac_vlm_types.h - VLM type definitions - Add rac_vlm_service.h - VLM service vtable and C API - Add rac_vlm_component.h - VLM component lifecycle - Add rac_vlm_llamacpp.h - LlamaCPP VLM backend API - Add rac_image_utils.h - Image utilities - Add RAC_CAPABILITY_VISION_LANGUAGE capability - Add RAC_RESOURCE_TYPE_VLM_MODEL to lifecycle Swift SDK (runanywhere-swift): - Add VLMTypes.swift - VLMImage, VLMGenerationOptions, VLMGenerationResult - Add RunAnywhere+VisionLanguage.swift - describeImage, processImageStream - Add RunAnywhere+VLMModels.swift - loadVLMModel helper - Add CppBridge+VLM.swift - Thread-safe VLM component management iOS Sample App: - Add VLMCameraView.swift - Camera interface for VLM - Add VLMViewModel.swift - Camera/VLM state management - Update ModelSelectionSheet with .vlm context Note: VLM backend conditionally compiled via RAC_VLM_USE_MTMD
…nga/vlm # Conflicts: # examples/ios/RunAnywhereAI/RunAnywhereAI/Features/Models/ModelSelectionSheet.swift
Adds a floating action button (camera icon) in the bottom-right of the chat interface. Tapping it opens the VLM camera view in a full-screen cover for image analysis.
Adds camera permission description to both Debug and Release build configurations to prevent crash when accessing camera.
Registers two VLM models for vision language features: - SmolVLM 500M Instruct (Q8_0) - Ultra-lightweight for mobile - Qwen2-VL 2B Instruct (Q4_K_M) - Small but capable
…vailable feature for SWIFT right now
Add diffusion support for apple only - swift sdk + swift sample app
[Swift-sdk] VLM Support + Diffusion support
|
Important Review skippedToo many files! This PR contains 218 files, which is 68 over the limit of 150. You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Generated with ❤️ by ellipsis.dev |
|
@coderabbitai please do a detailed review. Thanks! |
|
@greptile please do a detailed review. Thanks! |
|
✅ Actions performedReview triggered.
|
|
Merging dev to main to add the features for :
|
Merging dev to main
Description
Tool calling in all 4 SDK's + VLM and Diffusion model support for SWIFT SDK!
Type of Change
Testing
Platform-Specific Testing (check all that apply)
Swift SDK / iOS Sample:
Kotlin SDK / Android Sample:
Flutter SDK / Flutter Sample:
React Native SDK / React Native Sample:
Labels
Please add the appropriate label(s):
SDKs:
Swift SDK- Changes to Swift SDK (sdk/runanywhere-swift)Kotlin SDK- Changes to Kotlin SDK (sdk/runanywhere-kotlin)Flutter SDK- Changes to Flutter SDK (sdk/runanywhere-flutter)React Native SDK- Changes to React Native SDK (sdk/runanywhere-react-native)Commons- Changes to shared native code (sdk/runanywhere-commons)Sample Apps:
iOS Sample- Changes to iOS example app (examples/ios)Android Sample- Changes to Android example app (examples/android)Flutter Sample- Changes to Flutter example app (examples/flutter)React Native Sample- Changes to React Native example app (examples/react-native)Checklist
Screenshots
Attach relevant UI screenshots for changes (if applicable):
Greptile Overview
Greptile Summary
This PR merges the
devbranch intomain, introducing three major feature additions across all SDK platforms (Swift, Kotlin, Flutter, React Native):Major Changes
1. Tool Calling System (~3,500 lines)
runanywhere-commonsas single source of truth<tool_call>JSON</tool_call>) and LFM2 (<|tool_call_start|>[func(args)]<|tool_call_end|>)2. Diffusion/Image Generation (~2,800 lines)
3. Vision-Language Models (VLM) (~2,600 lines)
Additional Changes
eval())Architecture
Confidence Score: 3/5
sdk/runanywhere-commons/src/features/llm/tool_calling.cpp) for edge cases, the diffusion and VLM backend integrations, and verify that all platform-specific example apps have been tested on their respective platformsImportant Files Changed
Sequence Diagram
sequenceDiagram participant App as Example App participant SDK as Platform SDK<br/>(Swift/Kotlin/Flutter/RN) participant Bridge as Platform Bridge participant Commons as runanywhere-commons<br/>(C++) participant LLM as LLM Backend Note over App,LLM: Tool Calling Flow App->>SDK: generateWithTools(prompt, tools, options) SDK->>Bridge: buildInitialPrompt() Bridge->>Commons: rac_tool_call_build_initial_prompt() Commons-->>Bridge: formatted prompt with tool instructions Bridge-->>SDK: system prompt + user prompt SDK->>LLM: generate(formatted_prompt) LLM-->>SDK: raw output with tool call tags SDK->>Bridge: parseToolCall(llm_output) Bridge->>Commons: rac_tool_call_parse() Note over Commons: Auto-detect format<br/>(DEFAULT vs LFM2) Note over Commons: Parse JSON with<br/>edge case handling Commons-->>Bridge: ToolCall{name, args, callId} Bridge-->>SDK: parsed tool call SDK->>App: toolRegistry.execute(toolName, args) App-->>SDK: tool result SDK->>Bridge: buildFollowupPrompt() Bridge->>Commons: rac_tool_call_build_followup_prompt() Commons-->>Bridge: followup prompt with result Bridge-->>SDK: formatted followup SDK->>LLM: generate(followup_prompt) LLM-->>SDK: final response SDK-->>App: GenerationResult{text, toolCalls, toolResults}