behaviorgpt 0.2.0__tar.gz → 0.2.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.
- {behaviorgpt-0.2.0 → behaviorgpt-0.2.2}/PKG-INFO +3 -3
- {behaviorgpt-0.2.0 → behaviorgpt-0.2.2}/README.md +2 -2
- {behaviorgpt-0.2.0 → behaviorgpt-0.2.2}/pyproject.toml +1 -1
- {behaviorgpt-0.2.0 → behaviorgpt-0.2.2}/pyproject.toml.orig +1 -1
- {behaviorgpt-0.2.0 → behaviorgpt-0.2.2}/src/behaviorgpt/resources/catalogs.py +23 -2
- {behaviorgpt-0.2.0 → behaviorgpt-0.2.2}/LICENSE +0 -0
- {behaviorgpt-0.2.0 → behaviorgpt-0.2.2}/src/behaviorgpt/__init__.py +0 -0
- {behaviorgpt-0.2.0 → behaviorgpt-0.2.2}/src/behaviorgpt/_client.py +0 -0
- {behaviorgpt-0.2.0 → behaviorgpt-0.2.2}/src/behaviorgpt/_exceptions.py +0 -0
- {behaviorgpt-0.2.0 → behaviorgpt-0.2.2}/src/behaviorgpt/resources/__init__.py +0 -0
- {behaviorgpt-0.2.0 → behaviorgpt-0.2.2}/src/behaviorgpt/resources/_shared.py +0 -0
- {behaviorgpt-0.2.0 → behaviorgpt-0.2.2}/src/behaviorgpt/resources/recommendations.py +0 -0
- {behaviorgpt-0.2.0 → behaviorgpt-0.2.2}/src/behaviorgpt/resources/requests.py +0 -0
- {behaviorgpt-0.2.0 → behaviorgpt-0.2.2}/src/behaviorgpt/resources/search.py +0 -0
- {behaviorgpt-0.2.0 → behaviorgpt-0.2.2}/src/behaviorgpt/types/__init__.py +0 -0
- {behaviorgpt-0.2.0 → behaviorgpt-0.2.2}/src/behaviorgpt/types/domains.py +0 -0
- {behaviorgpt-0.2.0 → behaviorgpt-0.2.2}/src/behaviorgpt/types/events.py +0 -0
- {behaviorgpt-0.2.0 → behaviorgpt-0.2.2}/src/behaviorgpt/types/http.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: behaviorgpt
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Python client for BehaviorGPT, UnboxAI's Large Behavioral Model for search, recommendations and personalization
|
|
5
5
|
Keywords: recommendations,personalization,search,behavioral model,unboxai
|
|
6
6
|
Author: Unbox AI
|
|
@@ -122,7 +122,7 @@ JupyterLab opens in your browser. Open the notebook and pick the `behaviorgpt-en
|
|
|
122
122
|
The model can only return items it knows about. Out of the box the client uses `retail_catalog`, a sample retail catalog. To use the model on your own data, upload your catalog as a parquet file. A catalog doesn't have to be products for sale: artworks, articles, listings or anything else people browse and pick from work the same way.
|
|
123
123
|
|
|
124
124
|
- [`docs/catalog-format.md`](https://github.com/Unbox-AI/behaviorgpt/blob/main/docs/catalog-format.md) lists the required columns and types.
|
|
125
|
-
- A catalog can hold at most
|
|
125
|
+
- A catalog can hold at most 100,000 items.
|
|
126
126
|
- Each API key can hold 2 catalogs. The file name is the catalog's name: uploading a file with the same name again refreshes that catalog and keeps its `catalog_id`, and a new name takes one of the 2 slots. A failed upload does not use up a slot. Once both slots are in use, an upload under a new name is refused; to remove a catalog or raise the limit, contact alexander@unboxai.com.
|
|
127
127
|
- [`examples/sample_catalog.csv`](https://github.com/Unbox-AI/behaviorgpt/blob/main/examples/sample_catalog.csv) is an example only, showing what each column should contain. Your own file will look different depending on your catalog, and it has to be converted to the parquet structure described in the format doc before upload.
|
|
128
128
|
|
|
@@ -141,7 +141,7 @@ client.add_items("new_items.parquet", catalog_id=job.catalog_id, wait=True)
|
|
|
141
141
|
|
|
142
142
|
- An item whose `id` is already in the catalog is replaced with the new row; any other item is added. Nothing is removed.
|
|
143
143
|
- The new items are embedded at the catalog's own reference time, so their ages and sales are measured the same way as the rest of the catalog's.
|
|
144
|
-
- The
|
|
144
|
+
- The 100,000-item limit counts the whole catalog: the items it holds plus the new ones.
|
|
145
145
|
- One `add_items` job runs per catalog at a time, and the catalog cannot be refreshed or deleted while it runs.
|
|
146
146
|
- Uploading the catalog's file again with `embed` replaces the whole catalog, added items included. Put them in that file too to keep them.
|
|
147
147
|
- A catalog embedded before `add_items` existed needs one more full upload before items can be added to it.
|
|
@@ -105,7 +105,7 @@ JupyterLab opens in your browser. Open the notebook and pick the `behaviorgpt-en
|
|
|
105
105
|
The model can only return items it knows about. Out of the box the client uses `retail_catalog`, a sample retail catalog. To use the model on your own data, upload your catalog as a parquet file. A catalog doesn't have to be products for sale: artworks, articles, listings or anything else people browse and pick from work the same way.
|
|
106
106
|
|
|
107
107
|
- [`docs/catalog-format.md`](https://github.com/Unbox-AI/behaviorgpt/blob/main/docs/catalog-format.md) lists the required columns and types.
|
|
108
|
-
- A catalog can hold at most
|
|
108
|
+
- A catalog can hold at most 100,000 items.
|
|
109
109
|
- Each API key can hold 2 catalogs. The file name is the catalog's name: uploading a file with the same name again refreshes that catalog and keeps its `catalog_id`, and a new name takes one of the 2 slots. A failed upload does not use up a slot. Once both slots are in use, an upload under a new name is refused; to remove a catalog or raise the limit, contact alexander@unboxai.com.
|
|
110
110
|
- [`examples/sample_catalog.csv`](https://github.com/Unbox-AI/behaviorgpt/blob/main/examples/sample_catalog.csv) is an example only, showing what each column should contain. Your own file will look different depending on your catalog, and it has to be converted to the parquet structure described in the format doc before upload.
|
|
111
111
|
|
|
@@ -124,7 +124,7 @@ client.add_items("new_items.parquet", catalog_id=job.catalog_id, wait=True)
|
|
|
124
124
|
|
|
125
125
|
- An item whose `id` is already in the catalog is replaced with the new row; any other item is added. Nothing is removed.
|
|
126
126
|
- The new items are embedded at the catalog's own reference time, so their ages and sales are measured the same way as the rest of the catalog's.
|
|
127
|
-
- The
|
|
127
|
+
- The 100,000-item limit counts the whole catalog: the items it holds plus the new ones.
|
|
128
128
|
- One `add_items` job runs per catalog at a time, and the catalog cannot be refreshed or deleted while it runs.
|
|
129
129
|
- Uploading the catalog's file again with `embed` replaces the whole catalog, added items included. Put them in that file too to keep them.
|
|
130
130
|
- A catalog embedded before `add_items` existed needs one more full upload before items can be added to it.
|
|
@@ -49,10 +49,31 @@ CATALOG_SCHEMA = {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
|
|
52
|
+
def _plain_type(t: pa.DataType) -> pa.DataType:
|
|
53
|
+
"""The embedder casts large, view and dictionary layouts to their plain
|
|
54
|
+
forms before it checks a type, so the check here does the same."""
|
|
55
|
+
if pa.types.is_dictionary(t):
|
|
56
|
+
return _plain_type(t.value_type)
|
|
57
|
+
if pa.types.is_large_string(t) or pa.types.is_string_view(t):
|
|
58
|
+
return pa.string()
|
|
59
|
+
if pa.types.is_large_binary(t) or pa.types.is_binary_view(t):
|
|
60
|
+
return pa.binary()
|
|
61
|
+
if (
|
|
62
|
+
pa.types.is_list(t)
|
|
63
|
+
or pa.types.is_large_list(t)
|
|
64
|
+
or pa.types.is_list_view(t)
|
|
65
|
+
or pa.types.is_large_list_view(t)
|
|
66
|
+
):
|
|
67
|
+
return pa.list_(_plain_type(t.value_type))
|
|
68
|
+
return t
|
|
69
|
+
|
|
70
|
+
|
|
52
71
|
def check_catalog_schema(path: Path) -> None:
|
|
53
72
|
"""Raise `UnboxAIError` if the parquet's columns do not match `CATALOG_SCHEMA`.
|
|
54
73
|
|
|
55
|
-
An entirely null column has Arrow type `null` and is accepted
|
|
74
|
+
An entirely null column has Arrow type `null` and is accepted, and so are
|
|
75
|
+
the large, view and dictionary layouts of a type, which pandas 3 and polars
|
|
76
|
+
write by default.
|
|
56
77
|
"""
|
|
57
78
|
try:
|
|
58
79
|
schema = pq.read_schema(path)
|
|
@@ -64,7 +85,7 @@ def check_catalog_schema(path: Path) -> None:
|
|
|
64
85
|
problems.append(f"{column}: missing")
|
|
65
86
|
continue
|
|
66
87
|
actual = schema.field(column).type
|
|
67
|
-
if actual != expected and not pa.types.is_null(actual):
|
|
88
|
+
if _plain_type(actual) != expected and not pa.types.is_null(actual):
|
|
68
89
|
problems.append(f"{column}: expected {expected}, got {actual}")
|
|
69
90
|
if problems:
|
|
70
91
|
raise UnboxAIError(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|