Skip to content

added a prompt fix for better vision+audio prompt, removed code that …#589

Merged
HenryNdubuaku merged 1 commit intomainfrom
karen/test-fixes
Apr 16, 2026
Merged

added a prompt fix for better vision+audio prompt, removed code that …#589
HenryNdubuaku merged 1 commit intomainfrom
karen/test-fixes

Conversation

@kar-m
Copy link
Copy Markdown
Collaborator

@kar-m kar-m commented Apr 15, 2026

…threw warnings on cmake

Copilot AI review requested due to automatic review settings April 15, 2026 22:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Gemma4 test prompts and ChatMessage initializers to align with the current ChatMessage struct (including audio/tool-call related fields) and improves the vision+audio test prompt.

Changes:

  • Update multiple tests to aggregate-initialize ChatMessage with the newly present audio_soft_token_count and tool_calls fields.
  • Adjust the vision+audio suite test to use a clearer prompt string (and reuse it for display + request JSON).
  • Minor whitespace-only change in the suite test.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/test_gemma4_vision.cpp Updates ChatMessage initialization to include new fields.
tests/test_gemma4_thinking.cpp Updates ChatMessage initializers across thinking/prompt/cache tests.
tests/test_gemma4_suite.cpp Updates vision message initializer; refines vision+audio prompt and builds JSON request with it.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +545 to 547
std::string messages = "[{\"role\":\"user\",\"content\":\"" + image_audio_prompt + "\","
"\"images\":[\"" + escape_json(image_path) + "\"],"
"\"audio\":[\"" + escape_json(audio_path) + "\"]}]";
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The messages JSON string concatenates image_audio_prompt directly into a JSON string value. If the prompt ever contains quotes, backslashes, or newlines, this will produce invalid JSON and can cause cactus_complete to fail. Use the existing escape_json() helper for the prompt content as well (similar to how paths are handled).

Copilot uses AI. Check for mistakes.
return false;
}

Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is trailing whitespace on this blank line. Please remove it to avoid unnecessary diffs and potential whitespace/lint issues.

Copilot uses AI. Check for mistakes.
@HenryNdubuaku HenryNdubuaku merged commit c078595 into main Apr 16, 2026
10 of 12 checks passed
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.

3 participants