Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: diffbot/diffbot-python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.2.2
Choose a base ref
...
head repository: diffbot/diffbot-python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 4 commits
  • 10 files changed
  • 3 contributors

Commits on Jun 8, 2026

  1. Configuration menu
    Copy the full SHA
    b104ccf View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2026

  1. Bump to 0.2.3; drop minimum Python to 3.9

    Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
    shixish and claude committed Jun 12, 2026
    Configuration menu
    Copy the full SHA
    b64f6a1 View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2026

  1. Add structured output support to ask

    The Diffbot LLM endpoint supports response_format, but the client had no way
    to pass it: the payload in ask.py was hardcoded to model/messages/stream.
    
    Adds response_format to ask() and a new ask_json() that returns a parsed
    object, both sync and async, plus json_schema_format() to build the payload.
    The CLI gains --schema, and --json now uses real structured output instead of
    nudging the prompt and slicing between the first { and last }.
    
    Server-side (see ../diffbot-llm) the schema is compiled to an EBNF grammar and
    the final answer is constrained to it, so this is enforced decoding rather than
    a request the model may ignore. Two rough edges are handled client-side:
    
    - The schema must be nested at json_schema.schema. Anywhere else and the server
      returns 200 with the constraint silently dropped, so we reject that locally.
    - The grammar permits a <think> block before the final answer, so ask_json
      strips think blocks and markdown fences before parsing.
    
    ask_json without a schema deliberately sends a permissive {"type": "object"}
    json_schema rather than {"type": "json_object"}. json_object gets no grammar
    applied, and the RAG loop's internal tool call is itself a valid JSON object,
    so it can be returned as the final answer -- reproducible with a system message
    on some queries (5/5 on one, 0/12 without a system message). A guard raises
    ValidationError if a tool call ever comes back.
    
    Tested with 44 unit tests and 7 live tests against the real endpoint, covering
    flat and nested schemas, streaming with a schema, async, and a regression test
    for the system-message case.
    
    Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
    jeromechoo and claude committed Aug 14, 2026
    Configuration menu
    Copy the full SHA
    d2b13e2 View commit details
    Browse the repository at this point in the history
  2. Sync uv.lock to 0.2.3

    b64f6a1 regenerated the lock for the 3.9 floor before bumping the version in
    pyproject.toml, so the lock kept recording 0.2.2. CI runs uv sync --frozen,
    which skips the freshness check, so this never surfaced -- but it reappeared
    as a dirty working tree after any uv command, and would fail uv lock --check.
    
    Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
    jeromechoo and claude committed Aug 14, 2026
    Configuration menu
    Copy the full SHA
    052ebf2 View commit details
    Browse the repository at this point in the history
Loading