syaOS syaOS / Docs
GitHub Launch

AI System

Multi-provider AI with tool calling support and streaming responses.

Providers

ProviderSDKModels
OpenAI@ai-sdk/openaigpt-5, gpt-5.1, gpt-5-mini, gpt-4o, gpt-4.1, gpt-4.1-mini
Anthropic@ai-sdk/anthropicclaude-4.5, claude-4, claude-3.7, claude-3.5
Google@ai-sdk/googlegemini-2.5-pro, gemini-2.5-flash, gemini-3-pro-preview

Default model: gpt-5.1

graph TD
    A[User Message] --> B[Chat API]
    B --> C{Provider Selection}
    C -->|OpenAI| D[GPT Models]
    C -->|Anthropic| E[Claude Models]
    C -->|Google| F[Gemini Models]
    D --> G[AI SDK Stream]
    E --> G
    F --> G
    G --> H[Response Handler]
    H --> I[UI Update]

Available Tools

ToolDescription
launchAppOpen applications (with Internet Explorer time-travel support)
closeAppClose applications
ipodControlMusic playback: toggle/play/pause/playKnown/addAndPlay/next/previous, video mode, fullscreen, lyrics translation
karaokeControlKaraoke playback (shared library with iPod, independent playback state)
generateHtmlCreate HTML applets with title and emoji icon
aquariumRender interactive emoji aquarium in chat
listList VFS items: /Applets, /Documents, /Applications, /Music, /Applets Store
openOpen files/apps from virtual file system
readRead file contents (applets, documents, store items)
writeCreate/modify markdown documents (overwrite/append/prepend modes)
editEdit existing files with precise text replacement
searchSongsSearch YouTube for songs (with API key rotation)
settingsChange language, theme, volume, speech, check for updates

API Endpoints

EndpointPurpose
/api/chatMain chat with streaming and tool calling
/api/applet-aiApplet AI assistant and image generation
/api/ie-generateInternet Explorer time-travel
/api/speechText-to-speech synthesis
/api/audio-transcribeAudio transcription

Architecture

sequenceDiagram
    participant U as User
    participant C as Chat UI
    participant A as AI Provider
    participant T as Tool Handler
    participant S as System

    U->>C: Send message
    C->>A: Stream request
    A->>A: Process message
    A-->>C: Tool call (e.g., launchApp)
    C->>T: Execute tool
    T->>S: Perform action
    S-->>T: Result
    T-->>A: Tool result
    A-->>C: Final response
    C-->>U: Display result

Tool Handlers

Tool handlers in src/apps/chats/tools/ follow a registry pattern:

System Prompts

Defined in _api/_utils/aiPrompts.ts:

  • CORE_PRIORITY_INSTRUCTIONS - Persona adherence rules
  • RYO_PERSONA_INSTRUCTIONS - Ryo's identity and background
  • ANSWER_STYLE_INSTRUCTIONS - Response style and tone
  • CODE_GENERATION_INSTRUCTIONS - HTML applet generation rules
  • CHAT_INSTRUCTIONS - Chat behavior and nudge handling
  • TOOL_USAGE_INSTRUCTIONS - VFS and tool usage patterns