Skip to content

Commit

Permalink
[0.4.16] add python 3.12 and update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
yashbonde committed Aug 7, 2024
1 parent 008d0fa commit b324bd0
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 20 deletions.
43 changes: 27 additions & 16 deletions cookbooks/function_calling.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
{
"data": {
"text/plain": [
"<Thread 'thread_49649210139099136' \n",
"<Thread 'thread_71815343378436098' \n",
" <system: \"You are Tune Blob, a super star AI movie buff!\">\n",
" <human: \"What movies are showing in Chennai tonight?\">\n",
" <tools: ['find_movies', 'find_theaters', 'get_showtimes']>\n",
Expand Down Expand Up @@ -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": [
"<Thread 'thread_49649210139099136' \n",
"<Thread 'thread_71815343378436098' \n",
" <system: \"You are Tune Blob, a super star AI movie buff!\">\n",
" <human: \"What movies are showing in Chennai tonight?\">\n",
" <function_call: {\"name\": \"find_movies\", \"arguments\": {\"description>\n",
" <function_call: {\"name\": \"find_movies\", \"arguments\": {\"location\": >\n",
" <tools: ['find_movies', 'find_theaters', 'get_showtimes']>\n",
">"
]
},
"execution_count": 7,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -211,28 +214,30 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<Thread 'thread_49649210139099136' \n",
"<Thread 'thread_71815343378436098' \n",
" <system: \"You are Tune Blob, a super star AI movie buff!\">\n",
" <human: \"What movies are showing in Chennai tonight?\">\n",
" <function_call: {\"name\": \"find_movies\", \"arguments\": {\"description>\n",
" <function_call: {\"name\": \"find_movies\", \"arguments\": {\"location\": >\n",
" <function_resp: {\"movie\": \"Barbie\", \"theaters\": [{\"name\": \"PVR - E>\n",
" <tools: ['find_movies', 'find_theaters', 'get_showtimes']>\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",
Expand All @@ -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"
]
}
],
Expand Down
22 changes: 22 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
------

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[tool.poetry]
name = "tuneapi"
version = "0.4.15"
version = "0.4.16"
description = "Tune AI APIs."
authors = ["Frello Technology Private Limited <[email protected]>"]
license = "MIT"
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"
Expand Down
2 changes: 1 addition & 1 deletion tuneapi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Copyright © 2023- Frello Technology Private Limited

__version__ = "0.4.15"
__version__ = "0.4.16"
1 change: 1 addition & 0 deletions tuneapi/types/chats.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""

Expand Down

0 comments on commit b324bd0

Please sign in to comment.