VisualNEO Win Plugin Manual

neoAI 1.1.4

Version:1.1.4
Suite:VisualNEO Automation & AI Suite (Commercial)
Category:AI / Chat, Vision & Generation

neoAI connects VisualNEO Win publications to the OpenRouter API. It provides chat, vision, structured output, in-memory conversations, image and video generation, model discovery, embeddings, media downloads, and non-blocking callbacks.

Requirements

  • VisualNEO Win with Modern Plugin API v1 support.
  • Windows 32-bit or 64-bit. The plugin module itself is Win32 x86.
  • Internet access and an OpenRouter API key for authenticated requests.
  • Sufficient OpenRouter credit for the selected model and operation.

Model availability, capabilities, prices, and accepted parameters change over time. Use the catalog actions instead of assuming that a model supports chat, vision, images, video, or embeddings.

Installation

  1. Install com.visualneo.neoai.vnplugin from VisualNEO Win.
  2. Restart VisualNEO Win if an older neoAI version is already loaded.
  3. Configure an API key before making an authenticated request.

Never distribute a plain API key inside a .pub file. Prefer an environment variable during development or a Windows DPAPI file for a deployed application.

Quick Start

TEXT
. Configure the API key for this process.
neoAISetApiKey "[ApiKey]" "https://example.com" "My VisualNEO App"

. Send one chat request.
neoAIChat "openrouter/auto" "[UserPrompt]" "You are concise." "0.7" "0" "[AIResponse]" "[AIReasoning]" "[AIUsage]"

The model ID above is only an example. Call neoAIGetModels to obtain the current catalog.

Configuration and Key Protection

ActionPurpose
neoAISetApiKeySets a plain API key in process memory and optional OpenRouter attribution headers.
neoAISetEncryptedApiKeyDecrypts a password-encrypted Base64 value into process memory.
neoAIEncryptKeyCreates the Base64 value consumed by neoAISetEncryptedApiKey.
neoAISaveKeySecureProtects a key with Windows DPAPI and writes it to a file.
neoAILoadKeySecureLoads a DPAPI file, configures the key, and optionally returns it.
neoAISetApiKeyFromEnvReads a key from an environment variable; the default is OPENROUTER_API_KEY.
neoAISetBaseUrlChanges the OpenAI-compatible base URL or proxy endpoint.
neoAISetTimeoutSets connection, response, and synchronous video polling limits in seconds.

DPAPI binds protected data to the current Windows user account. The password-based helper is portable obfuscation and does not authenticate ciphertext; it is less suitable than DPAPI or an external secret store for production secrets.

Chat and Vision

ActionPurpose
neoAIChatSends a text prompt and returns assistant text, optional reasoning, and usage JSON.
neoAIChatAdvancedSends a complete JSON payload to /chat/completions.
neoAIChatVisionSends a local image, data URL, or web image URL to a vision-capable model.
neoAIChatStructuredRequests a JSON object or a strict JSON Schema result from a compatible model.

neoAIChatVision accepts PNG, JPEG, WebP, and GIF files. A local file is encoded as a data URL before transmission. Support for each image type and structured output depends on the selected model and provider.

JSON
{
  "model": "openrouter/auto",
  "messages": [
    { "role": "user", "content": "Summarize this text." }
  ],
  "temperature": 0.2
}

Conversational Sessions

ActionPurpose
neoAISessionCreateCreates or resets a named in-memory conversation with an optional system prompt.
neoAISessionSendAdds a user message, sends the stored history, and stores the assistant response.
neoAISessionGetHistoryReturns the session messages as JSON.
neoAISessionClearDeletes a named session.
neoAISessionSendAsyncSends a session message in the background and invokes a subroutine.

Sessions exist only while the plugin remains loaded. They are not written to disk. Each session retains at most 100 messages to prevent unbounded memory growth.

Images and Media

ActionPurpose
neoAIGenerateImageGenerates an image and optionally saves it to a local file.
neoAIGenerateImageAsyncPerforms image generation on a worker thread and invokes a subroutine.
neoAIGenerateVideoSubmits a video job, polls until completion or timeout, and optionally downloads it.
neoAISubmitVideoSubmits a video job immediately and returns its job ID and status JSON.
neoAIGetVideoStatusPolls a submitted job and returns completion, URL, and full status JSON.
neoAIDownloadMediaSaves an HTTP(S) URL or Base64 data URL to disk.

Image output can be raster data or SVG, depending on the model. The returned URL may therefore be a large data: URL. When a destination path is supplied, neoAI decodes the payload directly to that file.

Video generation is asynchronous at the service level. Prefer this responsive pattern:

TEXT
. Start the billable job without waiting.
neoAISubmitVideo "google/veo-3.1" "A sunrise over a quiet lake" "{`"duration`":8,`"aspect_ratio`":`"16:9`"}" "[VideoJobId]" "[VideoStatusJson]"

. Call this later from a timer or button until [VideoComplete] is True.
neoAIGetVideoStatus "[VideoJobId]" "[VideoComplete]" "[VideoUrl]" "[VideoStatusJson]"

. Download only after completion.
neoAIDownloadMedia "[VideoUrl]" "[PubDir]generated-video.mp4" "[DownloadSuccess]"

Submitting image or video generation can spend account credit. Validate the model and options before calling the action.

Models, Account, and Usage

ActionPurpose
neoAIGetAccountInfoReturns key limits and usage information as JSON.
neoAIGetModelsReturns the general model catalog, optionally filtered by provider text.
neoAIGetImageModelsReturns image-generation models and capability descriptors.
neoAIGetVideoModelsReturns video-generation models and capability descriptors.
neoAIGetEmbeddingModelsReturns embedding models and metadata.
neoAIGetGenerationStatsReturns cost and token statistics for a generation ID.

Catalog output is raw JSON so it can be processed with VisualNEO JSON actions. An empty provider filter in neoAIGetModels returns the complete general catalog.

Embeddings

neoAIEmbeddings converts text into a numerical vector and returns the complete API response as JSON. Embeddings are useful for semantic search, clustering, recommendations, and retrieval-augmented generation. Store and compare vectors outside the plugin; neoAI does not include a vector database.

Asynchronous Actions

ActionPurpose
neoAIChatAsyncRuns one chat request in the background and invokes a NeoScript subroutine. Its optional final parameter limits output tokens; use 0 for the model default.
neoAISessionSendAsyncRuns a session request in the background and invokes a subroutine.
neoAIGenerateImageAsyncGenerates an image in the background and invokes a subroutine.
neoAIIsBusyReturns True while a background request is active.
neoAICancelRequests cooperative cancellation of the active background operation.

Only one neoAI background action runs at a time. Results are marshalled to the VisualNEO UI thread through a private Win32 message window. Cancellation suppresses the callback and stops video polling, but an HTTP request already being processed by Windows cannot always be interrupted immediately.

TEXT
. Start the request; this action returns immediately.
neoAIChatAsync "openrouter/auto" "[Question]" "OnAIResponse" "[AIResponse]" "[AIUsage]" "[AIStarted]" "0"
Return

:OnAIResponse
. The plugin has already updated [AIResponse] and [AIUsage].
SetVar "[StatusText]" "Complete"
Return

Error Handling

  • Simple chat, vision, image, and video actions place HTTP error details in their normal output variable.
  • Raw JSON actions return the service response, including its error object when present.
  • neoAIGetVideoStatus returns False until the job reports completed; inspect the status JSON to distinguish pending and failed jobs.
  • Confirm required variables and paths before making a request.
  • Use neoAISetTimeout for slow providers and high-resolution media jobs.

Included Examples

PublicationDemonstrates
01-Hello-AI-QuickStart.pubAPI-key setup and basic chat.
02-Multi-Provider-Assistant.pubModel, system prompt, and temperature parameters.
03-Async-Chatbot-Callback.pubA non-blocking request and callback subroutine.
04-Vision-Image-Analysis.pubLocal and remote image analysis.
05-Image-and-Media-Generator.pubImage generation and local saving.
06-Semantic-Search-Embeddings.pubEmbedding response generation.
neoAI-demo.pubCompact action overview.

Privacy and Deployment

Prompts, images, and generated content are transmitted to OpenRouter and the selected upstream provider. Review their current privacy, retention, and pricing policies before processing confidential data. neoAI does not log requests itself, but output variables and publication logic may retain returned content.

For deployment, use a restricted key where possible, avoid exposing it through visible variables, and do not treat client-side encryption as a substitute for a server-side secret boundary.