You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make image viewing instruction conditional on LLM vision support
The FileEditor tool now conditionally includes the image viewing
instruction in its description based on whether the LLM supports
vision capabilities. This prevents confusion when using OSS models
that don't support image inputs.
- Remove image viewing line from base TOOL_DESCRIPTION
- Add conditional logic in FileEditorTool.create() to include the
image viewing line only when conv_state.agent.llm.vision_is_active()
returns True
- Add tests to verify the behavior with vision-enabled and
vision-disabled LLMs
Co-authored-by: openhands <openhands@all-hands.dev>
TOOL_DESCRIPTION="""Custom editing tool for viewing, creating and editing files in plain-text format
159
159
* State is persistent across command calls and discussions with the user
160
160
* If `path` is a text file, `view` displays the result of applying `cat -n`. If `path` is a directory, `view` lists non-hidden files and directories up to 2 levels deep
161
-
* If `path` is an image file (.png, .jpg, .jpeg, .gif, .webp, .bmp), `view` displays the image content
162
161
* The `create` command cannot be used if the specified `path` already exists as a file
163
162
* If a `command` generates a long output, it will be truncated and marked with `<response clipped>`
164
163
* The `undo_edit` command will revert the last edit made to the file at `path`
0 commit comments