feat(dynamicModels): JSON Loading, Param Filtering, Reasoning Mode & Web Search#1074
Draft
feat(dynamicModels): JSON Loading, Param Filtering, Reasoning Mode & Web Search#1074
Conversation
Member
AAClause
commented
Mar 5, 2026
- feat(provider): add dynamic model loader for JSON metadata
- feat: load OpenAI/Anthropic models from model-metadata JSON
- feat: model-based param visibility and flexible web search
- feat: param filtering, reasoning mode (data + UI + engine mapping)
Replace hard-coded model lists with dynamic loader. Add supported_parameters, reasoning_capable, created to ProviderAIModel. Sort by created desc.
- Add update_parameter_controls_visibility(): show/hide temp, top_p, max_tokens, web search based on model.supported_parameters and engine.model_supports_web_search - Add ProviderAIModel.web_search_capable, supports_parameter() - Add BaseEngine.model_supports_web_search(), get_web_search_tool_definitions() - OpenAI/Anthropic: override web search methods, use in completion() - Loader: parse supports_web_search from JSON, fallback to "tools" - Fix except (TypeError, ValueError) syntax in dynamic_model_loader
Filter completion params by model.supported_parameters. Add reasoning mode (checkbox, budget, effort, adaptive) to MessageBlock/Profile, views, and presenters. Map to Anthropic thinking, OpenAI reasoning.effort, XAI reasoning_effort.
…ific reasoning - BaseEngine: MODELS_JSON_URL + _postprocess_models for JSON-based engines - Mistral: switch to mistralai.json - reasoning_config: xAI low/high only, provider-aware effort restore
- Introduce ResponsesAPIEngine base for OpenAI-compatible Responses API - Refactor OpenAIEngine to extend ResponsesAPIEngine - Migrate XAIEngine from Chat Completions to Responses API - Add ProviderCapability.WEB_SEARCH and web_search tool for xAI - Add reasoning_config for provider-specific effort options
…o presenter - Add reasoning_params_helper for shared param extraction across presenters - Move parameter visibility logic from BaseConversation to BaseConversationPresenter - Introduce ParameterVisibilityState dataclass for presenter-driven visibility - Narrow exception handling in effort selection (IndexError, TypeError) - Remove redundant XAIEngine __init__ - Add engine tests for Anthropic reasoning param injection - Fix except (TypeError, ValueError) syntax in dynamic_model_loader
- Route gpt-audio + audio attachments to Chat Completions API (input_audio) - Add document (input_file) support for Responses API providers - Derive audio/vision/document from model metadata (modality, input_modalities) - Validate audio attachments against model capabilities in attachment service - Add reasoning params helper for view-to-block parameter mapping
…se in history - Audio output settings (modality, voice, format) in block/profile - Persist audio in DB (migration 002) and BSKC - Sound manager: pause/resume with position tracking - History: Space=play/pause, Escape=stop, context menu Play/Pause/Stop - Skip completion chime when response is audio; auto-play on finish
- Remove reasoning_config.py; move logic into engine.get_reasoning_ui_spec() - Add AudioOutputUISpec and get_audio_output_spec() for TTS voice lists - Use engine-provided specs for reasoning and audio instead of hard-coded UI values - Fix Python 2 except syntax in dynamic_model_loader and base_conversation - Add voice_options to ParameterVisibilityState; populate from engine - Update get_audio_params_from_view and get_reasoning_params_from_view to use engine
…/hide UI
- Add Message.reasoning field; content holds only the final response
- Add content_utils with START_BLOCK_REASONING, END_REASONING, split_reasoning_and_content
- DB: add reasoning column (migration 003), save/load, backward compat for legacy ```think...```
- Anthropic, DeepSeek: populate reasoning and content separately; streaming yields ("reasoning", chunk) or ("content", chunk)
- Completion handler: route structured chunks, wrap streaming reasoning with `<think>`, parse legacy format after stream
- Display: show reasoning when checkbox on, using `<think>` tags
- Config: default in Preferences, per-tab override in conversation panel (always visible)
- API: send only content
…; support reasoning in edit block - Add General group (max tokens, temperature, top P, stream mode) - Add Tools group (web search) before General - Add Reasoning group (mode, adaptive, budget, effort, show blocks) - Hide groups when model/engine does not support them - Edit block: load/save reasoning and content via format_response_for_display and split_reasoning_and_content_from_display - Edit block: refresh response when "Show reasoning blocks" checkbox changes
- Add TokenUsage and ResponseTiming models to MessageBlock - Populate usage from all provider engines (streaming and non-streaming) - Track completion timing in CompletionHandler - Add web_search_mode to MessageBlock and persist in DB - Add MessageBlockPropertiesDialog for viewing block metadata - ResponseTiming: add request_sent_at, first_token_at; TTFT, generation duration - completion_handler: capture request_sent_at, first_token_at for streaming - DB: persist usage_json, timing_json on message_blocks (migration 005) - Add usage_utils with provider-specific extractors; refactor all engines - Add Properties context menu item for message blocks (Alt+Enter)
…ments
Dynamic model loader:
- Remove :thinking/_reasoning exclusion; reasoning from JSON only
- Add _modality_flags; reasoning_only set by engines in _postprocess_models
Anthropic:
- Fix completion_response_without_stream: parse thinking from content blocks
(API has no top-level thinking; ThinkingBlock has .thinking not .text)
General:
- Configurable model_metadata_cache_ttl_seconds
- view_utils: view_has_web_search_control, view_get_web_search_value
- DEFAULT_AUDIO_VOICES; extensible _get_filterable_params
- Fix Python 2 exception syntax; narrow DB exception handling
- ResponsesAPIEngine yields ("content", delta) for CompletionHandler
- conversation_params: REASONING_PARAM_KEYS, AUDIO_PARAM_KEYS helpers
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.