feat: init ai editor writer and continue writing feature

This commit is contained in:
swve 2024-01-11 01:39:43 +01:00
parent 21f1f2fd94
commit 5b79cbed89
12 changed files with 446 additions and 29 deletions

View file

@ -59,7 +59,7 @@ def ask_ai(
memory_key = "history"
memory = AgentTokenBufferMemory(
memory_key=memory_key, llm=llm, chat_memory=message_history
memory_key=memory_key, llm=llm, chat_memory=message_history, max_tokens=1000
)
system_message = SystemMessage(content=(message_for_the_prompt))
@ -77,6 +77,7 @@ def ask_ai(
memory=memory,
verbose=True,
return_intermediate_steps=True,
handle_parsing_errors=True,
)
return agent_executor({"input": question})