Skip to content

Add AI extension by KimosFrontender#2545

Closed
kms413 wants to merge 2 commits into
TurboWarp:masterfrom
kms413:master
Closed

Add AI extension by KimosFrontender#2545
kms413 wants to merge 2 commits into
TurboWarp:masterfrom
kms413:master

Conversation

@kms413

@kms413 kms413 commented Jun 25, 2026

Copy link
Copy Markdown

Statement on AI Use

The code in this extension was partially drafted with the help of AI (DeepSeek) to accelerate development. All AI-generated portions have been thoroughly reviewed, tested, and fixed by human developers. I take full responsibility for the final code, which has been validated through multiple rounds of testing to ensure correctness, security, and compliance with the specification.

Description

Add a new AI extension that allows Scratch projects to chat with AI models using OpenAI-compatible and Anthropic-compatible APIs, with full streaming response support.

Extension Details

  • Name: AI
  • ID: ai
  • Slug: KimosFrontender/ai
  • Author: KimosFrontender
  • License: MIT

Features

  • Chat with AI models — Send messages and receive streaming responses in real-time
  • Multi-provider support — Works with both OpenAI-compatible and Anthropic-compatible API formats
  • 20+ built-in provider URLs — Pre-configured URLs for OpenAI, DeepSeek, Qwen, Kimi, GLM, Doubao, Gemini, Groq, Mistral, OpenRouter, and many more
  • Multi-chat management — Create and manage multiple independent chat sessions
  • AI presets — Define reusable configurations (API key, model, request URL, format) and assign them to chats
  • Data processing blocks — JSON manipulation utilities including object merging, array indexing, and property access
  • Stop generation — Abort in-progress streaming responses
  • Chat history editing — Programmatically read, write, and modify conversation histories

Blocks Overview

Category Examples
Chat Management Create/delete chats, assign AI presets, check status
AI Presets Create presets, set API key / model / URL / format
Common AI URLs Built-in reporter blocks for 20+ provider endpoints
Streaming Send message, stop message, get response, check idle
Data Processing JSON object/array manipulation, chat history editing

Files Included

File Purpose
extensions/KimosFrontender/ai.js Extension source code
images/KimosFrontender/ai.svg Extension cover image (600×300, 2:1 ratio)
samples/Ai.sb3 Sample project demonstrating the extension

Checklist

  • Extension code follows the gallery guidelines
  • Metadata comments are present
  • SPDX license identifier is valid (MIT)
  • Cover image has correct 2:1 aspect ratio
  • Extension added to extensions/extensions.json
  • Sample project references the correct extension URL
  • I have read the contribution guidelines

Notes

  • The extension uses the Scratch.fetch() API for making HTTP requests
  • Streaming responses use SSE (Server-Sent Events) parsing for both OpenAI and Anthropic formats
  • API keys are stored in AI presets and passed via request headers (Authorization: Bearer for OpenAI, x-api-key for Anthropic)

@kms413 kms413 requested a review from a team as a code owner June 25, 2026 11:46
@github-actions github-actions Bot added the pr: new extension Pull requests that add a new extension label Jun 25, 2026
@kms413

kms413 commented Jun 25, 2026

Copy link
Copy Markdown
Author

!format

@Brackets-Coder

Brackets-Coder commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

This can't me merged in accordance with the contributing guidlines. It relies on user-generated API keys stored in the project which is a major security concern and would allow anyone to retrieve the API key and bill the creator's credit card. Additionally, it also seems to rely on numerous third-parties, which may or may not be available depending on the internet connection or network configuration

Honestly, the only way I could see an AI chatbot actually being merged is if it runs offline, locally on the machine (no API key) via WebGPU, such as the following: https://huggingface.co/spaces/webml-community/gemma-4-webgpu-kernels

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: new extension Pull requests that add a new extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants