Skip to main content

Calling the API of 'Thinking-Machines Lab' models without dependencies.

Project description

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)
)

Project details


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.7.tar.gz (6.4 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.7-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: machine_thinking-0.0.7.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for machine_thinking-0.0.7.tar.gz
Algorithm Hash digest
SHA256 6c4ef62599a14427324914ff9de8bcc14a3d2283b8627e1329114b2c27db3540
MD5 fccec2435daaf84b173a8d6a52d6a1c0
BLAKE2b-256 3af60de6a045e795dc2f5485ba3c303f78df5870fd618d856d87ad22e32f898f

See more details on using hashes here.

Provenance

The following attestation bundles were made for machine_thinking-0.0.7.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.7-py3-none-any.whl.

File metadata

File hashes

Hashes for machine_thinking-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d432e7061aca3e9d9ddfb7b8283463d5cfcd30324e2afd3aa0b4ae9650f56aa4
MD5 83652639c8668137fee2b6badcfa5a2c
BLAKE2b-256 ecd29560b27b2cfd5ec58f065d1b63929c47273a91d8bb0f1a10db10f1439927

See more details on using hashes here.

Provenance

The following attestation bundles were made for machine_thinking-0.0.7-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.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page