Merged
Conversation
…rsing - Implements parseStructuredResponse() with provider detection - Supports Anthropic XML function calls and OpenAI JSON responses - Handles markdown-fenced JSON and partial JSON gracefully - Includes comprehensive unit tests - Version bumped to 1.2.0
- Add ResponseParser class for provider-agnostic response parsing - Implement Anthropic XML function call parsing with tool support - Add OpenAI JSON response parsing capabilities - Create AnthropicSchemaBuilder for tool schema generation - Add comprehensive unit tests for all parsing scenarios - Support for markdown-fenced JSON and various response formats - Generic parameter extraction for XML function calls - All edge cases and unit tests now passing This enables aideas to use a unified parsing API regardless of LLM provider.
- Add parseDirectFunctionTags() method to handle formats like <generate_musical_sequence>JSON</generate_musical_sequence> - Update parseAnthropicXmlResponse() to try direct function tags as fallback after standard XML - Make ResponseParser more generic to handle any function tag format, not just <function_calls> wrapper - Support both real LLM responses and test formats for better compatibility - Add regex patterns to match specific function names or any function dynamically
- Remove file containing real API response data to prevent information leakage - This file should not have been committed to the repository
- Temporarily simplified parseDirectFunctionTags implementation - Added missing nlohmann/json.hpp include - Fixed namespace scope issues that were breaking compilation - All other parsing methods remain functional
- Replaced complex regex implementation with simple string finding - Handles <generate_musical_sequence> and other direct XML tags - Avoids compilation issues while maintaining functionality - All tests passing successfully
- Remove hardcoded 'generate_musical_sequence' dependency - Make function truly generic by requiring functionName parameter - Handle both closed tags </func> and unclosed tags <func> - Extract JSON content using balanced bracket parsing - Return empty if no functionName provided (proper generic behavior)
- Throw std::invalid_argument instead of silently returning empty - Add proper error message for debugging - Include required <stdexcept> header
- Previously only detected specific tags like <function_calls> - Now detects any XML-like content including custom function tags - Removes all debug code and cleans up implementation - This ensures parseDirectFunctionTags gets called for custom function names
- Remove text wrapping from Anthropic MessagesResponse.toLLMResponse()
- Remove text wrapping from OpenAI ResponsesResponse.toLLMResponse()
- Now returns parsed JSON directly instead of wrapping in {'text': '...'}
- Simplifies response handling and follows principle of returning raw responses
- Add parsing for tool_use content fields (id, name, input) in MessagesResponse::fromJson() - Previously only text content was parsed, causing tool calls to return empty name/input - Now properly extracts structured JSON data from tool_use responses - Enables Anthropic tool calling for enforcing JSON schemas via structured output
- Changed the default model from CLAUDE_SONNET_3_5_V2 to CLAUDE_SONNET_3_7 - Ensures the latest stable model is used for API interactions
- Change defaultModel from CLAUDE_SONNET_3_7 to CLAUDE_SONNET_4 - Corresponds to claude-sonnet-4-20250514 model - Aligns with current usage in aideas-suite integration tests
- Changed anthropicVersion from "2023-06-01" to "2025-05-14" - Ensures compatibility with the latest features and improvements in the API
- Replace try-catch JSON parsing with explicit expectStructuredOutput parameter - Add expectStructuredOutput parameter to both OpenAI and Anthropic toLLMResponse methods - Client automatically detects structured output when jsonSchema is set - Handles free-form text (wrap in text field) vs structured JSON (parse directly) - All tests passing: OpenAI (34 assertions) and Anthropic (111 assertions) - No more inefficient try-catch guessing or JSON parsing exceptions
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.