Skip to main content

machine-thinking

Tinker API calls to Inkling model without dependencies.

  pip install machine-thinking

Then:

# Python
from yaml import safe_load as yl
from machine_thinking.chat import chat_complete as cc

kwargs = """  # this is a string in YAML format
  max_tokens:   32000
  stop_sequences:
    - STOP
    - "\nTitle"
  temperature:  1.0
  top_k:        10
  top_p:        0.5
  reasoning_effort: high
"""

instruction = 'You are a helpful assistant. Do not use markdown or lists in your responses.'

weather_tool = """ # YAML definition of a function (old format)
  type: function
  function:
    name: get_weather
    description: Determine weather in a location
    parameters:
      type: object
      properties:
        location:
          type: string
          description: The city and state, e.g. San Francisco, CA
      additionalProperties: false
      required:
        - location
"""

tools = [yl(weather_tool)]

msgs = [{'role': 'user', 'content': 'What is the weather in Chicago, IL and Paris, France?'}]

thoughts, text = cc(
    messages=msgs,
    instructions=instruction,
    tools=tools,
    **yl(kwargs)
)

or

from yaml import safe_load as yl
from machine_thinking.messages import message


kwargs = """  # this is a string in YAML format
  max_tokens:   32000
  stop_sequences:
    - STOP
    - "\nTitle"
  temperature:  1.0
  top_k:        10
  top_p:        0.5
  thinking:     
    type: enabled
    budget_tokens: 24576
    display: summarized
  tool_choice:
    type: auto
    disable_parallel_tool_use: false
"""

instruction = 'You are a helpful assistant. Do not use markdown or lists in your responses.'

get_weather_tool_str = """ # YAML definition of a function
    name: get_weather
    description: Determine weather in a location
    input_schema:
      type: object
      properties:
        location:
          type: string
          description: The city and state, e.g. San Francisco, CA
      additionalProperties: true
      required:
        - location
    """

tools = [yl(get_weather_tool_str)]

msg = [{'role': 'user', 'content': 'What is the weather in Chicago, IL and Paris, France?'}]

thoughts, text = message(
    messages=msg,
    instructions=instruction,
    tools=tools,
    **yl(kwargs)
)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

machine_thinking-0.0.16.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

machine_thinking-0.0.16-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file machine_thinking-0.0.16.tar.gz.

File metadata

  • Download URL: machine_thinking-0.0.16.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for machine_thinking-0.0.16.tar.gz
Algorithm Hash digest
SHA256 302626cbb14e03fde0e1428667a615cf65b841f9f76dca692803bf8dfb2896e4
MD5 c5c3db749c9d359a6ac21948c70dc312
BLAKE2b-256 fbbe0f6b29066ade982ca85274d99d2152b112da0ac31fecc6ccb20a15f2a57d

See more details on using hashes here.

Provenance

The following attestation bundles were made for machine_thinking-0.0.16.tar.gz:

Publisher: python-publish.yml on machina-ratiocinatrix/machine-thinking

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file machine_thinking-0.0.16-py3-none-any.whl.

File metadata

File hashes

Hashes for machine_thinking-0.0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 bde1fd6258d9aa14a00c0571d6c34e8036cc48193470de640beca45b2f6b7dfe
MD5 c20c81f7696f5d77cc79d11b80937b7c
BLAKE2b-256 dce3f8c298d3913f7881234e375cee3c571dc056db8839442a5a76b46a952af8

See more details on using hashes here.

Provenance

The following attestation bundles were made for machine_thinking-0.0.16-py3-none-any.whl:

Publisher: python-publish.yml on machina-ratiocinatrix/machine-thinking

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.0.16 This release

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page