feat: whyrating - initial project from turbostarter boilerplate
This commit is contained in:
11
packages/ai/src/utils/common.ts
Normal file
11
packages/ai/src/utils/common.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { UIMessage } from "ai";
|
||||
|
||||
export const getMessageTextContent = <T extends UIMessage>(message?: T) => {
|
||||
return (
|
||||
message?.parts
|
||||
.filter((part) => part.type === "text")
|
||||
.map((part) => part.text)
|
||||
.join("")
|
||||
.trim() ?? ""
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user