Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions omlx/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -3572,6 +3572,17 @@ async def create_response(
cleaned_text = extraction.cleaned_text
tool_calls = extraction.tool_calls

# Process response_format if specified
if response_format and not tool_calls:
cleaned_text, parsed_json, is_valid, error = parse_json_output(
cleaned_text or regular_content,
response_format
)
if parsed_json is not None:
cleaned_text = json.dumps(parsed_json)
if not is_valid:
logger.warning(f"JSON validation failed: {error}")

# Build output items
output_items: list[OutputItem] = []
output_items.append(
Expand Down