Skip to content

Commit b324bd0

Browse files
committed
[0.4.16] add python 3.12 and update changelog
1 parent 008d0fa commit b324bd0

File tree

6 files changed

+54
-20
lines changed

6 files changed

+54
-20
lines changed

cookbooks/function_calling.ipynb

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
{
9999
"data": {
100100
"text/plain": [
101-
"<Thread 'thread_49649210139099136' \n",
101+
"<Thread 'thread_71815343378436098' \n",
102102
" <system: \"You are Tune Blob, a super star AI movie buff!\">\n",
103103
" <human: \"What movies are showing in Chennai tonight?\">\n",
104104
" <tools: ['find_movies', 'find_theaters', 'get_showtimes']>\n",
@@ -155,48 +155,51 @@
155155
},
156156
{
157157
"cell_type": "code",
158-
"execution_count": 6,
158+
"execution_count": 5,
159159
"metadata": {},
160160
"outputs": [
161161
{
162162
"name": "stdout",
163163
"output_type": "stream",
164164
"text": [
165-
"{'name': 'find_movies', 'arguments': {'description': 'movies playing in Chennai', 'location': 'Chennai'}}\n"
165+
"{'name': 'find_movies', 'arguments': {'location': 'Chennai', 'description': ' '}}\n"
166166
]
167167
}
168168
],
169169
"source": [
170170
"# connect to a model from Tune Studio\n",
171171
"\n",
172+
"model = ta.Openai()\n",
173+
"\n",
172174
"# model = ta.TuneModel(\n",
173175
"# \"yash/yash-gpt-4o\",\n",
174-
"# org_id = \"e41f60a3-06c9-4133-bc6d-127bc6f3f215\"\n",
175176
"# )\n",
176177
"\n",
177-
"# or connect to few that have first class support\n",
178-
"model = ta.Anthropic()\n",
178+
"# # or connect to few that have first class support\n",
179+
"# model = ta.Anthropic()\n",
180+
"\n",
181+
"\n",
179182
"out = model.chat(thread)\n",
180183
"print(out)"
181184
]
182185
},
183186
{
184187
"cell_type": "code",
185-
"execution_count": 7,
188+
"execution_count": 6,
186189
"metadata": {},
187190
"outputs": [
188191
{
189192
"data": {
190193
"text/plain": [
191-
"<Thread 'thread_49649210139099136' \n",
194+
"<Thread 'thread_71815343378436098' \n",
192195
" <system: \"You are Tune Blob, a super star AI movie buff!\">\n",
193196
" <human: \"What movies are showing in Chennai tonight?\">\n",
194-
" <function_call: {\"name\": \"find_movies\", \"arguments\": {\"description>\n",
197+
" <function_call: {\"name\": \"find_movies\", \"arguments\": {\"location\": >\n",
195198
" <tools: ['find_movies', 'find_theaters', 'get_showtimes']>\n",
196199
">"
197200
]
198201
},
199-
"execution_count": 7,
202+
"execution_count": 6,
200203
"metadata": {},
201204
"output_type": "execute_result"
202205
}
@@ -211,28 +214,30 @@
211214
},
212215
{
213216
"cell_type": "code",
214-
"execution_count": 8,
217+
"execution_count": 7,
215218
"metadata": {},
216219
"outputs": [
217220
{
218221
"data": {
219222
"text/plain": [
220-
"<Thread 'thread_49649210139099136' \n",
223+
"<Thread 'thread_71815343378436098' \n",
221224
" <system: \"You are Tune Blob, a super star AI movie buff!\">\n",
222225
" <human: \"What movies are showing in Chennai tonight?\">\n",
223-
" <function_call: {\"name\": \"find_movies\", \"arguments\": {\"description>\n",
226+
" <function_call: {\"name\": \"find_movies\", \"arguments\": {\"location\": >\n",
224227
" <function_resp: {\"movie\": \"Barbie\", \"theaters\": [{\"name\": \"PVR - E>\n",
225228
" <tools: ['find_movies', 'find_theaters', 'get_showtimes']>\n",
226229
">"
227230
]
228231
},
229-
"execution_count": 8,
232+
"execution_count": 7,
230233
"metadata": {},
231234
"output_type": "execute_result"
232235
}
233236
],
234237
"source": [
235238
"# now attach a simple output after running the `find_movies` function\n",
239+
"# resp = find_movies(**{'location': 'Chennai', 'description': ' '})\n",
240+
"\n",
236241
"thread.append(tt.function_resp({\n",
237242
" \"movie\": \"Barbie\",\n",
238243
" \"theaters\": [\n",
@@ -250,16 +255,22 @@
250255
},
251256
{
252257
"cell_type": "code",
253-
"execution_count": 11,
258+
"execution_count": 8,
254259
"metadata": {},
255260
"outputs": [
256261
{
257262
"name": "stdout",
258263
"output_type": "stream",
259264
"text": [
265+
"Here are some movies showing in Chennai tonight:\n",
260266
"\n",
267+
"### Barbie\n",
268+
"- **Theater 1:** PVR - ECR\n",
269+
" - **Address:** PVR: Heritage RSL ECR, Chennai - 600119\n",
270+
"- **Theater 2:** Jazz Cinemas LUXE\n",
271+
" - **Address:** No. 142, 2nd Floor, Phoenix Market City, Velachery Main Rd, Indira Gandhi Nagar, Velachery, Chennai, Tamil Nadu 600042\n",
261272
"\n",
262-
"According to the results, the movie \"Barbie\" is currently playing in theaters in Chennai, specifically at PVR - ECR and Jazz Cinemas LUXE.\n"
273+
"Would you like to know the specific showtimes for any of these movies?\n"
263274
]
264275
}
265276
],

docs/changelog.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,28 @@ minor versions.
77

88
All relevant steps to be taken will be mentioned here.
99

10+
0.4.16
11+
------
12+
13+
- Adding support for python 3.12
14+
- Adding ``tool`` as a valid role in ``tuneapi.types.chats.Message``
15+
16+
0.4.15
17+
------
18+
19+
- When there is an error in the model API, we used to print the error message. Now we are returning the error message
20+
in the response.
21+
22+
0.4.14
23+
------
24+
25+
- Fix bug where a loose ``pydantic`` import was present
26+
27+
0.4.13
28+
------
29+
30+
- Bug fixes in JSON deserialisation
31+
1032
0.4.12
1133
------
1234

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
project = "tuneapi"
1414
copyright = "2024, Frello Technologies"
1515
author = "Frello Technologies"
16-
release = "0.4.15"
16+
release = "0.4.16"
1717

1818
# -- General configuration ---------------------------------------------------
1919
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[tool.poetry]
22
name = "tuneapi"
3-
version = "0.4.15"
3+
version = "0.4.16"
44
description = "Tune AI APIs."
55
authors = ["Frello Technology Private Limited <[email protected]>"]
66
license = "MIT"
77
readme = "README.md"
88
repository = "https://github.com/NimbleBoxAI/tuneapi"
99

1010
[tool.poetry.dependencies]
11-
python = "^3.10,<3.12"
11+
python = "^3.10"
1212
fire = "0.5.0"
1313
requests = "^2.31.0"
1414
cloudpickle = "3.0.0"

tuneapi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Copyright © 2023- Frello Technology Private Limited
22

3-
__version__ = "0.4.15"
3+
__version__ = "0.4.16"

tuneapi/types/chats.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ class Message:
147147
# function response
148148
"function_resp": FUNCTION_RESP,
149149
"function-resp": FUNCTION_RESP,
150+
"tool": FUNCTION_RESP,
150151
}
151152
"""A map that contains the popularly known mappings to make life simpler"""
152153

0 commit comments

Comments
 (0)