| @@ -57,18 +57,21 @@ Public Function GetAppSetting(key) | |||||
| End Function | End Function | ||||
| Public Function GetEnvironmentValue(name) | Public Function GetEnvironmentValue(name) | ||||
| Dim shell, env, value | |||||
| Dim shell, env, value, scopes, scope | |||||
| value = "" | value = "" | ||||
| On Error Resume Next | On Error Resume Next | ||||
| Set shell = Server.CreateObject("WScript.Shell") | Set shell = Server.CreateObject("WScript.Shell") | ||||
| Set env = shell.Environment("PROCESS") | |||||
| If Err.Number = 0 Then | 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 | Err.Clear | ||||
| value = "" | |||||
| End If | |||||
| Next | |||||
| Else | Else | ||||
| Err.Clear | Err.Clear | ||||
| End If | End If | ||||
| @@ -108,7 +111,8 @@ Public Function GetGenerationPromptTemplate() | |||||
| "Create blog content for this post title: {TITLE}" & vbCrLf & _ | "Create blog content for this post title: {TITLE}" & vbCrLf & _ | ||||
| "Existing summary: {SUMMARY}" & vbCrLf & _ | "Existing summary: {SUMMARY}" & vbCrLf & _ | ||||
| "Existing body: {BODY}" & 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 | End If | ||||
| GetGenerationPromptTemplate = prompt | GetGenerationPromptTemplate = prompt | ||||
Powered by TurnKey Linux.