Skip to content

Port AI SDK React hook logic to MobX models - #4

Draft
TechQuery wants to merge 3 commits into
mainfrom
copilot/migrate-ai-api-logic-to-ai-sdk-mobx
Draft

TechQuery wants to merge 3 commits into
mainfrom
copilot/migrate-ai-api-logic-to-ai-sdk-mobx

Conversation

@TechQuery

@TechQuery TechQuery commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Port the stateful logic from @ai-sdk/react hooks into mobx-restful models. Each hook maps to a BaseModel subclass with observable state and corresponding request or streaming behavior.

  • Models: Add ChatModel, CompletionModel, ObjectModel, and RealtimeModel for useChat, useCompletion, useObject, and experimental_useRealtime.
  • Package API: Add public exports, AI SDK dependencies, and a TypeScript build configuration.
  • Object validation: Reflect validated output and schema errors in observable model state.
import { ChatModel, CompletionModel } from 'ai-sdk-mobx';

const chat = new ChatModel();
await chat.sendMessage({ text: 'Hello!' });

const completion = new CompletionModel();
await completion.complete('Write a greeting');

TechQuery and others added 2 commits November 15, 2026 13:36
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@TechQuery TechQuery changed the title [WIP] Migrate AI API logic to ai-sdk-mobx package Port AI SDK React hook logic to MobX models Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

向 AI-SDK-MobX 包移植 AI API 逻辑

2 participants