feat(ui): add views for Responses (#2293)

# What does this PR do?
* Add responses list and detail views
* Refactored components to be shared as much as possible between chat
completions and responses

## Test Plan
<img width="2014" alt="image"
src="https://github.com/user-attachments/assets/6dee12ea-8876-4351-a6eb-2338058466ef"
/>
<img width="2021" alt="image"
src="https://github.com/user-attachments/assets/6c7c71b8-25b7-4199-9c57-6960be5580c8"
/>

added tests
This commit is contained in:
ehhuang 2025-05-28 09:51:22 -07:00 committed by GitHub
parent 6352078e4b
commit 56e5ddb39f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 3282 additions and 380 deletions

View file

@ -43,10 +43,14 @@ export function extractDisplayableText(
return "";
}
let textPart = extractTextFromContentPart(message.content);
const textPart = extractTextFromContentPart(message.content);
let toolCallPart = "";
if (message.tool_calls && message.tool_calls.length > 0) {
if (
message.tool_calls &&
Array.isArray(message.tool_calls) &&
message.tool_calls.length > 0
) {
// For summary, usually the first tool call is sufficient
toolCallPart = formatToolCallToString(message.tool_calls[0]);
}