diff --git a/Project/Sources/Methods/AI Call.4dm b/Project/Sources/Methods/AI Call.4dm deleted file mode 100644 index 6b045a3..0000000 --- a/Project/Sources/Methods/AI Call.4dm +++ /dev/null @@ -1,86 +0,0 @@ -//%attributes = {"invisible":true,"shared":true} - - -#DECLARE($aiParameters : Object) - -var $openAI : cs:C1710.ai.openAI - -$openAI:=cs:C1710.ai.openAI.new($aiParameters.apiKey) // PRIVATE KEY - -var $formPrompt : Text -var $formVisionUrl : Text -var $function : Text - -var $textGenerationParam : Object -var $imageGenerationParam : Object -var $visionParam : Object -var $assistantCreationParam : Object -var $assistantListParam : Object -var $retrieveListParam : Object - -var $moderationResult : Collection -var $moderationFlag : Boolean -var $moderationCategories : Text - -var $assistantResult : Text -var $assistantFileUrl : Text - -var $alertResult : Text -var $assistant_info : Text - -var $threadParam : Object - -var $formInupt : Text - -//$formPrompt:=Form.prompt -//$formVisionUrl:=Form.url - - -//$ddList:=Form.tabs - -$function:=$aiParameters.function - -Case of - - : ($function="Text") // TEXT ----------------------------------------------------------------- - - $textGenerationParam:=New object:C1471() - $textGenerationParam.userPrompt:=$aiParameters.prompt - $textGenerationParam.systemPrompt:="" - $textGenerationParam.openAiChatContext:=5 - $textGenerationParam.model:="" // cheap 4o-mini - - $openAI.textGeneration($textGenerationParam; Formula:C1597(AI_CallBack($1.last().content; $aiParameters))) - - : ($function="Reset Context") // RESET CHAT CONTEXT ----------------------------------------------------------------- - - $openAI.resetTextGenerationContext(Formula:C1597(ALERT:C41($1))) - - : ($function="Images") //IMAGE ----------------------------------------------------------------- - - $imageGenerationParam:=New object:C1471 - $imageGenerationParam.userPrompt:=$aiParameters.prompt - $imageGenerationParam.size:=$aiParameters.size - $imageGenerationParam.model:="dall-e-3" // or "dall-e-2" - $imageGenerationParam.quantity:=1 - $imageGenerationParam.downloadImage:=False:C215 - - $openAI.imageGeneration($imageGenerationParam; Formula:C1597(AI_CallBack($1.join(" || "); $aiParameters))) - - : ($function="Vision") //VISION ----------------------------------------------------------------- - - $visionParam:=New object:C1471(\ - "pictureUrl"; $formVisionUrl; \ - "userPrompt"; $formPrompt; \ - "model"; ""; \ - "detail"; "") - $openAI.visionGeneration($visionParam; Formula:C1597(ALERT:C41($1))) - - : ($function="Moderation") //MODERATION ----------------------------------------------------------------- - - $openAI.textModeration($formPrompt; Formula:C1597(ALERT:C41("Sensitive content: "+String:C10($1[0].isFlagged)+"\n"+String:C10($1[1].flaggedCategories.join(", "))))) - -End case - - - diff --git a/Project/Sources/Methods/Compiler_Methods.4dm b/Project/Sources/Methods/Compiler_Methods.4dm index 888d601..e2cfa09 100644 --- a/Project/Sources/Methods/Compiler_Methods.4dm +++ b/Project/Sources/Methods/Compiler_Methods.4dm @@ -1,25 +1,7 @@ //%attributes = {"invisible":true} -_O_C_TEXT:C284(WP_SetTextLineHeight; $3) -_O_C_LONGINT:C283(WP_SetTextUnderline; $3) -_O_C_TEXT:C284(WP_Request; $0) -_O_C_TEXT:C284(WP_Request; $1) -_O_C_TEXT:C284(WP_Request; $2) -_O_C_TEXT:C284(WP_Request; $3) -_O_C_TEXT:C284(WP_Request; $4) -_O_C_TEXT:C284(WP_Request; $5) -_O_C_LONGINT:C283(WP_GetStylesheetType; $0) -_O_C_OBJECT:C1216(WP RemoveDocumentIndex; $1) -_O_C_LONGINT:C283(FR_Script; $0) -_O_C_TEXT:C284(FR_Script; $1) -_O_C_OBJECT:C1216(StylesheetEditMeta; $0) -_O_C_LONGINT:C283(WP_StyleFillEditLB; $2) -_O_C_PICTURE:C286(getIcon; $0) -_O_C_TEXT:C284(getIcon; $1) -_O_C_COLLECTION:C1488(distinctKeepOrder; $1) -_O_C_LONGINT:C283(Call_CustomColorPalette; $0) -_O_C_BOOLEAN:C305(Call_CustomColorPalette; $1) -_O_C_TEXT:C284(Call_CustomColorPalette; $2) -_O_C_PICTURE:C286(zGetSamplePict; $0) -_O_C_PICTURE:C286(zGetSamplePictBW; $0) -_O_C_OBJECT:C1216(WP SetDocumentIndex; $1) -_O_C_TEXT:C284(WP_GetSizes; $2) \ No newline at end of file +C_TEXT:C284(WP_SetTextLineHeight; $3) +C_LONGINT:C283(WP_SetTextUnderline; $3) +C_OBJECT:C1216(StylesheetEditMeta; $0) +C_LONGINT:C283(WP_StyleFillEditLB; $2) +C_PICTURE:C286(zGetSamplePictBW; $0) +C_TEXT:C284(WP_GetSizes; $2) \ No newline at end of file diff --git a/Project/Sources/Methods/Compiler_Variables.4dm b/Project/Sources/Methods/Compiler_Variables.4dm index c05b151..6a0185e 100644 --- a/Project/Sources/Methods/Compiler_Variables.4dm +++ b/Project/Sources/Methods/Compiler_Variables.4dm @@ -1,45 +1,34 @@ //%attributes = {"invisible":true} -var svgPict : Picture -var oForm : Object - - -var areaName : Text -var bookmarkMemoName : Text -var ITEMTEXT : Text -var numFormat : Text -var unitName : Text -var userUnit : Text -var vSVG : Text -var _toolbars : Text -var _sizes : Text - -var Button : Integer -var frameType : Integer -var ITEMREF : Integer -var SUBLIST : Integer -var templateID : Integer -var tabsSelectedRow : Integer -var wp_customColor : Integer -var wp_tabList : Integer -var _StylesheetTabs : Integer - -var dummyObject : Object -var tabDefault : Object -var oSettings1 : Object -var oSettings2 : Object -var oTempArea : Object -var rows : Object -var WParea : Object -var wpStyleSample : Object - -var EXPANDED : Boolean -var vError : Boolean -var wp_allowTransparency : Boolean - -var masterTable : Pointer - -var maxTabValue : Real - -var textBoxID - -var _tabs : Collection \ No newline at end of file +C_TEXT:C284(areaName) +C_TEXT:C284(bookmarkMemoName) +C_LONGINT:C283(Button) +C_OBJECT:C1216(dummyObject) +C_BOOLEAN:C305(EXPANDED) +C_LONGINT:C283(ITEMREF) +C_TEXT:C284(ITEMTEXT) +C_POINTER:C301(masterTable) +C_REAL:C285(maxTabValue) +C_TEXT:C284(numFormat) +C_OBJECT:C1216(oForm) +C_OBJECT:C1216(oSettings1) +C_OBJECT:C1216(oSettings2) +C_OBJECT:C1216(oTempArea) +C_OBJECT:C1216(rows) +C_LONGINT:C283(SUBLIST) +C_PICTURE:C286(svgPict) +C_OBJECT:C1216(tabDefault) +C_LONGINT:C283(tabsSelectedRow) +C_LONGINT:C283(templateID) +C_TEXT:C284(unitName) +C_TEXT:C284(userUnit) +C_BOOLEAN:C305(vError) +C_TEXT:C284(vSVG) +C_OBJECT:C1216(WParea) +C_OBJECT:C1216(wpStyleSample) +C_BOOLEAN:C305(wp_allowTransparency) +C_LONGINT:C283(wp_customColor) +C_LONGINT:C283(wp_tabList) +C_TEXT:C284(_sizes) +C_LONGINT:C283(_StylesheetTabs) +C_COLLECTION:C1488(_tabs) +C_TEXT:C284(_toolbars) \ No newline at end of file