No project description provided
Project description
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"}
Project details
Release history Release notifications | RSS feed
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 openai_tiny_function_calling-0.0.1.tar.gz.
File metadata
- Download URL: openai_tiny_function_calling-0.0.1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d1c4d575f83f099b2c45b7758ea2e76b80ab2cfbb38f1ff143ff7ef54d19ac3
|
|
| MD5 |
5efc8200681fae33055eca4a591e6325
|
|
| BLAKE2b-256 |
4feef04b36f98ce3395871418892b499fd215cf10c7fde95c0f48eabae13f770
|
File details
Details for the file openai_tiny_function_calling-0.0.1-py3-none-any.whl.
File metadata
- Download URL: openai_tiny_function_calling-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b4be91a7d5d94e46ab69f8f12785bac9e34567bab2d493ed43a87bf07700df3
|
|
| MD5 |
264abd32c7ac9b46bb0339f89504e132
|
|
| BLAKE2b-256 |
231f1673d91102b64f636661a861e7c804afdb39af1af9b5bda58cb16daae7a6
|