Skip to content

Implementing US #276 interactive mode for models that do not support tools#286

Merged
jGauravGupta merged 18 commits into
jeddict:mainfrom
stefanofornari:ste/us/276_Interactive_mode_for_models_that_do_not_support_tools
Mar 14, 2026
Merged

Implementing US #276 interactive mode for models that do not support tools#286
jGauravGupta merged 18 commits into
jeddict:mainfrom
stefanofornari:ste/us/276_Interactive_mode_for_models_that_do_not_support_tools

Conversation

@stefanofornari

@stefanofornari stefanofornari commented Mar 9, 2026

Copy link
Copy Markdown
Collaborator

As per #276, this PR adds support for tool execution even when a model does not support tools/functions.
Before this PR, in Agent and Interactive modes, the model is probed for tools support. If tools are supported they are used, if not it behaves like in Ask mode.
With the PR, when in Agent and Interactive modes, if the model does not support tools, it falls back to HackerWithoutTools, which engineers the prompt to simulate tool execution (similar to the earlier Jeddict versions):

  1. the system prompt provides the list of available tools and instructs the model that whenever it needs something that can be fulfilled by a tool, it must produce a block like:
  ``tool:toolName
  "arg1":" value1"
  ...
  ``
  1. the user prompt is sent to the LLM and if the response contains a tool block the tool is executed and the result sent back to the LLM
  2. the loop exits when the LLM does not request any tool (or anyway after 25 iterations)

The tool representation and frameworks is the existing one in package io.github.jeddict.ai.agent and in particular, if in Interactive mode, tools that produce any side effect must be allowed by the user.

Nowadays most models support tools (which is btw more verbose and therefore more expensive). making this feature maybe less relevant; the outcome is however pretty good and it's a good choice to use cheaper models.

Tested with ministral-3b-2512

@stefanofornari stefanofornari self-assigned this Mar 14, 2026
@jGauravGupta jGauravGupta added this to the 3.4.0 milestone Mar 14, 2026
@jGauravGupta jGauravGupta merged commit 1191862 into jeddict:main Mar 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants