diff --git a/app/components/chat/AssistantMessage.tsx b/app/components/chat/AssistantMessage.tsx deleted file mode 100644 index b549ce44..00000000 --- a/app/components/chat/AssistantMessage.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { memo } from 'react'; -import { Markdown } from './Markdown'; -import type { JSONValue } from 'ai'; - -interface AssistantMessageProps { - content: string; - annotations?: JSONValue[]; -} - -export function getAnnotationsTokensUsage(annotations: JSONValue[] | undefined) { - const filteredAnnotations = (annotations?.filter( - (annotation: JSONValue) => annotation && typeof annotation === 'object' && Object.keys(annotation).includes('type'), - ) || []) as { type: string; value: any }[]; - - const usage: { - completionTokens: number; - promptTokens: number; - totalTokens: number; - } = filteredAnnotations.find((annotation) => annotation.type === 'usage')?.value; - - return usage; -} - -export const AssistantMessage = memo(({ content, annotations }: AssistantMessageProps) => { - const usage = getAnnotationsTokensUsage(annotations); - - return ( -