feat: add start_conversation and continue_conversation tools#9
Merged
Conversation
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.
Problem
When asking Claude to hold a multi-turn conversation with a local model, Claude defaulted to
chat_completion(stateless) rather thancreate_response. This meant:Solution
Two new tools that make multi-turn conversations first-class:
start_conversation(system_prompt, first_message, ...)Starts a stateful session by sending a system prompt + opening message to
/v1/responses. Returns:response_id— chain this into every subsequent turnmessage— the model's first responsemodel— the model that was usedcontinue_conversation(response_id, message, ...)Sends the next message in the session by passing
previous_response_idautomatically. The system prompt is preserved by LM Studio throughout — never needs to be re-sent.Typical Workflow
Other Changes
max_tokensraised from 1024 → 2048 inchat_completionandtext_completionto prevent responses being cut off mid-sentenceRequirements
/v1/responsesendpoint support)