chore(event formatter): add llmFormat to endpoint#119545
Conversation
Sentry Snapshot Testing
|
3de3acb to
298ba91
Compare
298ba91 to
9e901db
Compare
|
bugbot run |
Hardcoded markdown bold in _solution leaked into xml llmFormat output. Use fmt.field so markdown and xml both get format-appropriate step lines. Co-authored-by: Shayna Chambless <shayna-ch@users.noreply.github.com>
NotRequired is ignored under from __future__ import annotations, so OpenAPI treated `formatted` as required and example validation failed. Use total=False TypedDict mixins instead, and cast the event details response so mypy accepts the annotated return type. Co-authored-by: Shayna Chambless <shayna-ch@users.noreply.github.com>
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 83226f9. Configure here.
| return response | ||
|
|
||
| try: | ||
| content = adapter(response.data, fmt) |
There was a problem hiding this comment.
related to #119250 (comment), we seem to have to include a lot of formatting logic because we take in Anys from endpoints. since endpoints (and data, in general) are typed, we can probably remove a lot of it by using the type system. for example, group_event_details returns an GroupEventDetailsResponse, which is fully typed. thus, you wouldn't need to do any defensive checks if you typed format_event_response to take some GroupEventDetailsResponse-like object. similar case to the group_ai_autofix endpoint, though we should probably just add the appropriate types on that endpoint
to be merged after #119250
Adds a reusable
FormattableResponseMixinthat lets an endpoint return LLM-ready formatted output. When a request passes?llmFormat=markdown(or xml), the endpoint includes a new formatted:{format, content}field in its JSON response, rendered by the shared formatter. Existing response fields are unchanged. Wires this into the group event details endpoint and the autofix endpoint (group_ai_autofix).No behavioral change on merge. behind the
issues.standardized-markdown-for-llmoption. Rollout will happen gradually via feature flag.