Skip to content

Commit

Permalink
Second pass at fixing 404 links on AI SDK docs (#1077)
Browse files Browse the repository at this point in the history
  • Loading branch information
conroywhitney authored Mar 4, 2024
1 parent 209dde7 commit bb80c3d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions docs/pages/docs/api-reference/ai-stream.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { OptionTable } from '@/components/table';

## `AIStream(res: Response, customParser: AIStreamParser => void, callbacks?: AIStreamCallbacksAndOptions): ReadableStream` [#aistream]

`AIStream` is a helper function for creating a readable stream for AI responses. This is based on the responses returned by `fetch` and serves as the basis for the [`OpenAIStream`](./openai-stream) and [`AnthropicStream`](./anthropic-stream). It allows you to handle AI response streams in a controlled and customized manner that will work with [`useChat`](./use-chat) and [`useCompletion`](./use-completion).
`AIStream` is a helper function for creating a readable stream for AI responses. This is based on the responses returned by `fetch` and serves as the basis for the [`OpenAIStream`](/docs/api-reference/providers/openai-stream) and [`AnthropicStream`](/docs/api-reference/providers/anthropic-stream). It allows you to handle AI response streams in a controlled and customized manner that will work with [`useChat`](./use-chat) and [`useCompletion`](./use-completion).

`AIStream` will throw an error if `res` doesn't have a `2xx` status code. This is to ensure that the stream is only created for successful responses.

Expand Down Expand Up @@ -65,9 +65,9 @@ This is an object that contains the following properties:
]}
/>

## Example: Using `AIStream` to create [`AnthropicStream`](./anthropic-stream)
## Example: Using `AIStream` to create [`AnthropicStream`](/docs/api-reference/providers/anthropic-stream)

Here is real example of how to use `AIStream` to create a stream that will work with [`useChat`](./use-chat) and [`useCompletion`](./use-completion). Here's is the implementation for [`AnthropicStream`](./anthropic-stream) which expects a response returned by `fetch`. [`AnthropicStream`](./anthropic-stream) is a specific implementation of `AIStream` for the Anthropic AI platform.
Here is real example of how to use `AIStream` to create a stream that will work with [`useChat`](./use-chat) and [`useCompletion`](./use-completion). Here's is the implementation for [`AnthropicStream`](/docs/api-reference/providers/anthropic-stream) which expects a response returned by `fetch`. [`AnthropicStream`](/docs/api-reference/providers/anthropic-stream) is a specific implementation of `AIStream` for the Anthropic AI platform.

```tsx
import {
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/docs/api-reference/providers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- [GoogleGenerativeAIStream](./providers/google-generative-ai-stream)
- [HuggingFaceStream](./providers/huggingface-stream)
- [InkeepStream](./providers/inkeep-stream)
- [LangChainStream](./providers/lang-chain-stream)
- [LangChainStream](./providers/langchain-stream)
- [MistralStream](./providers/mistral-stream)
- [OpenAIStream](./providers/openai-stream)
- [ReplicateStream](./providers/replicate-stream)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## `LangChainStream(callbacks?: AIStreamCallbacks): { stream: ReadableStream, handlers: LangChainCallbacks }` [#langchainstream]

`LangChainStream` is a utility function designed to facilitate the integration of [LangChain](https://js.langchain.com/docs) - a framework for engineering prompts for AI language models - with UI components and data streaming to the client side. Returns a `stream` and bag of [LangChain](js.langchain.com/docs) `BaseCallbackHandlerMethodsClass` that automatically implement streaming in such a way that you can use [`useChat`](./use-chat) and [`useCompletion`](./use-completion).
`LangChainStream` is a utility function designed to facilitate the integration of [LangChain](https://js.langchain.com/docs) - a framework for engineering prompts for AI language models - with UI components and data streaming to the client side. Returns a `stream` and bag of [LangChain](https://js.langchain.com/docs) `BaseCallbackHandlerMethodsClass` that automatically implement streaming in such a way that you can use [`useChat`](/docs/api-reference/use-chat) and [`useCompletion`](/docs/api-reference/use-completion).

## Parameters

Expand Down

0 comments on commit bb80c3d

Please sign in to comment.