openai-tiny-function-calling
from enum import Enum
import openai_tiny_function_calling
class Unit(Enum):
CELSIUS = "celsius"
FAHRENHEIT = "fahrenheit"
def get_current_weather(location: str, unit: Unit = Unit.CELSIUS):
"""
Get the current weather in a given location
Args:
location: The city and state, e.g. San Francisco, CA
unit: The temperature unit to use
"""
pass
def test_example():
function = openai_tiny_function_calling.create_function_dict(get_current_weather)
print(function)
assert function["name"] == "get_current_weather"
assert function["description"] == "Get the current weather in a given location"
assert function["parameters"]["properties"]["location"]["type"] == "string"
assert function["parameters"]["properties"]["location"]["description"] == "The city and state, e.g. San Francisco, CA"
assert function["parameters"]["properties"]["unit"]["type"] == "string"
assert set(function["parameters"]["properties"]["unit"]["enum"]) == {"celsius", "fahrenheit"}
assert function["parameters"]["properties"]["unit"]["description"] == "The temperature unit to use (Default: celsius)"
assert set(function["parameters"]["required"]) == {"location"}
Metadata
Release files for openai-tiny-function-calling 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| openai_tiny_function_calling-0.0.1.tar.gz | 3.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openai_tiny_function_calling-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.7 kB
Release files / openai_tiny_function_calling-0.0.1.tar.gz
| Download URL | openai_tiny_function_calling-0.0.1.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6d1c4d575f83f099b2c45b7758ea2e76b80ab2cfbb38f1ff143ff7ef54d19ac3
|
|
BLAKE2b-256 checksum How to use checksums |
4feef04b36f98ce3395871418892b499fd215cf10c7fde95c0f48eabae13f770
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|
Release files / openai_tiny_function_calling-0.0.1-py3-none-any.whl
| Download URL | openai_tiny_function_calling-0.0.1-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8b4be91a7d5d94e46ab69f8f12785bac9e34567bab2d493ed43a87bf07700df3
|
|
BLAKE2b-256 checksum How to use checksums |
231f1673d91102b64f636661a861e7c804afdb39af1af9b5bda58cb16daae7a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|