From b324bd04399d3e889d1d3e1187a4b4729b57b995 Mon Sep 17 00:00:00 2001 From: yashbonde Date: Wed, 7 Aug 2024 16:24:33 +0530 Subject: [PATCH] [0.4.16] add python 3.12 and update changelog --- cookbooks/function_calling.ipynb | 43 ++++++++++++++++++++------------ docs/changelog.rst | 22 ++++++++++++++++ docs/conf.py | 2 +- pyproject.toml | 4 +-- tuneapi/__init__.py | 2 +- tuneapi/types/chats.py | 1 + 6 files changed, 54 insertions(+), 20 deletions(-) diff --git a/cookbooks/function_calling.ipynb b/cookbooks/function_calling.ipynb index 6c6e0c6..2b8daf7 100644 --- a/cookbooks/function_calling.ipynb +++ b/cookbooks/function_calling.ipynb @@ -98,7 +98,7 @@ { "data": { "text/plain": [ - "\n", " \n", " \n", @@ -155,48 +155,51 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "{'name': 'find_movies', 'arguments': {'description': 'movies playing in Chennai', 'location': 'Chennai'}}\n" + "{'name': 'find_movies', 'arguments': {'location': 'Chennai', 'description': ' '}}\n" ] } ], "source": [ "# connect to a model from Tune Studio\n", "\n", + "model = ta.Openai()\n", + "\n", "# model = ta.TuneModel(\n", "# \"yash/yash-gpt-4o\",\n", - "# org_id = \"e41f60a3-06c9-4133-bc6d-127bc6f3f215\"\n", "# )\n", "\n", - "# or connect to few that have first class support\n", - "model = ta.Anthropic()\n", + "# # or connect to few that have first class support\n", + "# model = ta.Anthropic()\n", + "\n", + "\n", "out = model.chat(thread)\n", "print(out)" ] }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "\n", " \n", - " \n", + " \n", " \n", ">" ] }, - "execution_count": 7, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -211,28 +214,30 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "\n", " \n", - " \n", + " \n", " \n", " \n", ">" ] }, - "execution_count": 8, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# now attach a simple output after running the `find_movies` function\n", + "# resp = find_movies(**{'location': 'Chennai', 'description': ' '})\n", + "\n", "thread.append(tt.function_resp({\n", " \"movie\": \"Barbie\",\n", " \"theaters\": [\n", @@ -250,16 +255,22 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ + "Here are some movies showing in Chennai tonight:\n", "\n", + "### Barbie\n", + "- **Theater 1:** PVR - ECR\n", + " - **Address:** PVR: Heritage RSL ECR, Chennai - 600119\n", + "- **Theater 2:** Jazz Cinemas LUXE\n", + " - **Address:** No. 142, 2nd Floor, Phoenix Market City, Velachery Main Rd, Indira Gandhi Nagar, Velachery, Chennai, Tamil Nadu 600042\n", "\n", - "According to the results, the movie \"Barbie\" is currently playing in theaters in Chennai, specifically at PVR - ECR and Jazz Cinemas LUXE.\n" + "Would you like to know the specific showtimes for any of these movies?\n" ] } ], diff --git a/docs/changelog.rst b/docs/changelog.rst index 6a0f64c..2b898a2 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -7,6 +7,28 @@ minor versions. All relevant steps to be taken will be mentioned here. +0.4.16 +------ + +- Adding support for python 3.12 +- Adding ``tool`` as a valid role in ``tuneapi.types.chats.Message`` + +0.4.15 +------ + +- When there is an error in the model API, we used to print the error message. Now we are returning the error message + in the response. + +0.4.14 +------ + +- Fix bug where a loose ``pydantic`` import was present + +0.4.13 +------ + +- Bug fixes in JSON deserialisation + 0.4.12 ------ diff --git a/docs/conf.py b/docs/conf.py index 9b4f28f..039f190 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -13,7 +13,7 @@ project = "tuneapi" copyright = "2024, Frello Technologies" author = "Frello Technologies" -release = "0.4.15" +release = "0.4.16" # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/pyproject.toml b/pyproject.toml index 2cfca6e..d51a824 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "tuneapi" -version = "0.4.15" +version = "0.4.16" description = "Tune AI APIs." authors = ["Frello Technology Private Limited "] license = "MIT" @@ -8,7 +8,7 @@ readme = "README.md" repository = "https://github.com/NimbleBoxAI/tuneapi" [tool.poetry.dependencies] -python = "^3.10,<3.12" +python = "^3.10" fire = "0.5.0" requests = "^2.31.0" cloudpickle = "3.0.0" diff --git a/tuneapi/__init__.py b/tuneapi/__init__.py index 3e45ff4..23a9542 100644 --- a/tuneapi/__init__.py +++ b/tuneapi/__init__.py @@ -1,3 +1,3 @@ # Copyright © 2023- Frello Technology Private Limited -__version__ = "0.4.15" +__version__ = "0.4.16" diff --git a/tuneapi/types/chats.py b/tuneapi/types/chats.py index ffbbd2c..71c8f81 100644 --- a/tuneapi/types/chats.py +++ b/tuneapi/types/chats.py @@ -147,6 +147,7 @@ class Message: # function response "function_resp": FUNCTION_RESP, "function-resp": FUNCTION_RESP, + "tool": FUNCTION_RESP, } """A map that contains the popularly known mappings to make life simpler"""