Skip to content

Commit 2fabdae

Browse files
committed
[0.4.18] fix function response API call
1 parent b324bd0 commit 2fabdae

File tree

11 files changed

+31
-16
lines changed

11 files changed

+31
-16
lines changed

docs/changelog.rst

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

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

10+
0.4.18
11+
------
12+
13+
- Fix bug where function response was tried to be deserialised to the JSON and then sent to the different APIs.
14+
15+
0.4.17
16+
------
17+
18+
- Fix error in ``tuneapi.utils.serdeser.to_s3`` function where content type key was incorrect
19+
1020
0.4.16
1121
------
1222

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.16"
16+
release = "0.4.18"
1717

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

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "tuneapi"
3-
version = "0.4.16"
3+
version = "0.4.18"
44
description = "Tune AI APIs."
55
authors = ["Frello Technology Private Limited <[email protected]>"]
66
license = "MIT"

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.16"
3+
__version__ = "0.4.18"

tuneapi/apis/model_anthropic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,14 @@ def _process_input(self, chats, token: Optional[str] = None):
114114
],
115115
}
116116
elif m.role == Message.FUNCTION_RESP:
117-
_m = tu.from_json(m.value) if isinstance(m.value, str) else m.value
117+
# _m = tu.from_json(m.value) if isinstance(m.value, str) else m.value
118118
msg = {
119119
"role": "user",
120120
"content": [
121121
{
122122
"type": "tool_result",
123123
"tool_use_id": prev_tool_id,
124-
"content": tu.to_json(_m, tight=True),
124+
"content": tu.to_json(m.value, tight=True),
125125
}
126126
],
127127
}

tuneapi/apis/model_gemini.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def _process_input(self, chats, token: Optional[str] = None):
7676
}
7777
)
7878
elif m.role == tt.Message.FUNCTION_RESP:
79-
_m = tu.from_json(m.value) if isinstance(m.value, str) else m.value
79+
# _m = tu.from_json(m.value) if isinstance(m.value, str) else m.value
8080
messages.append(
8181
{
8282
"role": "function",
@@ -86,7 +86,7 @@ def _process_input(self, chats, token: Optional[str] = None):
8686
"name": prev_fn_name,
8787
"response": {
8888
"name": prev_fn_name,
89-
"content": _m,
89+
"content": m.value,
9090
},
9191
}
9292
}

tuneapi/apis/model_groq.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ def _process_input(self, chats, token: Optional[str] = None):
7070
}
7171
)
7272
elif m.role == tt.Message.FUNCTION_RESP:
73-
_m = tu.from_json(m.value) if isinstance(m.value, str) else m.value
73+
# _m = tu.from_json(m.value) if isinstance(m.value, str) else m.value
7474
final_messages.append(
7575
{
7676
"role": "tool",
7777
"tool_call_id": prev_tool_id,
78-
"content": tu.to_json(_m, tight=True),
78+
"content": tu.to_json(m.value, tight=True),
7979
}
8080
)
8181
prev_tool_id = tu.get_random_string(5) # reset tool id

tuneapi/apis/model_mistral.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ def _process_input(self, chats, token: Optional[str] = None):
7373
}
7474
)
7575
elif m.role == tt.Message.FUNCTION_RESP:
76-
_m = tu.from_json(m.value) if isinstance(m.value, str) else m.value
76+
# _m = tu.from_json(m.value) if isinstance(m.value, str) else m.value
7777
final_messages.append(
7878
{
7979
"role": "tool",
8080
"tool_call_id": prev_tool_id,
81-
"content": tu.to_json(_m, tight=True),
81+
"content": tu.to_json(m.value, tight=True),
8282
}
8383
)
8484
prev_tool_id = tu.get_random_string(5) # reset tool id

tuneapi/apis/model_openai.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ def _process_input(self, chats, token: Optional[str] = None):
7070
}
7171
)
7272
elif m.role == tt.Message.FUNCTION_RESP:
73-
_m = tu.from_json(m.value) if isinstance(m.value, str) else m.value
73+
# _m = tu.from_json(m.value) if isinstance(m.value, str) else m.value
7474
final_messages.append(
7575
{
7676
"role": "tool",
7777
"tool_call_id": prev_tool_id,
78-
"content": tu.to_json(_m, tight=True),
78+
"content": tu.to_json(m.value, tight=True),
7979
}
8080
)
8181
prev_tool_id = tu.get_random_string(5) # reset tool id

tuneapi/apis/model_tune.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ def _process_input(self, chats, token: Optional[str] = None):
8585
}
8686
)
8787
elif m.role == tt.Message.FUNCTION_RESP:
88-
_m = tu.from_json(m.value) if isinstance(m.value, str) else m.value
88+
# _m = tu.from_json(m.value) if isinstance(m.value, str) else m.value
8989
final_messages.append(
9090
{
9191
"role": "tool",
9292
"tool_call_id": prev_tool_id,
93-
"content": tu.to_json(_m, tight=True),
93+
"content": tu.to_json(m.value, tight=True),
9494
}
9595
)
9696
prev_tool_id = tu.get_random_string(5) # reset tool id

0 commit comments

Comments
 (0)