Procházet zdrojové kódy

fix: disable template string in query (#160)

tags/0.2.2
John Wang před 2 roky
rodič
revize
219011b62a
Žádný účet není propojen s e-mailovou adresou tvůrce revize
1 změnil soubory, kde provedl 7 přidání a 0 odebrání
  1. 7
    0
      api/core/completion.py

+ 7
- 0
api/core/completion.py Zobrazit soubor

@@ -124,6 +124,13 @@ class Completion:
chain_output: Optional[str],
memory: Optional[ReadOnlyConversationTokenDBBufferSharedMemory]) -> \
Union[str | List[BaseMessage]]:
# disable template string in query
query_params = OutLinePromptTemplate.from_template(template=query).input_variables
if query_params:
for query_param in query_params:
if query_param not in inputs:
inputs[query_param] = '{' + query_param + '}'

pre_prompt = PromptBuilder.process_template(pre_prompt) if pre_prompt else pre_prompt
if mode == 'completion':
prompt_template = OutLinePromptTemplate.from_template(

Načítá se…
Zrušit
Uložit