mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-09 14:57:59 -05:00
feat(backend): New "update microagent prompt" API (#8357)
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com> Co-authored-by: Engel Nyst <engel.nyst@gmail.com>
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import uuid
|
||||
|
||||
from fastapi import Depends, HTTPException, Request, status
|
||||
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
@@ -18,6 +20,15 @@ async def get_conversation_store(request: Request) -> ConversationStore | None:
|
||||
return conversation_store
|
||||
|
||||
|
||||
async def generate_unique_conversation_id(
|
||||
conversation_store: ConversationStore,
|
||||
) -> str:
|
||||
conversation_id = uuid.uuid4().hex
|
||||
while await conversation_store.exists(conversation_id):
|
||||
conversation_id = uuid.uuid4().hex
|
||||
return conversation_id
|
||||
|
||||
|
||||
async def get_conversation(
|
||||
conversation_id: str, user_id: str | None = Depends(get_user_id)
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user