import { Accordion as e, AccordionContent as t, AccordionItem as n, AccordionTrigger as r } from "../../../components/ui/accordion.js";
import { Card as i, CardContent as a, CardHeader as o, CardTitle as s } from "../../../components/ui/card.js";
import c from "../../../components/messages/CompletionMessagePaper.js";
import "react";
import { jsx as l, jsxs as u } from "react/jsx-runtime";
//#region src/features/documents/document-details/PromptDetails.tsx
var d = ({ promptData: d }) => {
	if (!d) return null;
	let { messages: f, response: p, cache: m } = d;
	return /* @__PURE__ */ u("div", {
		className: "mt-4 space-y-4",
		children: [
			/* @__PURE__ */ u(i, { children: [/* @__PURE__ */ l(o, {
				className: "pb-3",
				children: /* @__PURE__ */ l(s, {
					className: "text-lg",
					children: "Cache"
				})
			}), /* @__PURE__ */ l(a, { children: /* @__PURE__ */ u("div", {
				className: "ml-4 space-y-1",
				children: [/* @__PURE__ */ u("p", {
					className: "text-sm",
					children: ["Hit: ", m?.hit ? "Yes" : "No"]
				}), /* @__PURE__ */ u("p", {
					className: "text-sm",
					children: ["Hash: ", m?.hash]
				})]
			}) })] }),
			/* @__PURE__ */ l(e, {
				type: "single",
				collapsible: !0,
				defaultValue: "messages",
				children: /* @__PURE__ */ u(n, {
					value: "messages",
					children: [/* @__PURE__ */ l(r, {
						className: "text-lg font-semibold",
						children: "Request Messages"
					}), /* @__PURE__ */ l(t, { children: /* @__PURE__ */ l("div", {
						className: "space-y-2",
						children: f?.map((e, t) => /* @__PURE__ */ l(c, {
							role: e.role,
							children: e.content
						}, t))
					}) })]
				})
			}),
			/* @__PURE__ */ l(e, {
				type: "single",
				collapsible: !0,
				defaultValue: "response",
				children: /* @__PURE__ */ u(n, {
					value: "response",
					children: [/* @__PURE__ */ l(r, {
						className: "text-lg font-semibold",
						children: "Response"
					}), /* @__PURE__ */ l(t, { children: /* @__PURE__ */ u("div", {
						className: "space-y-4",
						children: [/* @__PURE__ */ l(i, { children: /* @__PURE__ */ l(a, {
							className: "p-4",
							children: /* @__PURE__ */ l("pre", {
								className: "font-mono text-xs wrap-break-word whitespace-pre-wrap",
								children: p?.data
							})
						}) }), /* @__PURE__ */ u(i, {
							className: "bg-gray-50",
							children: [/* @__PURE__ */ l(o, {
								className: "pb-3",
								children: /* @__PURE__ */ l(s, {
									className: "text-base",
									children: "Metadata"
								})
							}), /* @__PURE__ */ l(a, { children: /* @__PURE__ */ u("div", {
								className: "ml-4 space-y-1",
								children: [
									/* @__PURE__ */ u("p", {
										className: "text-sm",
										children: ["Model: ", p?.metadata?.model]
									}),
									/* @__PURE__ */ u("p", {
										className: "text-sm",
										children: ["Prompt ID: ", p?.metadata?.prompt_id]
									}),
									/* @__PURE__ */ u("p", {
										className: "text-sm",
										children: [
											"Response Time: ",
											p?.metadata?.response_time,
											" ms"
										]
									}),
									/* @__PURE__ */ u("p", {
										className: "text-sm",
										children: ["Prompt Tokens: ", p?.metadata?.prompt_token]
									}),
									/* @__PURE__ */ u("p", {
										className: "text-sm",
										children: ["Completion Tokens: ", p?.metadata?.completion_token]
									})
								]
							}) })]
						})]
					}) })]
				})
			})
		]
	});
};
//#endregion
export { d as default };
