diff --git a/core/helpers.asp b/core/helpers.asp index 4e6f87c..258f947 100644 --- a/core/helpers.asp +++ b/core/helpers.asp @@ -57,18 +57,21 @@ Public Function GetAppSetting(key) End Function Public Function GetEnvironmentValue(name) - Dim shell, env, value + Dim shell, env, value, scopes, scope value = "" On Error Resume Next Set shell = Server.CreateObject("WScript.Shell") - Set env = shell.Environment("PROCESS") If Err.Number = 0 Then - value = env(name) - If Err.Number <> 0 Then + scopes = Array("PROCESS", "SYSTEM", "USER") + For Each scope In scopes + Set env = shell.Environment(scope) + If Err.Number = 0 Then + value = env(name) + If Len(Trim(CStr(value))) > 0 Then Exit For + End If Err.Clear - value = "" - End If + Next Else Err.Clear End If @@ -108,7 +111,8 @@ Public Function GetGenerationPromptTemplate() "Create blog content for this post title: {TITLE}" & vbCrLf & _ "Existing summary: {SUMMARY}" & vbCrLf & _ "Existing body: {BODY}" & vbCrLf & _ - "Keep the title unchanged. Make the content readable and helpful for a general audience." + "Keep the title unchanged. Make the content readable and helpful for a general audience." & vbCrLf & _ + "Also include an image_prompt field in the generated JSON output that describes a magazine-style feature image." End If GetGenerationPromptTemplate = prompt