Skip to content

Commit 5507687

Browse files
committed
[0.7.3] bug fixes + update copyright header
1 parent aa6ab55 commit 5507687

38 files changed

+622
-693
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
This is **not** the official SDK for Tune AI. This is an open source python package used to build GenAI apps at Tune AI.
44

5+
> MIT License

benchmarks/threaded_map.py

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

33
from tuneapi.types import Thread, ModelInterface, human, system
44
from tuneapi.utils import from_json

cookbooks/finetuning.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@
230230
"name": "python",
231231
"nbconvert_exporter": "python",
232232
"pygments_lexer": "ipython3",
233-
"version": "3.11.7"
233+
"version": "3.13.0"
234234
}
235235
},
236236
"nbformat": 4,

docs/changelog.rst

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

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

10+
0.7.3
11+
-----
12+
13+
- Fix bug in image modality for Gemini
14+
- Fix bug in structured generation for OpenAI by setting ``strict=True`` in the API.
15+
- Fix bug in structured generation for Gemini
16+
- Abstracted making input structure for ``Anthropic``, ``OpenAI`` and ``Gemini`` using ``_process_input`` method
17+
- Abstracted outputs for ``Anthropic``, ``OpenAI`` and ``Gemini`` using ``_process_output`` method
18+
19+
20+
0.7.2
21+
-----
22+
23+
- Add image modality for Gemini and OpenAI to complement Anthropic.
24+
25+
1026
0.7.1
1127
-----
1228

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
1212

1313
project = "tuneapi"
14-
copyright = "2024, Frello Technologies"
14+
copyright = "2024-2025, Frello Technologies"
1515
author = "Frello Technologies"
16-
release = "0.7.1"
16+
release = "0.7.3"
1717

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

pyproject.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "tuneapi"
3-
version = "0.7.1"
3+
version = "0.7.3"
44
description = "Tune AI APIs."
55
authors = ["Frello Technology Private Limited <[email protected]>"]
66
license = "MIT"
@@ -27,9 +27,6 @@ boto3 = ["boto3"]
2727
protobuf = ["protobuf"]
2828
all = ["boto3", "protobuf"]
2929

30-
# [tool.poetry.scripts]
31-
# tuneapi = "tuneapi.__main__:main"
32-
3330
[tool.poetry.group.dev.dependencies]
3431
sphinx = "7.2.5"
3532
sphinx_rtd_theme = "1.3.0"

tests/test_apis.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright © 2023- Frello Technology Private Limited
2+
3+
from tuneapi import ta, tt
4+
5+
import asyncio
6+
from pydantic import BaseModel
7+
8+
# fmt: off
9+
print("[BLOCKING] [Anthropic]", ta.Anthropic().chat("2 + 2 =", max_tokens=10))
10+
print("[BLOCKING] [Openai]", ta.Openai().chat("2 + 2 =", max_tokens=10))
11+
print("[BLOCKING] [Gemini]", ta.Gemini().chat("2 + 2 =", max_tokens=10))
12+
print("[BLOCKING] [Mistral]", ta.Mistral().chat("2 + 2 =", max_tokens=10))
13+
print("[BLOCKING] [Groq]", ta.Groq().chat("2 + 2 =", max_tokens=10))
14+
print("[BLOCKING] [TuneAI]", ta.TuneModel("meta/llama-3.1-8b-instruct").chat("2 + 2 =", max_tokens=10))
15+
# fmt: on
16+
17+
18+
class Result(BaseModel):
19+
result: int
20+
21+
22+
# fmt: off
23+
print("[BLOCKING] [STRUCTURE] [Openai]", ta.Openai().chat(tt.Thread(tt.human("2 + 2 ="), schema=Result), max_tokens=10).result)
24+
print("[BLOCKING] [STRUCTURE] [Gemini]", ta.Gemini().chat(tt.Thread(tt.human("2 + 2 ="), schema=Result), max_tokens=10).result)
25+
# fmt: on
26+
27+
28+
async def main():
29+
# fmt: off
30+
print("[ASYNC] [Anthropic]", await ta.Anthropic().chat_async("2 + 2 =", max_tokens=10))
31+
print("[ASYNC] [Openai]", await ta.Openai().chat_async("2 + 2 =", max_tokens=10))
32+
print("[ASYNC] [Gemini]", await ta.Gemini().chat_async("2 + 2 =", max_tokens=10))
33+
print("[ASYNC] [Mistral]", await ta.Mistral().chat_async("2 + 2 =", max_tokens=10))
34+
print("[ASYNC] [Groq]", await ta.Groq().chat_async("2 + 2 =", max_tokens=10))
35+
print("[ASYNC] [TuneAI]", await ta.TuneModel("meta/llama-3.1-8b-instruct").chat_async("2 + 2 =", max_tokens=10))
36+
# fmt: on
37+
38+
39+
asyncio.run(main())

tests/test_tree.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright © 2024- Frello Technology Private Limited
1+
# Copyright © 2024-2025 Frello Technology Private Limited
22

33
import tuneapi.types as tt
44

@@ -24,7 +24,9 @@ def get_tree() -> tt.ThreadsTree:
2424
"```<function ... you go.",
2525
fn_pairs=[
2626
(
27-
tt.function_call("{list_tools: arguments"),
27+
tt.function_call(
28+
{"name": "list_tools", "arguments": "{}"}
29+
),
2830
tt.function_resp("{...}"),
2931
)
3032
],
@@ -46,7 +48,9 @@ def get_tree() -> tt.ThreadsTree:
4648
"```<function ... @apple.com] sent!",
4749
fn_pairs=[
4850
(
49-
tt.function_call("{send_email: arguments"),
51+
tt.function_call(
52+
{"name": "send_email", "arguments": "{}"}
53+
),
5054
tt.function_resp("{...}"),
5155
)
5256
],

tuneapi/apis/__init__.py

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

33
# model APIs
44
from tuneapi.apis.model_tune import TuneModel

0 commit comments

Comments
 (0)