Skip to content

Add a system prompt and stop_reason handling to the clients #274

Open

Description

@a-akimov

Problem

None of the clients set a system prompt, and none of them check stop_reason. When the reply hits max_tokens or the model refuses, the user sees an empty or cut-off reply with no explanation. A quickstart should show the few lines that make this visible.

Tasks

  • Add one short system prompt to all five clients, for example "You are a weather assistant. Use the tools to answer."
  • After each API call, check stop_reason:
    • If it's max_tokens, print a one-line notice.
    • If it's refusal, print the refusal instead of an empty string.
  • Keep the change to a few lines. Don't add streaming or typed error handling.

Acceptance criteria

  • All five clients send the same system prompt.
  • A reply cut off by max_tokens or refused by the model prints a notice instead of empty output.

Activity

  1. self-assigned this
    on Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions