Commit a71b46d
fix: properly render DALL-E/gpt-image responses in request drawer (#5542)
- Add `role: "assistant"` to response messages so ChatOnlyView displays them
- Add `request.messages` array with user prompt for proper Chat component rendering
- Add `data:image/png;base64,` prefix for base64 images so ImageContent can process them
The DALL-E mapper was not properly structuring messages for the UI:
1. Response messages lacked a `role` field, causing them to be filtered out
2. Request didn't include a `messages` array, so the user prompt wasn't shown
3. Raw base64 strings from OpenAI's `b64_json` weren't being recognized as images
Co-authored-by: Justin Torre <justin@Justins-MacBook-Pro.local>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent bcabf39 commit a71b46d
File tree
2 files changed
+33
-6
lines changed- packages
- __tests__/llm-mapper
- llm-mapper/mappers/openai
2 files changed
+33
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
38 | 45 | | |
39 | 46 | | |
40 | 47 | | |
41 | 48 | | |
| 49 | + | |
42 | 50 | | |
43 | 51 | | |
44 | 52 | | |
45 | | - | |
| 53 | + | |
46 | 54 | | |
47 | 55 | | |
48 | 56 | | |
| |||
61 | 69 | | |
62 | 70 | | |
63 | 71 | | |
64 | | - | |
| 72 | + | |
65 | 73 | | |
66 | 74 | | |
67 | 75 | | |
| |||
98 | 106 | | |
99 | 107 | | |
100 | 108 | | |
| 109 | + | |
101 | 110 | | |
102 | 111 | | |
103 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
35 | 44 | | |
36 | 45 | | |
37 | 46 | | |
| |||
44 | 53 | | |
45 | 54 | | |
46 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
47 | 66 | | |
48 | 67 | | |
49 | 68 | | |
50 | 69 | | |
| 70 | + | |
51 | 71 | | |
52 | 72 | | |
53 | | - | |
54 | | - | |
| 73 | + | |
55 | 74 | | |
56 | 75 | | |
57 | 76 | | |
| |||
73 | 92 | | |
74 | 93 | | |
75 | 94 | | |
76 | | - | |
77 | | - | |
| 95 | + | |
78 | 96 | | |
79 | 97 | | |
80 | 98 | | |
| |||
0 commit comments