mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-16 06:27:58 +00:00
feat(UI): Adding linter and prettier for UI (#3156)
This commit is contained in:
parent
61582f327c
commit
e69acbafbf
73 changed files with 1452 additions and 1226 deletions
|
@ -27,7 +27,7 @@ interface ResponsesTableProps {
|
|||
* Helper function to convert ResponseListResponse.Data to OpenAIResponse
|
||||
*/
|
||||
const convertResponseListData = (
|
||||
responseData: ResponseListResponse.Data,
|
||||
responseData: ResponseListResponse.Data
|
||||
): OpenAIResponse => {
|
||||
return {
|
||||
id: responseData.id,
|
||||
|
@ -56,8 +56,8 @@ function getInputText(response: OpenAIResponse): string {
|
|||
}
|
||||
|
||||
function getOutputText(response: OpenAIResponse): string {
|
||||
const firstMessage = response.output.find((item) =>
|
||||
isMessageItem(item as any),
|
||||
const firstMessage = response.output.find(item =>
|
||||
isMessageItem(item as Record<string, unknown>)
|
||||
);
|
||||
if (firstMessage) {
|
||||
const content = extractContentFromItem(firstMessage as MessageItem);
|
||||
|
@ -66,15 +66,15 @@ function getOutputText(response: OpenAIResponse): string {
|
|||
}
|
||||
}
|
||||
|
||||
const functionCall = response.output.find((item) =>
|
||||
isFunctionCallItem(item as any),
|
||||
const functionCall = response.output.find(item =>
|
||||
isFunctionCallItem(item as Record<string, unknown>)
|
||||
);
|
||||
if (functionCall) {
|
||||
return formatFunctionCall(functionCall as FunctionCallItem);
|
||||
}
|
||||
|
||||
const webSearchCall = response.output.find((item) =>
|
||||
isWebSearchCallItem(item as any),
|
||||
const webSearchCall = response.output.find(item =>
|
||||
isWebSearchCallItem(item as Record<string, unknown>)
|
||||
);
|
||||
if (webSearchCall) {
|
||||
return formatWebSearchCall(webSearchCall as WebSearchCallItem);
|
||||
|
@ -95,7 +95,7 @@ function extractContentFromItem(item: {
|
|||
} else if (Array.isArray(item.content)) {
|
||||
const textContent = item.content.find(
|
||||
(c: ResponseInputMessageContent) =>
|
||||
c.type === "input_text" || c.type === "output_text",
|
||||
c.type === "input_text" || c.type === "output_text"
|
||||
);
|
||||
return textContent?.text || "";
|
||||
}
|
||||
|
@ -131,14 +131,14 @@ export function ResponsesTable({ paginationOptions }: ResponsesTableProps) {
|
|||
limit: number;
|
||||
model?: string;
|
||||
order?: string;
|
||||
},
|
||||
}
|
||||
) => {
|
||||
const response = await client.responses.list({
|
||||
after: params.after,
|
||||
limit: params.limit,
|
||||
...(params.model && { model: params.model }),
|
||||
...(params.order && { order: params.order }),
|
||||
} as any);
|
||||
} as Parameters<typeof client.responses.list>[0]);
|
||||
|
||||
const listResponse = response as ResponseListResponse;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue