llama-stack-mirror/llama_stack/apis
Matthew Farrellee 968fc132d3
fix(openai-compat): restrict developer/assistant/system/tool messages to text-only content (#2932)
**What:**
- Added OpenAIChatCompletionTextOnlyMessageContent type for text-only
content validation
- Modified OpenAISystemMessageParam, OpenAIAssistantMessageParam,
OpenAIDeveloperMessageParam, and OpenAIToolMessageParam to use text-only
content type instead of mixed content
- OpenAIUserMessageParam unchanged - still accepts both text and images
- Updated OpenAPI spec files to reflect text-only content restrictions
in schemas

closes #2894 

**Why:**
- Enforces OpenAI API compatibility by restricting image content to user
messages only
- Prevents API misuse where images might be sent in message types that
don't support them
- Aligns with OpenAI's actual API behavior where only user messages can
contain multimodal content
- Improves type safety and validation at the API boundary

**Test plan:**
- Added comprehensive parametrized tests covering all 5 OpenAI message
types
- Tests verify text string acceptance for all message types
- Tests verify text list acceptance for all message types
- Tests verify image rejection for system/assistant/developer/tool
messages (ValidationError expected)
- Tests verify user messages still accept images (backward compatibility
maintained)
2025-07-28 10:36:34 -07:00
..
agents feat: Add webmethod for deleting openai responses (#2160) 2025-06-30 11:28:02 +02:00
batch_inference chore: remove nested imports (#2515) 2025-06-26 08:01:05 +05:30
benchmarks chore: remove nested imports (#2515) 2025-06-26 08:01:05 +05:30
common chore(api): add mypy coverage to apis (#2648) 2025-07-09 12:55:16 +02:00
datasetio chore: remove nested imports (#2515) 2025-06-26 08:01:05 +05:30
datasets fix: finish conversion to StrEnum (#2514) 2025-06-26 08:01:26 +05:30
eval chore: remove nested imports (#2515) 2025-06-26 08:01:05 +05:30
files fix: finish conversion to StrEnum (#2514) 2025-06-26 08:01:26 +05:30
inference fix(openai-compat): restrict developer/assistant/system/tool messages to text-only content (#2932) 2025-07-28 10:36:34 -07:00
inspect chore: remove nested imports (#2515) 2025-06-26 08:01:05 +05:30
models chore: internal change, make Model.provider_model_id non-optional (#2690) 2025-07-17 08:26:57 -07:00
post_training fix: DPOAlignmentConfig schema to use correct DPO parameters (#2804) 2025-07-18 11:56:00 -07:00
providers chore: remove nested imports (#2515) 2025-06-26 08:01:05 +05:30
safety chore: remove nested imports (#2515) 2025-06-26 08:01:05 +05:30
scoring chore: remove nested imports (#2515) 2025-06-26 08:01:05 +05:30
scoring_functions chore: remove nested imports (#2515) 2025-06-26 08:01:05 +05:30
shields chore: remove nested imports (#2515) 2025-06-26 08:01:05 +05:30
synthetic_data_generation chore: remove nested imports (#2515) 2025-06-26 08:01:05 +05:30
telemetry feat(auth): API access control (#2822) 2025-07-24 15:30:48 -07:00
tools fix: search mode validation for rag query (#2857) 2025-07-23 11:25:12 -07:00
vector_dbs fix(vectordb): VectorDBInput has no provider_id (#2830) 2025-07-21 14:03:40 +02:00
vector_io chore: Making name optional in openai_create_vector_store (#2858) 2025-07-22 13:31:31 -04:00
__init__.py API Updates (#73) 2024-09-17 19:51:35 -07:00
datatypes.py feat: Bring Your Own API (BYOA) (#2228) 2025-07-24 13:41:14 -07:00
resource.py feat: drop python 3.10 support (#2469) 2025-06-19 12:07:14 +05:30
version.py llama-stack version alpha -> v1 2025-01-15 05:58:09 -08:00