Skip to content

fix: resolve duplicate model constructor options - #1538

Merged
fit2cloud-chenyw merged 2 commits into
dataease:mainfrom
pcbeingused33:fix/model-streaming-options
Dec 3, 2026
Merged

fit2cloud-chenyw merged 2 commits into
dataease:mainfrom
pcbeingused33:fix/model-streaming-options

Conversation

@pcbeingused33

@pcbeingused33 pcbeingused33 commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Model validation and chat share OpenAI and vLLM adapter construction. Advanced settings that repeat constructor options currently raise TypeError before contacting the provider.

Build one options dictionary per adapter. Model, credentials and endpoint settings take precedence over matching advanced settings; vLLM streaming remains enabled. OpenAI stream_usage defaults to true and honors an explicitly configured false. Remove the synchronous wrapper's forced override so synchronous chat and asynchronous validation use the configured usage setting consistently. Other advanced options, including temperature=0, remain intact.

Update the endpoint guard for dictionary-based construction and cover usage configuration with the real OpenAI adapter and SDK over an offline HTTP transport. This change does not alter token-count display or add provider fallback/retries.

Validation

  • Original PR head 472e2cf: the revised focused suite reproduces 3 failures (2 constructor-option expectations and 1 synchronous request forcibly enabling usage); 24 cases pass.
  • Updated code: 83 tests pass across model validation, supplier configuration, parameter parsing and reasoning-stream handling. The usage request tests exercise synchronous and asynchronous SDK streams with mocked HTTP responses; no external provider is contacted.
  • The original PR also fails the existing endpoint source guard because it expects the previous keyword syntax. The updated guard retains the endpoint assertion for dictionary construction, supplemented by constructor behavior coverage.
  • Ruff checks pass for both changed test files; formatting passes for the model-validation test file; git diff --check passes. The two production files retain the same 13 pre-existing Ruff findings without unrelated cleanup.
  • Python 3.11.16, pytest 7.4.4, FastAPI 0.115.14, Pydantic 2.13.5; existing Pydantic configuration deprecation warnings remain. Dependencies were reused without synchronization or lockfile changes.
cd backend
LOG_FORMAT='%(levelname)s %(message)s' PYTHONPATH=. python -m pytest -q \
  tests/test_model_validation_parameters.py tests/test_supplier_config.py \
  tests/test_prepare_model_arg.py tests/test_reasoning_stream.py

No live authenticated HTTP route, database, browser, deployment or external LLM was exercised.

@fit2cloud-chenyw
fit2cloud-chenyw merged commit 287935a into dataease:main Dec 3, 2026
1 check passed
@fit2cloud-chenyw

Copy link
Copy Markdown
Contributor

Thanks for fixing the duplicate constructor options. I added a small follow-up before merging: stream_usage still defaults to true, but an explicit false is now respected. I also removed the synchronous wrapper's forced override so chat and asynchronous model validation use the same setting. Model, credentials and endpoint precedence, as well as vLLM streaming, remain unchanged.

The focused regression suite passed all 83 tests, including synchronous/asynchronous SDK requests over a mocked HTTP transport. The GitHub spell check also passed; no live provider was exercised.

Merged into main as 287935a6. Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants