fix(azure): respect provided credential; return parsed text in AzureAIClient.parse_chat_completion#453
Open
pxkundu wants to merge 6 commits intoSylphAI-Inc:mainfrom
Open
fix(azure): respect provided credential; return parsed text in AzureAIClient.parse_chat_completion#453pxkundu wants to merge 6 commits intoSylphAI-Inc:mainfrom
pxkundu wants to merge 6 commits intoSylphAI-Inc:mainfrom
Conversation
…rser mixing - Replace problematic instance variable assignment with dynamic parser selection - Fix issue where self.response_parser persisted across calls causing mode confusion - Add type-specific logic to distinguish Response, AsyncIterable, and Iterable objects - Exclude basic types (str, bytes, dict) from streaming detection - Ensure correct parser is always selected based on completion type Resolves: OpenAI client getting 'stuck' in streaming or non-streaming mode after switching between stream=True and stream=False calls.
… optimization instructions - Separate optimization context from target content in TEXT_GRAD_DESC_TEMPLATE - Replace problematic mixed instructions with structured sections - Add OPTIMIZATION_CONTEXT section for meta-instructions about iteration strategy - Add TARGET_CONTENT_TO_OPTIMIZE section to isolate content to be optimized - Add CRITICAL_INSTRUCTION section with explicit contamination prevention - Use clear XML-like boundaries to prevent context bleeding between sections - Maintain full backward compatibility with existing template variables Resolves: TGDOptimizer contaminating prompts with phrases like 'when steps exceed 3' that don't belong in optimized content, making the optimizer unsuitable for production.
…rrors; Tests: align OpenAI parser tests with dynamic parser selection; CI: add pytest-mock and lancedb to test group
… instances - Fix Agent initialization in open_ai_test.py by adding required model_client and model_kwargs parameters - Fix setup_env() calls in test files to handle missing .env file gracefully - Add pytest.mark.asyncio decorators to async test functions - Fix import path for AutoApprovalHandler in test_permission_system.py - Use fake API keys for testing to avoid environment variable requirements All tests now pass: 542 passed, 2 skipped, 11 warnings
…in data; tidy parser usage and keep raw_response
…hat_completion data output
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.
Summary
This PR improves the existing AzureAIClient by:
Why
Changes
Testing
Related
Closes #285