Positron recording action
Oxygen general issues.
-
- Posts: 13
- Joined: Wed Mar 01, 2023 5:45 pm
Positron recording action
I am trying to create a custom positron action using the record feature. The action should read the current topic and add keywords that are applicable from an approved list. My recording did not work. Here is the json file that was created.
I appreciate any help that I can get
Code: Select all
[ {
"id" : "add.approved.terms",
"title" : "Add approved terms",
"input-type" : "markup",
"type" : "replace-selection-with-fragment",
"description" : "Use this action to insert index terms from the approved list",
"context" : "${contextInfo} Read through the file and only add index terms from the list below if they are applicable. Here is the list of approved index terms:\noperation\nwarranty\nraider\nhibiscus\nflower",
"examples" : [ {
"prompt" : "",
"completion" : "<prolog> <metadata> <keywords> <indexterm>operation</indexterm> <indexterm>warranty</indexterm> </keywords> </metadata> </prolog>"
} ]
} ]
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Positron recording action
Post by alex_jitianu »
Hi,
I've changed the action a bit. I've used different terms, to help me understand if the response is correct.
Best regards,
Alex
I've changed the action a bit. I've used different terms, to help me understand if the response is correct.
Code: Select all
[ {
"id" : "add.approved.terms",
"title" : "Add approved terms",
"input-type" : "markup",
"type" : "insert-schema-aware-fragment",
"description" : "Use this action to insert index terms from the approved list",
"context" : "${contextInfo} Read through the file and add index terms from the list below only if they are applicable on the text. Here is the list of approved index terms:\nengine\nrepair\nwarranty\nflower",
"examples" : [
{
"prompt" : "Engine repairs require skilled expertise to diagnose and fix underlying issues efficiently. Regular maintenance and timely engine repairs can extend the lifespan and enhance the performance of your vehicle.",
"completion" : "<prolog><metadata><keywords><indexterm>engine</indexterm><indexterm>repair</indexterm></keywords></metadata></prolog>"
} ,
{
"prompt" : "A product warranty is a promise made by the manufacturer or seller to repair or replace a product if it becomes faulty or fails to meet certain standards within a specified period.",
"completion" : "<prolog><metadata><keywords><indexterm>warranty</indexterm></keywords></metadata></prolog>"
} ,
{
"prompt" : "Flowers are nature's delicate masterpieces that breathe life and beauty into our surroundings. Their vibrant colors and enchanting fragrances have the power to uplift our spirits and bring joy to any occasion. ",
"completion" : "<prolog><metadata><keywords><indexterm>flower</indexterm></keywords></metadata></prolog>"
}
]
} ]
Alex
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Positron recording action
Post by alex_jitianu »
Hi,
Actually, one example is enough. The value of the example in this case is to make him understand how to structure the response so from that perspective we don't need more than one. I'm not sure why I kept three of them in my first example!
Best regards,
Alex
Actually, one example is enough. The value of the example in this case is to make him understand how to structure the response so from that perspective we don't need more than one. I'm not sure why I kept three of them in my first example!

Best regards,
Alex
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Positron recording action
Post by alex_jitianu »
Hi,
Once you save the json in the location from where the actions are loaded you should have content completion for property names and values. I will more details in the documentation, but refering to the "type" property, I would say that the most useful ones are:
-"replace-selection-with-fragment"
-"insert-schema-aware-fragment" - inserts the response as specified in "insert-modes"
Once you save the json in the location from where the actions are loaded you should have content completion for property names and values. I will more details in the documentation, but refering to the "type" property, I would say that the most useful ones are:
-"replace-selection-with-fragment"
-"insert-schema-aware-fragment" - inserts the response as specified in "insert-modes"
Code: Select all
{
"id": "generate.shortdescription",
"title": "Shortdesc",
"type": "insert-schema-aware-fragment",
"context": "Generate a short description",
"insert-modes": [{
"target-location": "/topic/title",
"action": "insert-after"
}]
}
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service