From 3719622bf210eb31b9181e3df20399f7b8ffc88c Mon Sep 17 00:00:00 2001 From: Dragan Aleksic <120718648+DraganAleksic99@users.noreply.github.com> Date: Sat, 11 May 2024 08:53:14 +0200 Subject: [PATCH] Update: fix typos in 03-openai-assistants.mdx (#1556) --- content/docs/05-ai-sdk-ui/03-openai-assistants.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/docs/05-ai-sdk-ui/03-openai-assistants.mdx b/content/docs/05-ai-sdk-ui/03-openai-assistants.mdx index e0ea2447d13..ec61031e564 100644 --- a/content/docs/05-ai-sdk-ui/03-openai-assistants.mdx +++ b/content/docs/05-ai-sdk-ui/03-openai-assistants.mdx @@ -5,11 +5,11 @@ description: Learn how to use the useAssistant hook. # OpenAI Assistants -The `useAssistant` hook allows you to handle the client state when interacting with an OpenAI compatible assistant API. This hook is useful when you want to integrate assistant capibilities into your application, with the UI updated automatically as the assistant is streaming its execution. +The `useAssistant` hook allows you to handle the client state when interacting with an OpenAI compatible assistant API. This hook is useful when you want to integrate assistant capabilities into your application, with the UI updated automatically as the assistant is streaming its execution. ## Example -```tsx filename='app/pages.tsx' +```tsx filename='app/page.tsx' 'use client'; import { Message, useAssistant } from 'ai/react'; @@ -187,7 +187,7 @@ return ( ## Configure Request Options -By default, the `useAssistant` hook sends a HTTP POST request to the `/api/completion` endpoint with the prompt as part of the request body. You can customize the request by passing additional options to the `useAssistant` hook: +By default, the `useAssistant` hook sends a HTTP POST request to the `/api/assistant` endpoint with the prompt as part of the request body. You can customize the request by passing additional options to the `useAssistant` hook: ```tsx const { messages, input, handleInputChange, handleSubmit } = useAssistant({ @@ -202,4 +202,4 @@ const { messages, input, handleInputChange, handleSubmit } = useAssistant({ }); ``` -In this example, the `useAssistant` hook sends a POST request to the `/api/completion` endpoint with the specified headers, additional body fields, and credentials for that fetch request. On your server side, you can handle the request with these additional information. +In this example, the `useAssistant` hook sends a POST request to the `/api/custom-completion` endpoint with the specified headers, additional body fields, and credentials for that fetch request. On your server side, you can handle the request with these additional information.