Skip to content

feat: add start_conversation and continue_conversation tools#9

Merged
infinitimeless merged 1 commit into
mainfrom
feat/start-conversation
Apr 10, 2026
Merged

feat: add start_conversation and continue_conversation tools#9
infinitimeless merged 1 commit into
mainfrom
feat/start-conversation

Conversation

@infinitimeless

Copy link
Copy Markdown
Owner

Problem

When asking Claude to hold a multi-turn conversation with a local model, Claude defaulted to chat_completion (stateless) rather than create_response. This meant:

  • The system prompt (persona, tone, instructions) had to be re-sent on every turn
  • Claude manually managed conversation history instead of the bridge handling it
  • Responses had no persistent identity or memory across turns

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 turn
  • message — the model's first response
  • model — the model that was used

continue_conversation(response_id, message, ...)

Sends the next message in the session by passing previous_response_id automatically. The system prompt is preserved by LM Studio throughout — never needs to be re-sent.

Typical Workflow

1. start_conversation(
     system_prompt="You are a friend at a bar. Keep it casual and fun.",
     first_message="Hey! How's it going?"
   )
   → { response_id: "resp_abc123", message: "Hey! Not bad, just unwinding..." }

2. continue_conversation(
     response_id="resp_abc123",
     message="Same. Work's been insane this week."
   )
   → { response_id: "resp_def456", message: "Ugh, tell me about it..." }

3. continue_conversation(
     response_id="resp_def456",
     message="If you could go anywhere tomorrow, where would you go?"
   )
   → { response_id: "resp_ghi789", message: "Honestly? Northern Portugal..." }

Other Changes

  • Default max_tokens raised from 1024 → 2048 in chat_completion and text_completion to prevent responses being cut off mid-sentence

Requirements

  • LM Studio v0.3.29+ (for /v1/responses endpoint support)

@infinitimeless infinitimeless merged commit 6830b59 into main Apr 10, 2026
1 check passed
@infinitimeless infinitimeless deleted the feat/start-conversation branch April 10, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant