Configuring the AI Service Using a JSON File

Post here questions and problems related to bundled or custom AI actions, connectors and in general configuring and working with the AI Positron Assistant add-ons.
jeff_hooker
Posts: 25
Joined: Tue Jun 11, 2019 9:01 pm

Configuring the AI Service Using a JSON File

Post by jeff_hooker »

I've found these instructions: https://www.oxygenxml.com/doc/ug-positr ... -file.html
But I can find no way of applying them with a service configured as shown in the attached screen shot: is it even possible?
AI service.png
You do not have the required permissions to view the files attached to this post.
Cosmin Duna
Site Admin
Posts: 127
Joined: Wed Dec 12, 2018 5:33 pm

Re: Configuring the AI Service Using a JSON File

Post by Cosmin Duna »

Hello,
Yes, it is possible, but it only applies to that specific configuration mechanism. The JSON file must match the schema expected by Oxygen and be placed in the right location; otherwise Oxygen won’t load it and the Preferences UI remains unchanged.

A few key points:
  • The JSON file (typically named ai-service-configuration.json) must be placed in the AI Positron add‑on installation directory. This is the exact directory shown in Preferences > Plugins > Oxygen AI Positron Assistant Enterprise > Location, as described in the documentation. If it’s placed elsewhere, Oxygen will not pick it up.
  • When the JSON file is detected and valid, the AI service configuration preferences are hidden because the add‑on has been fully configured from the file. That means you won’t see the standard preferences UI for that service once it’s been applied. This is expected behaviour.
  • If your JSON file has syntax errors or doesn’t conform exactly to the expected format, Oxygen will ignore it and the AI Service Configuration preferences page will remain visible. For that reason, open your JSON file directly in Oxygen XML Editor and validate it — Oxygen will report any errors, and invalid JSON is the most common reason the automatic configuration doesn’t work.
If AI Service Configuration preferences page is still visible, then it probably means exactly one of the following:
  • The JSON file wasn’t placed in the correct directory.
  • The JSON file is not valid (syntax or structure) and therefore not loaded.
  • The file uses the wrong name or doesn’t match the documented schema.
You should verify the file location and then open it in Oxygen itself to see if there are validation errors. Once that file is correctly placed and syntactically correct, Oxygen will automatically apply it on startup and hide the manual configuration UI.

Best regards,
Cosmin
Cosmin Duna
<oXygen/> XML Editor
http://www.oxygenxml.com
mpaluch
Posts: 2
Joined: Fri May 20, 2022 9:42 pm

Re: Configuring the AI Service Using a JSON File

Post by mpaluch »

Hi,
I have a couple follow up questions about using the JSON file.

1) Is it possible to embed the encrypted API key and seed directly into the JSON file itself, instead of needing to publish it? The Key Encryption add-on page (https://www.oxygenxml.com/doc/ug-positr ... addon.html) mentions "ai_key_param_encrypted" and "ai_key_param_seed" parameters, without "_url".

2) Is it possible to specify multiple connections? We have several models available to us as separate deployments. I'm able to manually add all of these using the preferences menu, but I can't find a way to do this with the JSON file.

Thanks,
Marcin Paluch
Cosmin Duna
Site Admin
Posts: 127
Joined: Wed Dec 12, 2018 5:33 pm

Re: Configuring the AI Service Using a JSON File

Post by Cosmin Duna »

Hi,

1. Unfortunately, it is not currently possible to embed the encrypted API key and seed directly inside the JSON file.
As a workaround, you can reference local files via a URL using the file:// protocol. For example: file://C:\encrypted_key.txt
This allows you to avoid publishing the key while still keeping it external to the JSON configuration.

2. At the moment, it is not possible to define multiple connections within a single JSON configuration file. We understand this limitation, especially when working with multiple model deployments.
Support for multiple connections via JSON will be available in an upcoming Positron release.

Please let us know if you need any additional details or assistance.

Best regards,
Cosmin
Cosmin Duna
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply