Files
b371cc6c6f Python: update dependencies (#14360)
## Summary
- update Transformers and related Hugging Face packages
- refresh Python dependencies used by the MCP OAuth demo
- regenerate the affected uv lockfiles
- adapt the Hugging Face text completion connector to Transformers 5
- temporarily disable live tests that depend on the retired Assistants
API

## Hugging Face connector

Transformers 5 removes the `text2text-generation`, `summarization` and
`translation` pipeline tasks, so `HuggingFaceTextCompletion` raised
`KeyError: Unknown task text2text-generation` on construction.

Those two tasks now use a small adapter built on `AutoModelForSeq2SeqLM`
and `AutoTokenizer` that preserves what the removed pipelines did:

- the same output keys (`summary_text` for summarization,
`generated_text` otherwise), so the content mapping is unchanged
- the model's task specific prefix (e.g. `summarize: `) is still
prepended before tokenization
- one record per generated sequence when `num_return_sequences > 1`
- `model_kwargs` are shared with the tokenizer load, as `pipeline()` did
- pipeline only options are dropped with a warning instead of reaching
`generate()`

`text-generation` keeps using `pipeline()`. There is no public API
change.

The previous unit tests mocked `pipeline()` and so did not catch the
incompatibility. New tests cover the adapter, option routing, device
placement, output mapping and prefix resolution.

## Temporarily disabled tests

The OpenAI and Azure OpenAI Assistants API has been retired. Live
requests now return HTTP 410 (`assistants_api_deprecated`) on Azure
OpenAI and HTTP 404 on OpenAI, so these tests cannot exercise a
functioning service.

- all 30 parametrized cases in
`tests/integration/agents/openai_assistant_agent/test_openai_assistant_agent_integration.py`
are skipped at module level, before the live-service fixture runs
- the `step1_openai_assistant` case in `tests/samples/test_concepts.py`
is skipped unconditionally
- the other concept samples are unchanged
- all 103 tests under `tests/unit/agents/openai_assistant` remain
enabled and passing

The skips are intentionally limited to live tests for the retired API.
Comments next to each skip include the migration guide and state that
the skip should be removed after the agents and sample move to the
replacement API.

## Validation
- uv lock consistency checks
- 35 Hugging Face unit tests pass
- all 12 deliberate connector mutations used to assess regression
coverage were detected by the unit tests
- all 103 Assistants agent unit tests pass
- 30 live Assistants integration cases and the one retired-API concept
sample report as skipped before making service requests
- the three text completion services used by the integration suite were
exercised against their real models on Transformers 5, for both
completion and streaming
- Ruff check and formatting pass

---------

Co-authored-by: Evan Mattson <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: c2d4dd29-0a9c-4f43-b2ce-243e19ec34b2
2026-09-03 15:10:36 +00:00
..