Skip to content

Commit e4bb04a

Browse files
committed
use VERBOSE_LLM to prompt show
Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
1 parent c8478a6 commit e4bb04a

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

‎src/dialog/llm/default.py‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
import logging
21
import asyncio
3-
4-
from dialog.llm.abstract_llm import AbstractLLM
5-
from dialog.learn.idf import categorize_conversation_history
6-
from dialog.llm.memory import generate_memory_instance
7-
from dialog.llm.embeddings import get_most_relevant_contents_from_message
2+
import logging
83

94
from langchain.chains.llm import LLMChain
10-
from langchain.memory.chat_memory import BaseChatMemory
11-
125
from langchain.chat_models import ChatOpenAI
136
from langchain.memory import ConversationBufferWindowMemory
7+
from langchain.memory.chat_memory import BaseChatMemory
148
from langchain.prompts import (ChatPromptTemplate, HumanMessagePromptTemplate,
159
MessagesPlaceholder,
1610
SystemMessagePromptTemplate)
1711

18-
from dialog.settings import OPENAI_API_KEY
12+
from dialog.learn.idf import categorize_conversation_history
13+
from dialog.llm.abstract_llm import AbstractLLM
14+
from dialog.llm.embeddings import get_most_relevant_contents_from_message
15+
from dialog.llm.memory import generate_memory_instance
16+
from dialog.settings import OPENAI_API_KEY, VERBOSE_LLM
1917

2018

2119
class DialogLLM(AbstractLLM):
@@ -57,7 +55,8 @@ def generate_prompt(self, input):
5755

5856
question_text = self.config.get("prompt").get("question_signalizer")
5957
prompt_templating.append(HumanMessagePromptTemplate.from_template(f"{question_text}" + ":\n{user_message}"))
60-
58+
if VERBOSE_LLM:
59+
logging.info(f"Verbose LLM prompt: {prompt_templating}")
6160
self.prompt = ChatPromptTemplate(messages=prompt_templating)
6261

6362
@property

0 commit comments

Comments
 (0)