Skip to content

Commit

Permalink
Update: fix typos in 03-openai-assistants.mdx (#1556)
Browse files Browse the repository at this point in the history
  • Loading branch information
DraganAleksic99 committed May 11, 2024
1 parent 35a3d8e commit 3719622
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions content/docs/05-ai-sdk-ui/03-openai-assistants.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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({
Expand All @@ -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.

0 comments on commit 3719622

Please sign in to comment.