mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: init ai editor writer and continue writing feature
This commit is contained in:
parent
21f1f2fd94
commit
5b79cbed89
12 changed files with 446 additions and 29 deletions
|
|
@ -117,7 +117,7 @@ def ai_send_activity_chat_message(
|
|||
)
|
||||
|
||||
# Get Activity Content Blocks
|
||||
content = activity.content
|
||||
content = activity.content
|
||||
|
||||
# Serialize Activity Content Blocks to a text comprehensible by the AI
|
||||
structured = structure_activity_content_by_type(content)
|
||||
|
|
|
|||
|
|
@ -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})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue