UNPKG

@assistant-ui/react

Version:

Typescript/React library for AI Chat

1 lines 858 B
{"version":3,"sources":["../../../src/primitives/contentPart/useContentPartReasoning.tsx"],"sourcesContent":["\"use client\";\n\nimport { ContentPartState } from \"../../api/ContentPartRuntime\";\nimport { useContentPart } from \"../../context/react/ContentPartContext\";\nimport { ReasoningContentPart } from \"../../types\";\n\nexport const useContentPartReasoning = () => {\n const text = useContentPart((c) => {\n if (c.type !== \"reasoning\")\n throw new Error(\n \"ContentPartReasoning can only be used inside reasoning content parts.\",\n );\n\n return c as ContentPartState & ReasoningContentPart;\n });\n\n return text;\n};\n"],"mappings":";;;AAGA,SAAS,sBAAsB;AAGxB,IAAM,0BAA0B,MAAM;AAC3C,QAAM,OAAO,eAAe,CAAC,MAAM;AACjC,QAAI,EAAE,SAAS;AACb,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAEF,WAAO;AAAA,EACT,CAAC;AAED,SAAO;AACT;","names":[]}