mirror of
https://github.com/lfnovo/open-notebook.git
synced 2026-04-29 03:50:04 +00:00
simplify model provisioning
This commit is contained in:
parent
fcd883f393
commit
15048b0839
3 changed files with 58 additions and 14 deletions
|
|
@ -39,9 +39,8 @@ def run_pattern(
|
|||
system_prompt = Prompter(prompt_template=pattern_name, parser=parser).render(
|
||||
data=state
|
||||
)
|
||||
chain = provision_model(
|
||||
str(system_prompt) + str(messages), config, "transformation"
|
||||
)
|
||||
payload = [system_prompt] + messages
|
||||
chain = provision_model(str(payload), config, "transformation")
|
||||
|
||||
if parser:
|
||||
chain = chain | parser
|
||||
|
|
@ -53,10 +52,6 @@ def run_pattern(
|
|||
llm=output_fix_model,
|
||||
)
|
||||
|
||||
# todo: precisa deste if?
|
||||
if len(messages) > 0:
|
||||
response = chain.invoke([system_prompt] + messages)
|
||||
else:
|
||||
response = chain.invoke(system_prompt)
|
||||
response = chain.invoke(payload)
|
||||
|
||||
return response
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue