Spaces:
Runtime error
Runtime error
update system prompt human
Browse files- utils/scorer.py +5 -3
utils/scorer.py
CHANGED
|
@@ -5,7 +5,7 @@ Analyzes content for Generative Engine Optimization (GEO) performance
|
|
| 5 |
|
| 6 |
import json
|
| 7 |
from typing import Dict, Any, List
|
| 8 |
-
from langchain.prompts import ChatPromptTemplate
|
| 9 |
|
| 10 |
|
| 11 |
class GEOScorer:
|
|
@@ -129,9 +129,11 @@ Provide analysis in JSON:
|
|
| 129 |
|
| 130 |
# Build prompt and run analysis
|
| 131 |
prompt_template = ChatPromptTemplate.from_messages([
|
| 132 |
-
(
|
| 133 |
-
(
|
| 134 |
])
|
|
|
|
|
|
|
| 135 |
chain = prompt_template | self.llm
|
| 136 |
result = chain.invoke({}) # No variables needed
|
| 137 |
|
|
|
|
| 5 |
|
| 6 |
import json
|
| 7 |
from typing import Dict, Any, List
|
| 8 |
+
from langchain.prompts import ChatPromptTemplate, SystemMessagePromptTemplate, HumanMessagePromptTemplate
|
| 9 |
|
| 10 |
|
| 11 |
class GEOScorer:
|
|
|
|
| 129 |
|
| 130 |
# Build prompt and run analysis
|
| 131 |
prompt_template = ChatPromptTemplate.from_messages([
|
| 132 |
+
SystemMessagePromptTemplate.from_template(system_prompt),
|
| 133 |
+
HumanMessagePromptTemplate.from_template(user_message)
|
| 134 |
])
|
| 135 |
+
# ("user", user_message)
|
| 136 |
+
# ("system", system_prompt),
|
| 137 |
chain = prompt_template | self.llm
|
| 138 |
result = chain.invoke({}) # No variables needed
|
| 139 |
|