Added Missing Param in AI SDK and Updated Demo Application (#2667)
This commit is contained in:
@@ -70,7 +70,7 @@ const retrieveMemories = (memories: any) => {
|
||||
export async function POST(req: Request) {
|
||||
const { messages, system, tools, userId } = await req.json();
|
||||
|
||||
const memories = await getMemories(messages, { user_id: userId, rerank: true, threshold: 0.1 });
|
||||
const memories = await getMemories(messages, { user_id: userId, rerank: true, threshold: 0.1, output_format: "v1.0" });
|
||||
const mem0Instructions = retrieveMemories(memories);
|
||||
|
||||
const result = streamText({
|
||||
|
||||
@@ -45,7 +45,7 @@ const useUserId = () => {
|
||||
export const Assistant = () => {
|
||||
const { userId, resetUserId } = useUserId();
|
||||
const runtime = useChatRuntime({
|
||||
api: "https://demo.mem0.ai/api/chat",
|
||||
api: "/api/chat",
|
||||
body: { userId },
|
||||
});
|
||||
|
||||
@@ -91,8 +91,8 @@ export const Assistant = () => {
|
||||
</button>
|
||||
<GithubButton url="https://github.com/mem0ai/mem0/tree/main/examples" />
|
||||
|
||||
<Link href={"https://app.mem0.ai/"} target="_blank" className="py-2 ml-2 px-4 font-semibold dark:bg-zinc-100 dark:hover:bg-zinc-200 bg-zinc-800 text-white rounded-full hover:bg-zinc-900 dark:text-[#475569]">
|
||||
Save Memories
|
||||
<Link href={"https://app.mem0.ai/"} target="_blank" className="py-1 ml-2 px-4 font-semibold dark:bg-zinc-100 dark:hover:bg-zinc-200 bg-zinc-800 text-white rounded-full hover:bg-zinc-900 dark:text-[#475569]">
|
||||
Playground
|
||||
</Link>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
Reference in New Issue
Block a user