Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Conversation

@SamSaffron
Copy link
Member

@SamSaffron SamSaffron commented Nov 5, 2024

This is a significant PR that introduces AI Artifacts functionality to the discourse-ai plugin along with several other improvements. Here are the key changes:

  1. AI Artifacts System:

    • Adds a new AiArtifact model and database migration
    • Allows creation of web artifacts with HTML, CSS, and JavaScript content
    • Introduces security settings (strict, lax, disabled) for controlling artifact execution
    • Implements artifact rendering in iframes with sandbox protection
    • New CreateArtifact tool for AI to generate interactive content
  2. Tool System Improvements:

    • Adds support for partial tool calls, allowing incremental updates during generation
    • Better handling of tool call states and progress tracking
    • Improved XML tool processing with CDATA support
    • Fixes for tool parameter handling and duplicate invocations
  3. LLM Provider Updates:

    • Updates for Anthropic Claude models with correct token limits
    • Adds support for native/XML tool modes in Gemini integration
    • Adds new model configurations including Llama 3.1 models
    • Improvements to streaming response handling
  4. UI Enhancements:

    • New artifact viewer component with expand/collapse functionality
    • Security controls for artifact execution (click-to-run in strict mode)
    • Improved dialog and response handling
    • Better error management for tool execution
  5. Security Improvements:

    • Sandbox controls for artifact execution
    • Public/private artifact sharing controls
    • Security settings to control artifact behavior
    • CSP and frame-options handling for artifacts
  6. Technical Improvements:

    • Better post streaming implementation
    • Improved error handling in completions
    • Better memory management for partial tool calls
    • Enhanced testing coverage
  7. Configuration:

    • New site settings for artifact security
    • Extended LLM model configurations
    • Additional tool configuration options

This PR significantly enhances the plugin's capabilities for generating and displaying interactive content while maintaining security and providing flexible configuration options for administrators.

Initial implementation of an artifact system which allows users
to generate HTML pages directly from the AI persona.

FEATURE: support tool progress callbacks

This is anthropic only for now, but we can get a callback as tool
is completing, this gives us the ability to show progress to user
as the function is populating.

work in progress

Revert "work in progress"

This reverts commit 30ebe56.

Revert "FEATURE: support tool progress callbacks"

This reverts commit fd7ccfd.
- post streamer ensures we don't have half completed stuff on screen when a tool is slow
- reimplemnt xml tools to have a more relaxed parse
@SamSaffron SamSaffron marked this pull request as ready for review November 17, 2024 21:46
@SamSaffron SamSaffron merged commit 0d7f353 into main Nov 18, 2024
6 checks passed
@SamSaffron SamSaffron deleted the artifacts branch November 18, 2024 22:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants