mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-10 07:18:10 -05:00
More Type Safety (#10848)
This commit is contained in:
@@ -45,7 +45,6 @@ from openhands.server.services.conversation_service import (
|
||||
setup_init_conversation_settings,
|
||||
)
|
||||
from openhands.server.shared import (
|
||||
ConversationManagerImpl,
|
||||
ConversationStoreImpl,
|
||||
config,
|
||||
conversation_manager,
|
||||
@@ -397,7 +396,7 @@ async def get_prompt(
|
||||
)
|
||||
|
||||
prompt_template = generate_prompt_template(stringified_events)
|
||||
prompt = generate_prompt(llm_config, prompt_template, conversation_id)
|
||||
prompt = await generate_prompt(llm_config, prompt_template, conversation_id)
|
||||
|
||||
return JSONResponse(
|
||||
{
|
||||
@@ -413,7 +412,7 @@ def generate_prompt_template(events: str) -> str:
|
||||
return template.render(events=events)
|
||||
|
||||
|
||||
def generate_prompt(
|
||||
async def generate_prompt(
|
||||
llm_config: LLMConfig, prompt_template: str, conversation_id: str
|
||||
) -> str:
|
||||
messages = [
|
||||
@@ -427,7 +426,7 @@ def generate_prompt(
|
||||
},
|
||||
]
|
||||
|
||||
raw_prompt = ConversationManagerImpl.request_llm_completion(
|
||||
raw_prompt = await conversation_manager.request_llm_completion(
|
||||
'remember_prompt', conversation_id, llm_config, messages
|
||||
)
|
||||
prompt = re.search(r'<update_prompt>(.*?)</update_prompt>', raw_prompt, re.DOTALL)
|
||||
|
||||
Reference in New Issue
Block a user