Opehaina
Project description
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)
)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opehaina-0.0.7.tar.gz.
File metadata
- Download URL: opehaina-0.0.7.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc95181553712e7f2ad457b2ebb698beae5256ebf7c42825200436246ceb0537
|
|
| MD5 |
f5ea58419f6bec579e9bc75c4596caa4
|
|
| BLAKE2b-256 |
08ef6612bf4737492c50d4f20491d98931f7dda6664695c517e73f2e136ee618
|
Provenance
The following attestation bundles were made for opehaina-0.0.7.tar.gz:
Publisher:
python-publish.yml on alxfed/opehaina
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opehaina-0.0.7.tar.gz -
Subject digest:
fc95181553712e7f2ad457b2ebb698beae5256ebf7c42825200436246ceb0537 - Sigstore transparency entry: 2190989006
- Sigstore integration time:
-
Permalink:
alxfed/opehaina@23b72b1472d790f81d56fa083cdecc475289e53e -
Branch / Tag:
refs/tags/0.0.7 - Owner: https://github.com/alxfed
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@23b72b1472d790f81d56fa083cdecc475289e53e -
Trigger Event:
release
-
Statement type:
File details
Details for the file opehaina-0.0.7-py3-none-any.whl.
File metadata
- Download URL: opehaina-0.0.7-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4a0b41832c1a493a53b4611d04ca91bfac3cf482298d06514d6f3dbb6e1a5cb
|
|
| MD5 |
978561e8a01ec296b8f189a33a974aba
|
|
| BLAKE2b-256 |
b72c11a102795bfbc2c5723f44b3cf7c00076d0431ac3d5a8efee48f4c4990f2
|
Provenance
The following attestation bundles were made for opehaina-0.0.7-py3-none-any.whl:
Publisher:
python-publish.yml on alxfed/opehaina
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opehaina-0.0.7-py3-none-any.whl -
Subject digest:
e4a0b41832c1a493a53b4611d04ca91bfac3cf482298d06514d6f3dbb6e1a5cb - Sigstore transparency entry: 2190989053
- Sigstore integration time:
-
Permalink:
alxfed/opehaina@23b72b1472d790f81d56fa083cdecc475289e53e -
Branch / Tag:
refs/tags/0.0.7 - Owner: https://github.com/alxfed
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@23b72b1472d790f81d56fa083cdecc475289e53e -
Trigger Event:
release
-
Statement type: