Skip to content

Attach generated responses to live tests - #371

Merged
mattt merged 2 commits into
mainfrom
mattt/attach-generated-responses
Oct 26, 2026
Merged

mattt merged 2 commits into
mainfrom
mattt/attach-generated-responses

Conversation

@mattt

@mattt mattt commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

This PR records the responses that models generate in the live provider tests as Swift Testing attachments, so they can be read after a run to check them by eye.

A new test helper, attachResponse, attaches a text response as a .txt file and a structured response as the .json the model produced. Each attachment is named after the current test. A test that attaches more than one response adds the variable name to tell them apart. The helper is called after each respond call in the Foundation Models, MLX, llama.cpp, Core ML, OpenAI, Open Responses, Anthropic, Gemini, and Ollama live suites. Streaming tests are not covered yet.

Attachment.record(_:named:) is available from Swift 6.2, and the package already requires Swift tools 6.3, so the helper needs no compiler guard. Nothing under Sources/ changes.

Resolves #93

@mattt
mattt merged commit b548e8b into main Oct 26, 2026
11 checks passed
@mattt
mattt deleted the mattt/attach-generated-responses branch October 26, 2026 16:58
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.

Attach generated responses to tests

1 participant