mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-07 22:14:03 -05:00
Co-authored-by: openhands <openhands@all-hands.dev> Co-authored-by: Rohit Malhotra <rohitvinodmalhotra@gmail.com>
42 lines
1.6 KiB
Python
42 lines
1.6 KiB
Python
# IMPORTANT: LEGACY V0 CODE
|
|
# This file is part of the legacy (V0) implementation of OpenHands and will be removed soon as we complete the migration to V1.
|
|
# OpenHands V1 uses the Software Agent SDK for the agentic core and runs a new application server. Please refer to:
|
|
# - V1 agentic core (SDK): https://github.com/OpenHands/software-agent-sdk
|
|
# - V1 application server (in this repo): openhands/app_server/
|
|
# Unless you are working on deprecation, please avoid extending this legacy file and consult the V1 codepaths above.
|
|
# Tag: Legacy-V0
|
|
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',
|
|
},
|
|
},
|
|
},
|
|
),
|
|
)
|