Skip to main content

Opehaina

Opehaina

  pip install opehaina

Then:

  # Python
from yaml import safe_load as yl
from opehaina.responses import respond


def get_weather(location):
    # print(f"Executing weather tool for location: {location}")
    return {"temperature": "72F", "condition": "Sunny"}

kwargs = """  # this is a string in YAML format
  max_tokens:   64000
  temperature:  1.0
"""

multilogue = "Compare the weather in Oakland, CA and weather in Paris, France. Use the tool for learning both."

get_weather_tool_str = """  # tool definition (new template)
  type: 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(get_weather_tool_str)]

instructions = """
You are a helpful assistant.
Rubric: respond in plain text without any markdown, emphasis or lists;
all paragraphs except the first one should begin with a newline and a tab.
"""

thoughts, text = respond(
    messages=multilogue,
    instructions=instructions,
    tools=tools,
    **yl(kwargs)
)

or

from yaml import safe_load as yl
from opehaina.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
  # thinking:     24576  # thinking tokens budget. 24576
  reasoning_effort: high
"""

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

get_weather_tool_str = """ # tool description (old)
  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(get_weather_tool_str)]

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

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

Metadata

Release files for opehaina 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for opehaina 0.0.7
File Size Uploaded Provenance
opehaina-0.0.7.tar.gz 7.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for opehaina 0.0.7
File Interpreter ABI Platform
opehaina-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 15.4 kB

Release files / opehaina-0.0.7.tar.gz

Download URL opehaina-0.0.7.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
fc95181553712e7f2ad457b2ebb698beae5256ebf7c42825200436246ceb0537
BLAKE2b-256 checksum
How to use checksums
08ef6612bf4737492c50d4f20491d98931f7dda6664695c517e73f2e136ee618
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.

Transparency log

Release files / opehaina-0.0.7-py3-none-any.whl

Download URL opehaina-0.0.7-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4a0b41832c1a493a53b4611d04ca91bfac3cf482298d06514d6f3dbb6e1a5cb
BLAKE2b-256 checksum
How to use checksums
b72c11a102795bfbc2c5723f44b3cf7c00076d0431ac3d5a8efee48f4c4990f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.

Transparency log

Security for opehaina 0.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for opehaina-0.0.7.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.0.7 This release

2 release files Full provenance

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