Update methodAi.py
This commit is contained in:
parent
4715f627be
commit
07fa13a357
1 changed files with 22 additions and 6 deletions
|
|
@ -60,7 +60,16 @@ class MethodAi(MethodBase):
|
|||
frontendOptions=["txt", "json", "md", "csv", "xml", "html", "pdf", "docx", "xlsx", "pptx", "png", "jpg"],
|
||||
required=False,
|
||||
default="txt",
|
||||
description="Output file extension. All output documents will use this format"
|
||||
description="Output file extension. Optional: if omitted, formats are determined from prompt by AI. Default \"txt\" is validation fallback only. With per-document format determination, AI can determine different formats for different documents based on prompt."
|
||||
),
|
||||
"generationIntent": WorkflowActionParameter(
|
||||
name="generationIntent",
|
||||
type="str",
|
||||
frontendType=FrontendType.SELECT,
|
||||
frontendOptions=["document", "code", "image"],
|
||||
required=False,
|
||||
default="document",
|
||||
description="Explicit generation intent (\"document\" | \"code\" | \"image\"). Required for DATA_GENERATE operations. Defaults to \"document\" if not provided. For code generation, use ai.generateCode action or explicitly pass generationIntent=\"code\". For IMAGE_GENERATE operations, this parameter is ignored."
|
||||
),
|
||||
"simpleMode": WorkflowActionParameter(
|
||||
name="simpleMode",
|
||||
|
|
@ -69,7 +78,14 @@ class MethodAi(MethodBase):
|
|||
required=False,
|
||||
default=False,
|
||||
description="If true, uses fast simple AI call without document generation pipeline. Use for chatbot responses and simple text generation."
|
||||
)
|
||||
),
|
||||
"contentParts": WorkflowActionParameter(
|
||||
name="contentParts",
|
||||
type="List[ContentPart]",
|
||||
frontendType=FrontendType.HIDDEN,
|
||||
required=False,
|
||||
description="Pre-extracted content parts (internal parameter, typically passed between actions). If provided, these will be used instead of extracting from documentList. Can be a list of ContentPart objects or an object with a 'parts' attribute."
|
||||
),
|
||||
},
|
||||
execute=process.__get__(self, self.__class__)
|
||||
),
|
||||
|
|
@ -274,7 +290,7 @@ class MethodAi(MethodBase):
|
|||
),
|
||||
"generateCode": WorkflowActionDefinition(
|
||||
actionId="ai.generateCode",
|
||||
description="Generate code files - explicitly sets intent to 'code'. If the prompt specifies file formats to deliver, include them in the prompt",
|
||||
description="Generate one or multiple code files in a single action - explicitly sets intent to 'code'. This action can generate multiple files (e.g., config.json, customers.json, settings.json) when the prompt requests multiple files. If the prompt specifies file formats to deliver, include them in the prompt. IMPORTANT: When the user requests multiple files (e.g., 'generate 3 JSON files'), use a SINGLE ai.generateCode action with a prompt that describes ALL requested files, rather than splitting into multiple actions.",
|
||||
dynamicMode=True,
|
||||
parameters={
|
||||
"prompt": WorkflowActionParameter(
|
||||
|
|
@ -282,7 +298,7 @@ class MethodAi(MethodBase):
|
|||
type="str",
|
||||
frontendType=FrontendType.TEXTAREA,
|
||||
required=True,
|
||||
description="Description of code to generate"
|
||||
description="Description of code to generate. If multiple files are requested, describe ALL files in this single prompt (e.g., 'Generate 3 JSON files: 1) config.json with..., 2) customers.json with..., 3) settings.json with...')."
|
||||
),
|
||||
"documentList": WorkflowActionParameter(
|
||||
name="documentList",
|
||||
|
|
@ -295,9 +311,9 @@ class MethodAi(MethodBase):
|
|||
name="resultType",
|
||||
type="str",
|
||||
frontendType=FrontendType.SELECT,
|
||||
frontendOptions=["py", "js", "ts", "html", "java", "cpp", "txt"],
|
||||
frontendOptions=["py", "js", "ts", "html", "java", "cpp", "txt", "json", "csv", "xml"],
|
||||
required=False,
|
||||
description="Output format (html, js, py, etc.). Optional: if omitted, formats are determined from prompt by AI. With per-document format determination, AI can determine different formats for different documents based on prompt."
|
||||
description="Output format (html, js, py, json, csv, xml, etc.). Optional: if omitted, formats are determined from prompt by AI. This action can return MULTIPLE files in a single call when the prompt requests multiple files. With per-document format determination, AI can determine different formats for different files based on prompt. When multiple files are requested, the action will return multiple documents (one per file)."
|
||||
)
|
||||
},
|
||||
execute=generateCode.__get__(self, self.__class__)
|
||||
|
|
|
|||
Loading…
Reference in a new issue