mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
[Fix]: Don't start conversations without user instructions for remote api key conversations (#8626)
This commit is contained in:
parent
e2fc893cf5
commit
3877ddac2b
@ -209,6 +209,17 @@ async def new_conversation(
|
||||
if auth_type == AuthType.BEARER:
|
||||
conversation_trigger = ConversationTrigger.REMOTE_API_KEY
|
||||
|
||||
|
||||
if conversation_trigger == ConversationTrigger.REMOTE_API_KEY and not initial_user_msg:
|
||||
return JSONResponse(
|
||||
content={
|
||||
'status': 'error',
|
||||
'message': 'Missing initial user message',
|
||||
'msg_id': 'CONFIGURATION$MISSING_USER_MESSAGE',
|
||||
},
|
||||
status_code=status.HTTP_400_BAD_REQUEST,
|
||||
)
|
||||
|
||||
try:
|
||||
if repository:
|
||||
provider_handler = ProviderHandler(provider_tokens)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user