BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/simple-ai/ai-utils

ai-utils

simple-ai/ai-utils
FreeUtility

A set of utilities for the AI SDK.

Live preview

live · rendered by the registry
Rendered by simple-ai on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://simple-ai.dev/r/ai-utils.json

Source

./src/registry/ai/ai-utils.tssimple-ai.dev/r/ai-utils.json
1import type { AIUIMessage } from "@/registry/ai/messages";
2import { idToReadableText } from "@/registry/lib/id-to-readable-text";
3
4export function uiMessageToText(message: AIUIMessage) {
5 return message.parts
6 .map((part) => {
7 if (part.type === "text") {
8 return part.text;
9 }
10 if (part.type === "reasoning") {
11 return `Reasoning:\n${part.text}`;
12 }
13 if (part.type === "dynamic-tool" || part.type.startsWith("tool")) {
14 return `Tool call: ${idToReadableText(part.type)}`;
15 }
16 return "";
17 })
18 .join("\n");
19}

What it pulls in

npm packages

  • ai

Files it writes

  • ./src/registry/ai/ai-utils.ts

Facts

Registry
simple-ai
Type
registry:lib
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
yesterday

Go to the source

Docs on simple-ai simple-ai.dev Alwurts/simple-ai on GitHub Raw registry item This item as JSON

More from simple-ai

All 77 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
agent-respondagent-respondsimple-aiUtilitiesFree1 dep
agents-tools-registryagents-tools-registrysimple-aiUtilitiesFree1 dep · 2 files
Exa Agentexa-agentsimple-aiUtilitiesFree1 dep
exa-toolexa-toolsimple-aiUtilitiesFree3 deps
Firecrawl Agentfirecrawl-agentsimple-aiUtilitiesFree1 dep
firecrawl-toolfirecrawl-toolsimple-aiUtilitiesFree3 deps
get-weatherget-weathersimple-aiUtilitiesFree2 deps
id-to-readable-textid-to-readable-textsimple-aiUtilitiesFreeno deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex