Connection
Base URL, credentials and a reachable server.
A wildcard does not erase an explicit refusal. AcceptMatrix is a Windows AI coding client for exploring media-choice code against parsed request preferences and checking why one supported representation wins.
def choose_media(ranges):
offered = ["application/json", "text/plain"]
if not ranges:
return offered[0]
choices = []
for i, media in enumerate(offered):
family = media.split("/")[0] + "/*"
matches = [(2 if p == media else 1 if p == family else 0, q)
for p, q in ranges if p in (media, family, "*/*")]
quality = max(matches, default=(-1, 0))[1]
if quality > 0:
choices.append((quality, -i, media))
return max(choices)[2] if choices else NoneBase URL, credentials and a reachable server.
Test an exact type with quality zero beside a positive wildcard and an empty preference list, respecting specific exclusions instead of letting the wildcard override them.
Compare actual behavior with the expected result. If a check fails, investigate it before applying more changes.
def choose_media(ranges):
offered = ["application/json", "text/plain"]
if not ranges:
return offered[0]
choices = []
for i, media in enumerate(offered):
family = media.split("/")[0] + "/*"
matches = [(2 if p == media else 1 if p == family else 0, q)
for p, q in ranges if p in (media, family, "*/*")]
quality = max(matches, default=(-1, 0))[1]
if quality > 0:
choices.append((quality, -i, media))
return max(choices)[2] if choices else NoneA client can express several acceptable response formats, and a server still needs a clear rule for choosing among them. AcceptMatrix brings that decision into a Windows AI coding workspace. Open the request-handling project and discuss how parsed preferences reach the code that selects and produces a response.
One useful review task is checking a media-selection function against explicit exclusions and broader wildcard preferences. Supply the representations your application actually offers and ask the connected model to trace a few concrete requests. Keep parsing assumptions visible: a selector receiving parsed ranges cannot establish that the original header was interpreted correctly.
From those examples, define the expected response when no offered format qualifies and when preferences tie. Review both the selection change and its integration with the response writer. Run project tests that verify the chosen media type and the resulting status, so the patch does not merely return an appealing string while the handler sends something else.
AcceptMatrix connects to supported OpenAI-compatible or Anthropic endpoints. An uncensored AI model is an option when available through that connection; its response behavior and working limits remain model-dependent. The practical value is a review conversation grounded in your service contract, with proposed edits that you assess against real request cases.
Include an ordinary preference, a wildcard, an explicit exclusion and a request that accepts none of the offered formats. State the expected response for each. Keep the list of server-supported representations beside those cases.
The selector may rely on already validated ranges and quality values. If parsing changes their meaning, a correct selection function can still produce the wrong response. Trace that boundary and test the assumptions each layer makes.
Use the response behavior required by your application contract and verify the handler implements it. Ask the model to identify the existing failure path before proposing a new one, including status handling and any fallback body.
Make the priority rule explicit and add cases where equally acceptable formats compete. Review whether the selected representation is actually produced by the response writer. A deterministic selector is useful only when the integration respects its decision.
AcceptMatrix · Updated 2026-10-25