瀏覽代碼

Add AI feature images to generated posts

master
nano 5 天之前
父節點
當前提交
12a06cb7e7
共有 1 個檔案被更改,包括 11 行新增7 行删除
  1. +11
    -7
      core/helpers.asp

+ 11
- 7
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


Loading…
取消
儲存

Powered by TurnKey Linux.