At the step limit, one request with no tools, and the prose is the answer - #137
Merged
Merged
Conversation
on_max_iters says what the step limit does. The default, :forced_submit, is unchanged: one more request with tool_choice naming submit. :last_prose makes one more request with no tools in the provider config, so the only thing the model can do is speak, and that prose is the single text output, with termination_reason: :last_prose. An empty completion is an empty answer, not an error. The option needs a signature with exactly one output of type :string and is refused at construction otherwise. last_prose_note puts one line of host text in front of that request as a user message, through the history the forced_submit_notice uses, so the record of the run carries it. Imp writes no sentence of its own. Both options dump and load; a dump written without them loads as :forced_submit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Imp.Predict.ReActV2ended a turn that reachedmax_iterswithforced_submit: one more request withtool_choicenaming thesubmittool. For a host whose signature has a single text output and whose model already ends turns by writing prose, that asks the model to call a tool it never chose.on_max_iterssays what the step limit does.:forced_submit, the default, is today's behaviour, so existing users are unchanged.:last_prosemakes exactly one more request with no tools in it::toolsand:tool_choiceare dropped from the provider config, and for the chat completions profile a body with no tool roster carries neither key. The completion is parsed as prose the way the:answeredpath is, and the run finishes with the single text output set to that prose andtermination_reason: :last_prose. An empty completion finishes with an empty answer rather than an error. The option needs a signature with exactly one output of type:string; anything else is refused at construction.:last_proseis a separate reason from:answered::answeredis the model choosing to stop calling tools,:last_proseis the loop taking the tools away.last_prose_note, nil or a string, puts one line of host text in front of that request as a user message. It goes through the same history mechanismforced_submit_noticeuses, so the record of the run carries it, but the two options stay separate and a host passes one or the other. Imp writes no sentence of its own.The last request and its response are emitted as events like any step's, and the prose becomes a history turn the way an answered step's does.
Both options dump and load; a dump written before them loads as
:forced_submit.Tests:
test/react_v2_last_prose_test.exscovers three requests atmax_iters: 2with no:toolskey in the third, the note present and absent, an empty answer, the event record, the construction refusal for a two-output signature, the default still forcing a submit, and the dump/load round trip including an older dump. The existing forced-submit and prose tests are unchanged.Gates:
mix format,mix compile --warnings-as-errors,mix check(2865 tests, 0 failures),mix dialyzer.check(150 errors, 150 skipped, 0 unnecessary skips).