tool_call_models 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tool_call_models-0.1.2/PKG-INFO +17 -0
- tool_call_models-0.1.2/README.md +0 -0
- tool_call_models-0.1.2/pyproject.toml +17 -0
- tool_call_models-0.1.2/tool_call_models/__init__.py +28 -0
- tool_call_models-0.1.2/tool_call_models/base.py +11 -0
- tool_call_models-0.1.2/tool_call_models/home_balance.py +24 -0
- tool_call_models-0.1.2/tool_call_models/paynet.py +20 -0
- tool_call_models-0.1.2/tool_call_models/smartbazar.py +37 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: tool_call_models
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: A simple package of models used between two services in order to achieve SDUI widgets using LLMs.
|
|
5
|
+
License: MIT
|
|
6
|
+
Author: Aslon Khamidov
|
|
7
|
+
Author-email: hamidovaslon1@gmail.com
|
|
8
|
+
Requires-Python: >=3.11
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Requires-Dist: pydantic
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "tool_call_models"
|
|
3
|
+
version = "0.1.2"
|
|
4
|
+
description = "A simple package of models used between two services in order to achieve SDUI widgets using LLMs."
|
|
5
|
+
authors = [{ name="Aslon Khamidov", email="hamidovaslon1@gmail.com" }]
|
|
6
|
+
readme = "README.md"
|
|
7
|
+
license = "MIT"
|
|
8
|
+
requires-python = ">=3.11"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
dependencies = ["pydantic"]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
[build-system]
|
|
16
|
+
requires = ["poetry-core>=2.0.0,<3.0.0"]
|
|
17
|
+
build-backend = "poetry.core.masonry.api"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from .base import BaseToolCallModel
|
|
2
|
+
from .home_balance import HomeBalance, HomeBalanceDetails
|
|
3
|
+
from .paynet import (
|
|
4
|
+
GetSupplierByCategoryOptions,
|
|
5
|
+
GetSupplierByCategoryPayload,
|
|
6
|
+
GetSupplierByCategoryResponse,
|
|
7
|
+
)
|
|
8
|
+
from .smartbazar import (
|
|
9
|
+
Brand,
|
|
10
|
+
MainCategory,
|
|
11
|
+
Merchant,
|
|
12
|
+
Offer,
|
|
13
|
+
ProductItem,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
__all__ = [
|
|
17
|
+
"BaseToolCallModel",
|
|
18
|
+
"HomeBalance",
|
|
19
|
+
"HomeBalanceDetails",
|
|
20
|
+
"GetSupplierByCategoryOptions",
|
|
21
|
+
"GetSupplierByCategoryPayload",
|
|
22
|
+
"GetSupplierByCategoryResponse",
|
|
23
|
+
"Brand",
|
|
24
|
+
"MainCategory",
|
|
25
|
+
"Merchant",
|
|
26
|
+
"Offer",
|
|
27
|
+
"ProductItem",
|
|
28
|
+
]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from typing import Any, Dict, Optional
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class BaseToolCallModel(ABC):
|
|
6
|
+
"""Base class for all models in the application."""
|
|
7
|
+
|
|
8
|
+
@abstractmethod
|
|
9
|
+
def filter_for_llm(self) -> Dict[str, Any]:
|
|
10
|
+
"""Filter model for LLM."""
|
|
11
|
+
pass
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from pydantic import BaseModel, Field, model_validator
|
|
2
|
+
from typing import Dict
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class HomeBalanceDetails(BaseModel):
|
|
6
|
+
balance: int
|
|
7
|
+
# details: Dict[str, int]
|
|
8
|
+
|
|
9
|
+
def __init__(self, **data):
|
|
10
|
+
if "balance" in data:
|
|
11
|
+
data["balance"] = data["balance"] // 100
|
|
12
|
+
super().__init__(**data)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class HomeBalance(BaseModel):
|
|
16
|
+
homeName: str
|
|
17
|
+
services: Dict[str, HomeBalanceDetails] = Field(default_factory=dict)
|
|
18
|
+
|
|
19
|
+
@model_validator(mode="before")
|
|
20
|
+
def extract_services(cls, values):
|
|
21
|
+
known_keys = {"homeName"}
|
|
22
|
+
services = {k: v for k, v in values.items() if k not in known_keys}
|
|
23
|
+
values["services"] = services
|
|
24
|
+
return values
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from pydantic import BaseModel, Field
|
|
2
|
+
from typing import List
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class GetSupplierByCategoryOptions(BaseModel):
|
|
6
|
+
idx: int = Field(alias="id")
|
|
7
|
+
categoryId: int = Field(alias="categoryId")
|
|
8
|
+
name: str
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class GetSupplierByCategoryPayload(BaseModel):
|
|
12
|
+
idx: int = Field(alias="id", default=None)
|
|
13
|
+
value: List[GetSupplierByCategoryOptions] = None
|
|
14
|
+
categoryId: int = Field(alias="categoryId")
|
|
15
|
+
name: str
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class GetSupplierByCategoryResponse(BaseModel):
|
|
19
|
+
description: str
|
|
20
|
+
payload: List[GetSupplierByCategoryPayload]
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
from pydantic import BaseModel, Field
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Brand(BaseModel):
|
|
6
|
+
# id: Optional[int] = None
|
|
7
|
+
name: Optional[str] = None
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class MainCategory(BaseModel):
|
|
11
|
+
id: Optional[int] = None
|
|
12
|
+
name: Optional[str] = None
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Merchant(BaseModel):
|
|
16
|
+
# id: Optional[int] = None
|
|
17
|
+
name: Optional[str] = None
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class Offer(BaseModel):
|
|
21
|
+
original_price: Optional[int] = None
|
|
22
|
+
price: Optional[int] = None
|
|
23
|
+
three_month_price: Optional[int] = Field(default=None, alias="3_month_price")
|
|
24
|
+
six_month_price: Optional[int] = Field(default=None, alias="6_month_price")
|
|
25
|
+
nine_month_price: Optional[int] = Field(default=None, alias="9_month_price")
|
|
26
|
+
twelve_month_price: Optional[int] = Field(default=None, alias="12_month_price")
|
|
27
|
+
eighteen_month_price: Optional[int] = Field(default=None, alias="18_month_price")
|
|
28
|
+
merchant: Optional[Merchant] = None
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class ProductItem(BaseModel):
|
|
32
|
+
# id: Optional[int] = None
|
|
33
|
+
name_ru: Optional[str] = None
|
|
34
|
+
brand: Optional[Brand] = None
|
|
35
|
+
# main_categories: Optional[list[MainCategory]] = None
|
|
36
|
+
|
|
37
|
+
offers: Optional[list[Offer]] = None
|