WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/adapters/anthropic.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,6 @@ Creates an Anthropic adapter instance.

## Next Steps

- [Getting Started](../../getting-started/quick-start) - Learn the basics
- [Tools Guide](../../guides/tools) - Learn about tools
- [Other Adapters](../openai) - Explore other providers
- [Getting Started](../getting-started/quick-start) - Learn the basics
- [Tools Guide](../guides/tools) - Learn about tools
- [Other Adapters](./openai) - Explore other providers
6 changes: 3 additions & 3 deletions docs/adapters/gemini.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,6 @@ Creates a Gemini adapter instance.

## Next Steps

- [Getting Started](../../getting-started/quick-start) - Learn the basics
- [Tools Guide](../../guides/tools) - Learn about tools
- [Other Adapters](../openai) - Explore other providers
- [Getting Started](../getting-started/quick-start) - Learn the basics
- [Tools Guide](../guides/tools) - Learn about tools
- [Other Adapters](./openai) - Explore other providers
6 changes: 3 additions & 3 deletions docs/adapters/ollama.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,6 @@ Creates an Ollama adapter instance.

## Next Steps

- [Getting Started](../../getting-started/quick-start) - Learn the basics
- [Tools Guide](../../guides/tools) - Learn about tools
- [Other Adapters](../openai) - Explore other providers
- [Getting Started](../getting-started/quick-start) - Learn the basics
- [Tools Guide](../guides/tools) - Learn about tools
- [Other Adapters](./openai) - Explore other providers
6 changes: 3 additions & 3 deletions docs/adapters/openai.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,6 @@ Creates an OpenAI adapter instance.

## Next Steps

- [Getting Started](../../getting-started/quick-start) - Learn the basics
- [Tools Guide](../../guides/tools) - Learn about tools
- [Other Adapters](../anthropic) - Explore other providers
- [Getting Started](../getting-started/quick-start) - Learn the basics
- [Tools Guide](../guides/tools) - Learn about tools
- [Other Adapters](./anthropic) - Explore other providers
6 changes: 3 additions & 3 deletions docs/api/ai-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,6 @@ const client = new ChatClient({

## Next Steps

- [Getting Started](../../getting-started/quick-start) - Learn the basics
- [Connection Adapters](../../guides/connection-adapters) - Learn about adapters
- [@tanstack/ai-react API](../ai-react) - React hooks wrapper
- [Getting Started](../getting-started/quick-start) - Learn the basics
- [Connection Adapters](../guides/connection-adapters) - Learn about adapters
- [@tanstack/ai-react API](./ai-react) - React hooks wrapper
6 changes: 3 additions & 3 deletions docs/api/ai-react.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,6 @@ Re-exported from `@tanstack/ai`:

## Next Steps

- [Getting Started](../../getting-started/quick-start) - Learn the basics
- [Tools Guide](../../guides/tools) - Learn about the isomorphic tool system
- [Client Tools](../../guides/client-tools) - Learn about client-side tools
- [Getting Started](../getting-started/quick-start) - Learn the basics
- [Tools Guide](../guides/tools) - Learn about the isomorphic tool system
- [Client Tools](../guides/client-tools) - Learn about client-side tools
6 changes: 3 additions & 3 deletions docs/api/ai-solid.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,6 @@ Re-exported from `@tanstack/ai`:

## Next Steps

- [Getting Started](../../getting-started/quick-start) - Learn the basics
- [Tools Guide](../../guides/tools) - Learn about the isomorphic tool system
- [Client Tools](../../guides/client-tools) - Learn about client-side tools
- [Getting Started](../getting-started/quick-start) - Learn the basics
- [Tools Guide](../guides/tools) - Learn about the isomorphic tool system
- [Client Tools](../guides/client-tools) - Learn about client-side tools
6 changes: 3 additions & 3 deletions docs/api/ai.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,6 @@ const embeddings = await embedding({

## Next Steps

- [Getting Started](../../getting-started/quick-start) - Learn the basics
- [Tools Guide](../../guides/tools) - Learn about tools
- [Adapters](../../adapters/openai) - Explore adapter options
- [Getting Started](../getting-started/quick-start) - Learn the basics
- [Tools Guide](../guides/tools) - Learn about tools
- [Adapters](../adapters/openai) - Explore adapter options
6 changes: 3 additions & 3 deletions docs/getting-started/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@ With the help of adapters, TanStack AI can connect to various LLM providers. Ava

## Next Steps

- [Quick Start Guide](../quick-start) - Get up and running in minutes
- [Tools Guide](../../guides/tools) - Learn about the isomorphic tool system
- [API Reference](../../api/ai) - Explore the full API
- [Quick Start Guide](./quick-start) - Get up and running in minutes
- [Tools Guide](../guides/tools) - Learn about the isomorphic tool system
- [API Reference](../api/ai) - Explore the full API
6 changes: 3 additions & 3 deletions docs/getting-started/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,6 @@ chat({ tools: [getProducts] })

## Next Steps

- Learn about [Tools](../../guides/tools) to add function calling
- Check out [Client Tools](../../guides/client-tools) for frontend operations
- See the [API Reference](../../api/ai) for more options
- Learn about [Tools](../guides/tools) to add function calling
- Check out [Client Tools](../guides/client-tools) for frontend operations
- See the [API Reference](../api/ai) for more options
6 changes: 3 additions & 3 deletions docs/guides/client-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ chat({ tools: [addToCartServer] }); // Server will execute

## Next Steps

- [How Tools Work](../tools) - Deep dive into the tool architecture
- [Server Tools](../server-tools) - Learn about server-side tool execution
- [Tool Approval Flow](../tool-approval) - Add approval workflows for sensitive operations
- [How Tools Work](./tools) - Deep dive into the tool architecture
- [Server Tools](./server-tools) - Learn about server-side tool execution
- [Tool Approval Flow](./tool-approval) - Add approval workflows for sensitive operations

6 changes: 3 additions & 3 deletions docs/guides/connection-adapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Connection adapters handle the communication between your client and server for

### Server-Sent Events (SSE)

SSE is the recommended adapter for most use cases. It provides reliable streaming with automatic reconnection. On the server side, use [`toServerSentEventsStream()`](../../api/ai#toserversenteventsstreamstream-abortcontroller) or [`toStreamResponse()`](../../api/ai#tostreamresponsestream-init) to convert your chat stream to SSE format.
SSE is the recommended adapter for most use cases. It provides reliable streaming with automatic reconnection. On the server side, use [`toServerSentEventsStream()`](../api/ai#toserversenteventsstreamstream-abortcontroller) or [`toStreamResponse()`](../api/ai#tostreamresponsestream-init) to convert your chat stream to SSE format.

```typescript
import { useChat, fetchServerSentEvents } from "@tanstack/ai-react";
Expand Down Expand Up @@ -225,5 +225,5 @@ const { messages } = useChat({

## Next Steps

- [Streaming](../streaming) - Learn about streaming responses
- [API Reference](../../api/ai-client) - Explore connection adapter APIs
- [Streaming](./streaming) - Learn about streaming responses
- [API Reference](../api/ai-client) - Explore connection adapter APIs
4 changes: 2 additions & 2 deletions docs/guides/server-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,5 +266,5 @@ const getUserData = getUserDataDef.server(async ({ userId }) => {

## Next Steps

- [Client Tools](../client-tools) - Learn about client-side tool execution
- [Tool Approval Flow](../tool-approval) - Add approval workflows for sensitive operations
- [Client Tools](./client-tools) - Learn about client-side tool execution
- [Tool Approval Flow](./tool-approval) - Add approval workflows for sensitive operations
4 changes: 2 additions & 2 deletions docs/guides/streaming.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,5 +171,5 @@ stop();

## Next Steps

- [Connection Adapters](../connection-adapters) - Learn about different connection types
- [API Reference](../../api/ai) - Explore streaming APIs
- [Connection Adapters](./connection-adapters) - Learn about different connection types
- [API Reference](../api/ai) - Explore streaming APIs
4 changes: 2 additions & 2 deletions docs/guides/tool-approval.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,5 +239,5 @@ The user will see an approval prompt showing the item, quantity, and price befor

## Next Steps

- [Server Tools](../server-tools) - Learn about server-side tool execution
- [Client Tools](../client-tools) - Learn about client-side tool execution
- [Server Tools](./server-tools) - Learn about server-side tool execution
- [Client Tools](./client-tools) - Learn about client-side tool execution
16 changes: 8 additions & 8 deletions docs/guides/tool-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ id: tool-architecture

The TanStack AI tool system provides a powerful, flexible architecture for enabling AI agents to interact with external systems:

- [**Server Tools**](../server-tools) execute securely on the backend with automatic handling
- [**Client Tools**](../client-tools) execute in the browser for UI updates and local operations
- [**The Agentic Cycle**](../agentic-cycle) enables multi-step reasoning and complex workflows
- [**Server Tools**](./server-tools) execute securely on the backend with automatic handling
- [**Client Tools**](./client-tools) execute in the browser for UI updates and local operations
- [**The Agentic Cycle**](./agentic-cycle) enables multi-step reasoning and complex workflows
- [**Tool States**](#call-states) provide real-time feedback and enable robust UIs
- [**Approval Flow**](#approval-flow) gives users control over sensitive operations
This architecture enables building sophisticated AI applications that can:
Expand Down Expand Up @@ -377,9 +377,9 @@ All execute simultaneously, then LLM generates comparison.

## Next Steps

- [Tools Overview](../tools) - Basic tool concepts and examples
- [Server Tools](../server-tools) - Deep dive into server-side tools
- [Client Tools](../client-tools) - Deep dive into client-side tools
- [Tool Approval Flow](../tool-approval) - Implementing approval workflows
- [Stream Chunk Definitions](../../protocol/chunk-definitions) - Understanding the streaming protocol
- [Tools Overview](./tools) - Basic tool concepts and examples
- [Server Tools](./server-tools) - Deep dive into server-side tools
- [Client Tools](./client-tools) - Deep dive into client-side tools
- [Tool Approval Flow](./tool-approval) - Implementing approval workflows
- [Stream Chunk Definitions](../protocol/chunk-definitions) - Understanding the streaming protocol

8 changes: 4 additions & 4 deletions docs/guides/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ Tools go through different states during execution:

## Next Steps

- [Server Tools](../server-tools) - Learn about server-side tool execution
- [Client Tools](../client-tools) - Learn about client-side tool execution
- [Tool Approval Flow](../tool-approval) - Implement approval workflows
- [How Tools Work](../tool-architecture) - Deep dive into the tool architecture
- [Server Tools](./server-tools) - Learn about server-side tool execution
- [Client Tools](./client-tools) - Learn about client-side tool execution
- [Tool Approval Flow](./tool-approval) - Implement approval workflows
- [How Tools Work](./tool-architecture) - Deep dive into the tool architecture
6 changes: 3 additions & 3 deletions docs/protocol/chunk-definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,6 @@ function handleChunk(chunk: StreamChunk) {

## See Also

- [SSE Protocol](../sse-protocol) - How chunks are transmitted via Server-Sent Events
- [HTTP Stream Protocol](../http-stream-protocol) - How chunks are transmitted via HTTP streaming
- [Connection Adapters Guide](../../guides/connection-adapters) - Client implementation
- [SSE Protocol](./sse-protocol) - How chunks are transmitted via Server-Sent Events
- [HTTP Stream Protocol](./http-stream-protocol) - How chunks are transmitted via HTTP streaming
- [Connection Adapters Guide](../guides/connection-adapters) - Client implementation
6 changes: 3 additions & 3 deletions docs/protocol/http-stream-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ This makes streams compatible with standard NDJSON tools and libraries.

## See Also

- [Chunk Definitions](../chunk-definitions) - StreamChunk type reference
- [SSE Protocol](../sse-protocol) - Recommended protocol (with auto-reconnect)
- [Connection Adapters Guide](../../guides/connection-adapters) - Client implementation
- [Chunk Definitions](./chunk-definitions) - StreamChunk type reference
- [SSE Protocol](./sse-protocol) - Recommended protocol (with auto-reconnect)
- [Connection Adapters Guide](../guides/connection-adapters) - Client implementation
- [JSON Lines Specification](http://jsonlines.org/)
- [NDJSON Specification](http://ndjson.org/)
6 changes: 3 additions & 3 deletions docs/protocol/sse-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ data: [DONE]

## See Also

- [Chunk Definitions](../chunk-definitions) - StreamChunk type reference
- [HTTP Stream Protocol](../http-stream-protocol) - Alternative protocol
- [Connection Adapters Guide](../../guides/connection-adapters) - Client implementation
- [Chunk Definitions](./chunk-definitions) - StreamChunk type reference
- [HTTP Stream Protocol](./http-stream-protocol) - Alternative protocol
- [Connection Adapters Guide](../guides/connection-adapters) - Client implementation
- [MDN: Server-Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events)
44 changes: 22 additions & 22 deletions docs/reference/classes/BaseAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ Generic parameters:

### TModelInputModalitiesByName

`TModelInputModalitiesByName` *extends* `Record`\<`string`, `ReadonlyArray`\<[`Modality`](../../type-aliases/Modality.md)\>\> = `Record`\<`string`, `ReadonlyArray`\<[`Modality`](../../type-aliases/Modality.md)\>\>
`TModelInputModalitiesByName` *extends* `Record`\<`string`, `ReadonlyArray`\<[`Modality`](../type-aliases/Modality.md)\>\> = `Record`\<`string`, `ReadonlyArray`\<[`Modality`](../type-aliases/Modality.md)\>\>

### TMessageMetadataByModality

`TMessageMetadataByModality` *extends* `object` = [`DefaultMessageMetadataByModality`](../../interfaces/DefaultMessageMetadataByModality.md)
`TMessageMetadataByModality` *extends* `object` = [`DefaultMessageMetadataByModality`](../interfaces/DefaultMessageMetadataByModality.md)

## Implements

- [`AIAdapter`](../../interfaces/AIAdapter.md)\<`TChatModels`, `TEmbeddingModels`, `TChatProviderOptions`, `TEmbeddingProviderOptions`, `TModelProviderOptionsByName`, `TModelInputModalitiesByName`, `TMessageMetadataByModality`\>
- [`AIAdapter`](../interfaces/AIAdapter.md)\<`TChatModels`, `TEmbeddingModels`, `TChatProviderOptions`, `TEmbeddingProviderOptions`, `TModelProviderOptionsByName`, `TModelInputModalitiesByName`, `TMessageMetadataByModality`\>

## Constructors

Expand All @@ -66,7 +66,7 @@ Defined in: [base-adapter.ts:69](https://github.com/TanStack/ai/blob/main/packag

##### config

[`AIAdapterConfig`](../../interfaces/AIAdapterConfig.md) = `{}`
[`AIAdapterConfig`](../interfaces/AIAdapterConfig.md) = `{}`

#### Returns

Expand All @@ -84,7 +84,7 @@ Defined in: [base-adapter.ts:60](https://github.com/TanStack/ai/blob/main/packag

#### Implementation of

[`AIAdapter`](../../interfaces/AIAdapter.md).[`_chatProviderOptions`](../../interfaces/AIAdapter.md#_chatprovideroptions)
[`AIAdapter`](../interfaces/AIAdapter.md).[`_chatProviderOptions`](../interfaces/AIAdapter.md#_chatprovideroptions)

***

Expand All @@ -98,7 +98,7 @@ Defined in: [base-adapter.ts:61](https://github.com/TanStack/ai/blob/main/packag

#### Implementation of

[`AIAdapter`](../../interfaces/AIAdapter.md).[`_embeddingProviderOptions`](../../interfaces/AIAdapter.md#_embeddingprovideroptions)
[`AIAdapter`](../interfaces/AIAdapter.md).[`_embeddingProviderOptions`](../interfaces/AIAdapter.md#_embeddingprovideroptions)

***

Expand All @@ -115,7 +115,7 @@ Used to provide type-safe autocomplete for metadata on content parts.

#### Implementation of

[`AIAdapter`](../../interfaces/AIAdapter.md).[`_messageMetadataByModality`](../../interfaces/AIAdapter.md#_messagemetadatabymodality)
[`AIAdapter`](../interfaces/AIAdapter.md).[`_messageMetadataByModality`](../interfaces/AIAdapter.md#_messagemetadatabymodality)

***

Expand All @@ -133,7 +133,7 @@ Must be provided by all adapters.

#### Implementation of

[`AIAdapter`](../../interfaces/AIAdapter.md).[`_modelInputModalitiesByName`](../../interfaces/AIAdapter.md#_modelinputmodalitiesbyname)
[`AIAdapter`](../interfaces/AIAdapter.md).[`_modelInputModalitiesByName`](../interfaces/AIAdapter.md#_modelinputmodalitiesbyname)

***

Expand All @@ -151,7 +151,7 @@ Must be provided by all adapters.

#### Implementation of

[`AIAdapter`](../../interfaces/AIAdapter.md).[`_modelProviderOptionsByName`](../../interfaces/AIAdapter.md#_modelprovideroptionsbyname)
[`AIAdapter`](../interfaces/AIAdapter.md).[`_modelProviderOptionsByName`](../interfaces/AIAdapter.md#_modelprovideroptionsbyname)

***

Expand All @@ -165,7 +165,7 @@ Defined in: [base-adapter.ts:59](https://github.com/TanStack/ai/blob/main/packag

#### Implementation of

[`AIAdapter`](../../interfaces/AIAdapter.md).[`_providerOptions`](../../interfaces/AIAdapter.md#_provideroptions)
[`AIAdapter`](../interfaces/AIAdapter.md).[`_providerOptions`](../interfaces/AIAdapter.md#_provideroptions)

***

Expand All @@ -191,7 +191,7 @@ Models that support embeddings

#### Implementation of

[`AIAdapter`](../../interfaces/AIAdapter.md).[`embeddingModels`](../../interfaces/AIAdapter.md#embeddingmodels)
[`AIAdapter`](../interfaces/AIAdapter.md).[`embeddingModels`](../interfaces/AIAdapter.md#embeddingmodels)

***

Expand All @@ -207,7 +207,7 @@ Models that support chat/text completion

#### Implementation of

[`AIAdapter`](../../interfaces/AIAdapter.md).[`models`](../../interfaces/AIAdapter.md#models)
[`AIAdapter`](../interfaces/AIAdapter.md).[`models`](../interfaces/AIAdapter.md#models)

***

Expand All @@ -221,7 +221,7 @@ Defined in: [base-adapter.ts:53](https://github.com/TanStack/ai/blob/main/packag

#### Implementation of

[`AIAdapter`](../../interfaces/AIAdapter.md).[`name`](../../interfaces/AIAdapter.md#name)
[`AIAdapter`](../interfaces/AIAdapter.md).[`name`](../interfaces/AIAdapter.md#name)

## Methods

Expand All @@ -237,15 +237,15 @@ Defined in: [base-adapter.ts:73](https://github.com/TanStack/ai/blob/main/packag

##### options

[`ChatOptions`](../../interfaces/ChatOptions.md)
[`ChatOptions`](../interfaces/ChatOptions.md)

#### Returns

`AsyncIterable`\<[`StreamChunk`](../../type-aliases/StreamChunk.md)\>
`AsyncIterable`\<[`StreamChunk`](../type-aliases/StreamChunk.md)\>

#### Implementation of

[`AIAdapter`](../../interfaces/AIAdapter.md).[`chatStream`](../../interfaces/AIAdapter.md#chatstream)
[`AIAdapter`](../interfaces/AIAdapter.md).[`chatStream`](../interfaces/AIAdapter.md#chatstream)

***

Expand All @@ -261,15 +261,15 @@ Defined in: [base-adapter.ts:78](https://github.com/TanStack/ai/blob/main/packag

##### options

[`EmbeddingOptions`](../../interfaces/EmbeddingOptions.md)
[`EmbeddingOptions`](../interfaces/EmbeddingOptions.md)

#### Returns

`Promise`\<[`EmbeddingResult`](../../interfaces/EmbeddingResult.md)\>
`Promise`\<[`EmbeddingResult`](../interfaces/EmbeddingResult.md)\>

#### Implementation of

[`AIAdapter`](../../interfaces/AIAdapter.md).[`createEmbeddings`](../../interfaces/AIAdapter.md#createembeddings)
[`AIAdapter`](../interfaces/AIAdapter.md).[`createEmbeddings`](../interfaces/AIAdapter.md#createembeddings)

***

Expand Down Expand Up @@ -299,12 +299,12 @@ Defined in: [base-adapter.ts:75](https://github.com/TanStack/ai/blob/main/packag

##### options

[`SummarizationOptions`](../../interfaces/SummarizationOptions.md)
[`SummarizationOptions`](../interfaces/SummarizationOptions.md)

#### Returns

`Promise`\<[`SummarizationResult`](../../interfaces/SummarizationResult.md)\>
`Promise`\<[`SummarizationResult`](../interfaces/SummarizationResult.md)\>

#### Implementation of

[`AIAdapter`](../../interfaces/AIAdapter.md).[`summarize`](../../interfaces/AIAdapter.md#summarize)
[`AIAdapter`](../interfaces/AIAdapter.md).[`summarize`](../interfaces/AIAdapter.md#summarize)
Loading
Loading