Skip to main content

A package for working with fireworks.ai without dependencies.

Project description

illuminations

A package for working with fireworks.ai without dependencies.

  pip install illuminations

Then:

  # Python
  import illuminations

After that:

from yaml import safe_load as yl
from illuminations.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. Important: 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)
)

or

from yaml import safe_load as yl
from illuminations.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

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

illuminations-0.0.28.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

illuminations-0.0.28-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file illuminations-0.0.28.tar.gz.

File metadata

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

File hashes

Hashes for illuminations-0.0.28.tar.gz
Algorithm Hash digest
SHA256 57d0ab42e1338b315d876981df99045f42b11d7accdfffb853b0c021df8a8f5d
MD5 0adfab65efaf1e746cbc5ab4947a51fc
BLAKE2b-256 06dc15f8c3c0b4cd6949ed3a8059ccf5eea94f4581519f514c3b2c9bbd63ec17

See more details on using hashes here.

Provenance

The following attestation bundles were made for illuminations-0.0.28.tar.gz:

Publisher: python-publish.yml on alxfed/illuminations

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

File details

Details for the file illuminations-0.0.28-py3-none-any.whl.

File metadata

  • Download URL: illuminations-0.0.28-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for illuminations-0.0.28-py3-none-any.whl
Algorithm Hash digest
SHA256 43aab593660cb9ac6ca73c7e9b01bf2c20bc66bf7a072c0007e4cd191fc01db1
MD5 917aa398700f010ce46aaee44da19e93
BLAKE2b-256 9dd48ed66fe9ca7b4c4f33eb374ef7f9bf576b990fc314ff1b02ce87e78a6ae4

See more details on using hashes here.

Provenance

The following attestation bundles were made for illuminations-0.0.28-py3-none-any.whl:

Publisher: python-publish.yml on alxfed/illuminations

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