llama-stack-mirror/tests/integration/tool_runtime/recordings
Eric Huang a70fc60485 test
# What does this PR do?


## Test Plan
# What does this PR do?


## Test Plan
# What does this PR do?


## Test Plan
Completes the refactoring started in previous commit by:

1. **Fix library client** (critical): Add logic to detect Pydantic model parameters
   and construct them properly from request bodies. The key fix is to NOT exclude
   any params when converting the body for Pydantic models - we need all fields
   to pass to the Pydantic constructor.

   Before: _convert_body excluded all params, leaving body empty for Pydantic construction
   After: Check for Pydantic params first, skip exclusion, construct model with full body

2. **Update remaining providers** to use new Pydantic-based signatures:
   - litellm_openai_mixin: Extract extra fields via __pydantic_extra__
   - databricks: Use TYPE_CHECKING import for params type
   - llama_openai_compat: Use TYPE_CHECKING import for params type
   - sentence_transformers: Update method signatures to use params

3. **Update unit tests** to use new Pydantic signature:
   - test_openai_mixin.py: Use OpenAIChatCompletionRequestParams

This fixes test failures where the library client was trying to construct
Pydantic models with empty dictionaries.
The previous fix had a bug: it called _convert_body() which only keeps fields
that match function parameter names. For Pydantic methods with signature:
  openai_chat_completion(params: OpenAIChatCompletionRequestParams)

The signature only has 'params', but the body has 'model', 'messages', etc.
So _convert_body() returned an empty dict.

Fix: Skip _convert_body() entirely for Pydantic params. Use the raw body
directly to construct the Pydantic model (after stripping NOT_GIVENs).

This properly fixes the ValidationError where required fields were missing.
The streaming code path (_call_streaming) had the same issue as non-streaming:
it called _convert_body() which returned empty dict for Pydantic params.

Applied the same fix as commit 7476c0ae:
- Detect Pydantic model parameters before body conversion
- Skip _convert_body() for Pydantic params
- Construct Pydantic model directly from raw body (after stripping NOT_GIVENs)

This fixes streaming endpoints like openai_chat_completion with stream=True.
The streaming code path (_call_streaming) had the same issue as non-streaming:
it called _convert_body() which returned empty dict for Pydantic params.

Applied the same fix as commit 7476c0ae:
- Detect Pydantic model parameters before body conversion
- Skip _convert_body() for Pydantic params
- Construct Pydantic model directly from raw body (after stripping NOT_GIVENs)

This fixes streaming endpoints like openai_chat_completion with stream=True.
2025-10-09 13:53:18 -07:00
..
1e9f5ce2b5bb9d8ab952b4b12d6a85deb5194400946929464b965bf014c32e72.json feat(tests): implement test isolation for inference recordings (#3681) 2025-10-04 11:34:18 -07:00
2f72c4b82bd6644eba580f6625aa75efd814ea77d9a95e12ab159fbd442c5f31.json test 2025-10-09 13:53:18 -07:00
3eeef56f01d6bda0f6f441a67f57c66b6dc23ddefc7226abb7f2da2b80ada4e3.json test 2025-10-09 13:53:18 -07:00
4d04859cb4d87fe1c3df23b0a9f49cb9fe05b2b91ee425f5ec97332297451220.json chore: turn OpenAIMixin into a pydantic.BaseModel (#3671) 2025-10-06 11:33:19 -04:00
5ce1c9c2cf93d9dffc46243555fec52535119b133905b21194bc10cca56d719e.json test 2025-10-09 13:53:18 -07:00
7d95ea40241500cad1d235db95020d9848f209b9908e9041067e20ac2dec5fb3.json test 2025-10-09 13:53:18 -07:00
8fe0bae4f48fd0cb44bed2f2994798c0ba3c2772c73c398802b919bbf60d2848.json feat(tests): implement test isolation for inference recordings (#3681) 2025-10-04 11:34:18 -07:00
632ce0140a65d71196900f356f4790795b4504dd4bf4a31c9e3d2733f0faf2db.json feat(tests): implement test isolation for inference recordings (#3681) 2025-10-04 11:34:18 -07:00
854e45e9fdcadf1ddc67b43b006f287a66185d674f8945ebd3dea4b40d8f1e4e.json chore: turn OpenAIMixin into a pydantic.BaseModel (#3671) 2025-10-06 11:33:19 -04:00
3027fe9da37cc8b8a9e3e244f8aaf8b0065eae214a7ea4b0ec9e526b70bc9654.json feat(tests): implement test isolation for inference recordings (#3681) 2025-10-04 11:34:18 -07:00
9198c1d1117e92b46d33296efaedd002241dc747f442770dbd0c715f8d4f65d3.json test 2025-10-09 13:53:18 -07:00
29658b2af523134bfdbaef6abf955665e40f06e62277749e8ea208630b4e25c5.json test 2025-10-09 13:53:18 -07:00
357646e14feda6bf851170435b2f2e72460da6b5e21577a618cf30b73d8f0ac4.json feat(tests): implement test isolation for inference recordings (#3681) 2025-10-04 11:34:18 -07:00
a27a32894b82ced1edfbbbe2005b7d02ac84ca79c14e8e4c1932be544016fae5.json fix(tests): ensure test isolation in server mode (#3737) 2025-10-08 12:03:36 -07:00
af4b603152ef944bfc65e83878b8999d45a05e347fd2c44d6e1fc57c03d6eb2d.json test 2025-10-09 13:53:18 -07:00
b2bdf9be3e67e25aa46994a3aa304f0e798584e9b060efc781d67257d3155574.json feat(tests): implement test isolation for inference recordings (#3681) 2025-10-04 11:34:18 -07:00
b689a3ca5acbd63f415a16acf7e3dfd49df4a1d61f470babe2f061c1dbaf664e.json test 2025-10-09 13:53:18 -07:00
b09112c77e120b77674b76b141410650ea7236b9cb43f7c6ee0235be9796e93b.json test 2025-10-09 13:53:18 -07:00
c3a001b67461e2b7e44c823d315f9397649a7c2920d2d51a6aa5bb74c56de927.json test 2025-10-09 13:53:18 -07:00
c4871ef4b3db1c2c6d5cbf0a24438b1217902b1a2e8fde388a3715203f4835b3.json fix(tests): ensure test isolation in server mode (#3737) 2025-10-08 12:03:36 -07:00
d33d604b299e1824f60c5fc1f394f403f56018de929e2fa1befbc80596cf9584.json test 2025-10-09 13:53:18 -07:00
f443aea87bcf4e8860fc678095d9d1df3156a032ea496fee1d023dc7b6dcd479.json test 2025-10-09 13:53:18 -07:00
fe17937cb02f2d2a709de113a1a8050c36d9c18ce7f2193f26bf59a0ecb672f6.json fix(tests): ensure test isolation in server mode (#3737) 2025-10-08 12:03:36 -07:00