change model provisioning strategy

This commit is contained in:
LUIS NOVO 2024-11-04 09:49:11 -03:00
parent d9c0c93deb
commit b4ba3ef4c8
2 changed files with 7 additions and 5 deletions

View file

@ -25,7 +25,7 @@ class ThreadState(TypedDict):
def call_model_with_messages(state: ThreadState, config: RunnableConfig) -> dict:
system_prompt = Prompter(prompt_template="chat").render(data=state)
payload = [system_prompt] + state.get("messages", [])
model = provision_langchain_model(str(payload), config, "chat")
model = provision_langchain_model(str(payload), config, "chat", max_tokens=2000)
ai_message = model.invoke(payload)
return {"messages": ai_message}