Insertion Location and External APIs
Posted: Thu May 15, 2025 6:39 am
Hello,
I've created a prompt and custom action that scans a DITA XML file for revisions and summarizes them inside a <briefing></briefing> tag. The summarization works well, but I'm having trouble with tag placement. I want the <briefing> tag inserted right after </prolog>, but despite various prompt tweaks, it defaults to the cursor location.
In the chat interface, the output usually appears where the cursor is prior to hitting send. When invoking the custom action, it often replaces the entire document, even when the prompt clearly says to preserve the existing content and only insert the new part. Has anyone been able to control XML tag placement reliably using either the chat interface or custom actions? For reference, I’ll share the custom action JSON here. However, the associated prompt Markdown file contains some sensitive content, so I’m not able to post it publicly. I’m happy to share it individually with anyone who’s actively helping or has relevant experience.
Unrelated, I'm also looking into whether a prompt or custom action can call an external REST API. For example, retrieving a file status and injecting that value into the output. Would it make more sense to handle that through Azure OpenAI with Prompt Flow making the API call and returning the value to Positron? Appreciate any tips or examples if you've tried something similar.
Additional Details:
XML Author 26.1, build 2024091606
Oxygen AI Positron Assistant Enterprise v5.0.0
Azure OpenAI 4o model
Thanks,
Ahmed Ali
I've created a prompt and custom action that scans a DITA XML file for revisions and summarizes them inside a <briefing></briefing> tag. The summarization works well, but I'm having trouble with tag placement. I want the <briefing> tag inserted right after </prolog>, but despite various prompt tweaks, it defaults to the cursor location.
In the chat interface, the output usually appears where the cursor is prior to hitting send. When invoking the custom action, it often replaces the entire document, even when the prompt clearly says to preserve the existing content and only insert the new part. Has anyone been able to control XML tag placement reliably using either the chat interface or custom actions? For reference, I’ll share the custom action JSON here. However, the associated prompt Markdown file contains some sensitive content, so I’m not able to post it publicly. I’m happy to share it individually with anyone who’s actively helping or has relevant experience.
Code: Select all
{
"id": "custom.create.briefing",
"title": "Create briefing",
"type": "replace-selection-with-fragment",
"input-type": "markup",
"prompt_ref": "create-briefing.md",
"parameters": {
"function_refs": [
{
"ref": "get_current_document_marked_up_content"
}
]
},
"additional_info": {
"input_content": "document",
"input_flavor": "line_numbers"
},
"embed-assist": true
}
Additional Details:
XML Author 26.1, build 2024091606
Oxygen AI Positron Assistant Enterprise v5.0.0
Azure OpenAI 4o model
Thanks,
Ahmed Ali