XWorker is suitable for writing symbiotic systems of human-computer collaboration, that is, systems that can be modified by humans and AI together.
Attribute Name | Type | Description |
---|---|---|
ai_needGenerate | Boolean | Marks whether content needs to be generated. When the value is true, the AI generation task is executed |
ai_promptContainsVars | Boolean | Controls whether the prompt word contains context variables (such as SWT button event variables in the Groovy script model) |
ai_content_attribute | String | Specify the name of the attribute that stores the AI generated results |
ai_promptSystem | String | System-level role prompt words, placed at the beginning of the role=system message |
ai_promptRequirement | String | User requirement description, placed in the middle of the role=system message |
ai_getPromptFormat | String | Output format requirements, placed at the end of the role=system message |
boolean ai_isNeedGenerate()
ai_needGenerate
attributevoid ai_generate()
ai_isNeedGenerate()
returns true, it is triggeredai_onResult(content)
processingString ai_getPrompt()
System prompt + user requirements + format requirements + variable inclusion identifier
String ai_getPromptSystem()
ai_promptSystem
value
String ai_getPromptRequirement()
ai_promptRequirement
value
String ai_getPromptFormat()
ai_getPromptFormat
value
void ai_onResult(String content)
ai_content_attribute
ChatService ai_getChatService()
String ai_getContent()
ai_content_attribute
specifies the value of the attribute
Applicable scenarios: Multi-level content generation (such as novel generation system)
Execution process:
ai_isNeedGenerate()
ai_generate()
Applicable scenarios: Single node content modification
Interaction process:
ai_getPrompt()
ai_getContent()
ai_onResult()
to save the resultThis solution achieves deep integration of AI capabilities by extending the metamodel, supporting two modes: fully automatic generation and interactive editing. Developers can flexibly customize AI behaviors through attribute configuration and method rewriting.
ai_generate()
ai_promptContainsVars=true
ai_getChatService()
Copyright © 2007-2019 XWorker.org 版权所有 沪ICP备08000575号