mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 13:52:43 +08:00
Co-authored-by: openhands <openhands@all-hands.dev> Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
35 lines
1.1 KiB
Python
35 lines
1.1 KiB
Python
from litellm import ChatCompletionToolParam, ChatCompletionToolParamFunctionChunk
|
|
|
|
from openhands.llm.tool_names import FINISH_TOOL_NAME
|
|
|
|
_FINISH_DESCRIPTION = """Signals the completion of the current task or conversation.
|
|
|
|
Use this tool when:
|
|
- You have successfully completed the user's requested task
|
|
- You cannot proceed further due to technical limitations or missing information
|
|
|
|
The message should include:
|
|
- A clear summary of actions taken and their results
|
|
- Any next steps for the user
|
|
- Explanation if you're unable to complete the task
|
|
- Any follow-up questions if more information is needed
|
|
"""
|
|
|
|
FinishTool = ChatCompletionToolParam(
|
|
type='function',
|
|
function=ChatCompletionToolParamFunctionChunk(
|
|
name=FINISH_TOOL_NAME,
|
|
description=_FINISH_DESCRIPTION,
|
|
parameters={
|
|
'type': 'object',
|
|
'required': ['message'],
|
|
'properties': {
|
|
'message': {
|
|
'type': 'string',
|
|
'description': 'Final message to send to the user',
|
|
},
|
|
},
|
|
},
|
|
),
|
|
)
|