Download src/components/features/chat/tool-visualizers/text-content.ts from SaylorTwift/openhands: direct link, hf CLI and curl.
- Browser
- Download file 485 Bytes
-
https://huggingface.co/SaylorTwift/openhands/resolve/main/src/components/features/chat/tool-visualizers/text-content.ts
- Command line
-
hf download hf://SaylorTwift/openhands/src/components/features/chat/tool-visualizers/text-content.ts
-
curl -L -o text-content.ts https://huggingface.co/SaylorTwift/openhands/resolve/main/src/components/features/chat/tool-visualizers/text-content.ts
485 Bytes
| import { | |
| TextContent, | |
| ImageContent, | |
| } from "#/types/agent-server/core/base/common"; | |
| /** | |
| * Joins the text parts of a tool observation's `content` array, dropping image | |
| * parts. Mirrors the extraction the markdown helpers do so migrated tools show | |
| * the same text the fallback path would have. | |
| */ | |
| export const textFromContent = ( | |
| content: Array<TextContent | ImageContent>, | |
| ): string => | |
| content | |
| .filter((c) => c.type === "text") | |
| .map((c) => c.text) | |
| .join("\n"); | |