fiuai-sdk-python 0.8.3__tar.gz → 0.8.4__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.
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/PKG-INFO +1 -1
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/pyproject.toml +1 -1
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/setup.py +31 -3
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/type.py +9 -1
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/.gitignore +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/CHANGELOG.md +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/LICENSE +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/README.md +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/__init__.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/auth/__init__.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/auth/context_mgr.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/auth/header.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/auth/helper.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/auth/type.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/bank.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/client.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/company.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/config.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/const.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/context.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/datatype.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/doctype.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/error.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/examples/fastapi_integration.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/http/__init__.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/http/client.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/item.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/perm.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/pkg/cache/__init__.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/pkg/cache/cache_client.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/pkg/cache/circuit_breaker.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/pkg/cache/decorator.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/pkg/cache/redis_manager.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/pkg/cache/types.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/profile.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/resp.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/util.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/utils/__init__.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/utils/ids.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/utils/logger.py +0 -0
- {fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/utils/text.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fiuai_sdk_python
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.4
|
|
4
4
|
Summary: FiuAI Python SDK - 企业级AI服务集成开发工具包
|
|
5
5
|
Project-URL: Homepage, https://github.com/fiuai/fiuai-sdk-python
|
|
6
6
|
Project-URL: Documentation, https://github.com/fiuai/fiuai-sdk-python#readme
|
|
@@ -9,16 +9,17 @@
|
|
|
9
9
|
|
|
10
10
|
USED_COUNTRY_LIST = ["China", "United States", "Japan", "Thailand", "India", "Indonesia", "Malaysia", "Philippines", "Singapore", "South Korea", "United Kingdom", "Vietnam"]
|
|
11
11
|
USED_LANGUAGE_LIST = ["zh", "en", "ja", "th", "id", "ms", "ph", "sg", "kr", "uk", "vn"]
|
|
12
|
+
from typing import List
|
|
12
13
|
from .type import (
|
|
13
14
|
UOM,
|
|
14
15
|
Currency,
|
|
15
16
|
Country,
|
|
16
17
|
Language,
|
|
17
18
|
DocTypeMeta,
|
|
19
|
+
FieldFetchFrom,
|
|
20
|
+
DocField,
|
|
18
21
|
)
|
|
19
22
|
from .datatype import DocFieldType
|
|
20
|
-
from .type import DocField
|
|
21
|
-
from typing import List
|
|
22
23
|
from logging import getLogger
|
|
23
24
|
|
|
24
25
|
from .client import FiuaiSDK
|
|
@@ -137,6 +138,14 @@ def _get_meta(client: FiuaiSDK, doctype: str, only_has_prompt: bool = True, show
|
|
|
137
138
|
_fields = []
|
|
138
139
|
links = []
|
|
139
140
|
child_docs = []
|
|
141
|
+
_doctype_search_fields = []
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
### 获取所有doctype的search_fields
|
|
145
|
+
for _search_field in m.get("search_fields", []):
|
|
146
|
+
_doctype_search_fields.append(_search_field)
|
|
147
|
+
|
|
148
|
+
|
|
140
149
|
for _f in m["fields"]:
|
|
141
150
|
field_name = _f["fieldname"]
|
|
142
151
|
field_type = _f["fieldtype"]
|
|
@@ -153,7 +162,23 @@ def _get_meta(client: FiuaiSDK, doctype: str, only_has_prompt: bool = True, show
|
|
|
153
162
|
link_filters = _f.get("link_filters", None)
|
|
154
163
|
precision = get_int_value("precision", _f)
|
|
155
164
|
length = get_int_value("length", _f)
|
|
165
|
+
fetch_from = _f.get("fetch_from", None)
|
|
166
|
+
filed_search_fields = _f.get("search_fields", [])
|
|
167
|
+
|
|
168
|
+
if filed_search_fields:
|
|
169
|
+
### 可能是 list,或者 string, 转为 list
|
|
170
|
+
if isinstance(filed_search_fields, str):
|
|
171
|
+
filed_search_fields = [filed_search_fields]
|
|
172
|
+
filed_search_fields = list(set(filed_search_fields))
|
|
156
173
|
|
|
174
|
+
if fetch_from:
|
|
175
|
+
### doctype.field 格式
|
|
176
|
+
if isinstance(fetch_from, str):
|
|
177
|
+
fetch_from = FieldFetchFrom(doctype=fetch_from.split(".")[0], field=fetch_from.split(".")[1])
|
|
178
|
+
else:
|
|
179
|
+
fetch_from = FieldFetchFrom(doctype=fetch_from["doctype"], field=fetch_from["field"])
|
|
180
|
+
else:
|
|
181
|
+
fetch_from = None
|
|
157
182
|
|
|
158
183
|
### 格式转化
|
|
159
184
|
|
|
@@ -209,6 +234,8 @@ def _get_meta(client: FiuaiSDK, doctype: str, only_has_prompt: bool = True, show
|
|
|
209
234
|
precision=precision,
|
|
210
235
|
length=length,
|
|
211
236
|
# ai_recognition_value=AiRecognitionValue(value=None, confidence=0, ai_comment="")
|
|
237
|
+
fetch_from=fetch_from,
|
|
238
|
+
filed_search_fields=filed_search_fields,
|
|
212
239
|
))
|
|
213
240
|
|
|
214
241
|
# links, child 去重
|
|
@@ -220,7 +247,8 @@ def _get_meta(client: FiuaiSDK, doctype: str, only_has_prompt: bool = True, show
|
|
|
220
247
|
doctype_prompts=m.get("doctype_prompts", ""),
|
|
221
248
|
fields=_fields,
|
|
222
249
|
link_docs=links,
|
|
223
|
-
child_docs=child_docs
|
|
250
|
+
child_docs=child_docs,
|
|
251
|
+
doctype_search_fields=_doctype_search_fields
|
|
224
252
|
)
|
|
225
253
|
return doc_meta
|
|
226
254
|
except Exception as e:
|
|
@@ -155,6 +155,10 @@ class CompanyProfile(BaseModel):
|
|
|
155
155
|
|
|
156
156
|
|
|
157
157
|
##### other type #####
|
|
158
|
+
class FieldFetchFrom(BaseModel):
|
|
159
|
+
source_field: str = Field(description="引用本doctype某个字段link的doctype数据")
|
|
160
|
+
linked_field: str = Field(description="source_field去link的doctype数据中的某一个字段名称")
|
|
161
|
+
|
|
158
162
|
|
|
159
163
|
class DocField(BaseModel):
|
|
160
164
|
"""
|
|
@@ -177,6 +181,9 @@ class DocField(BaseModel):
|
|
|
177
181
|
in_mobile_view: bool = Field(description="字段是否在移动端视图中显示", default=False)
|
|
178
182
|
# ai_recognition_value: AiRecognitionValue = Field(description="字段对应的AI识别结果", default=None)
|
|
179
183
|
|
|
184
|
+
fetch_from: Optional[FieldFetchFrom] = Field(description="字段获取来源", default=None)
|
|
185
|
+
filed_search_fields: List[str] = Field(description="暂时未用", default=[])
|
|
186
|
+
|
|
180
187
|
|
|
181
188
|
|
|
182
189
|
class DocTypeMeta(BaseModel):
|
|
@@ -188,6 +195,7 @@ class DocTypeMeta(BaseModel):
|
|
|
188
195
|
fields: List[DocField] = Field(description="文档类型所有的字段配置", default_factory=list)
|
|
189
196
|
link_docs: List[str] = Field(description="文档类型包含的所有Link文档类型", default_factory=list)
|
|
190
197
|
child_docs: List[str] = Field(description="文档类型包含的所有Child文档类型", default_factory=list)
|
|
198
|
+
doctype_search_fields: List[str] = Field(description="文档类型包含的所有搜索字段,使用link类型的field模糊搜索的时候的关键字", default=[])
|
|
191
199
|
|
|
192
200
|
|
|
193
201
|
def __init__(self, **kwargs):
|
|
@@ -656,7 +664,7 @@ class DocTypeMeta(BaseModel):
|
|
|
656
664
|
child_doctype = field.options[0]
|
|
657
665
|
try:
|
|
658
666
|
# 动态导入避免循环依赖
|
|
659
|
-
from
|
|
667
|
+
from .setup import load_doctype_meta
|
|
660
668
|
child_meta = load_doctype_meta(child_doctype)
|
|
661
669
|
if child_meta:
|
|
662
670
|
# 递归创建子表的JSON Schema
|
|
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
|
|
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
|
{fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/pkg/cache/__init__.py
RENAMED
|
File without changes
|
{fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/pkg/cache/cache_client.py
RENAMED
|
File without changes
|
{fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/pkg/cache/circuit_breaker.py
RENAMED
|
File without changes
|
{fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/pkg/cache/decorator.py
RENAMED
|
File without changes
|
{fiuai_sdk_python-0.8.3 → fiuai_sdk_python-0.8.4}/src/fiuai_sdk_python/pkg/cache/redis_manager.py
RENAMED
|
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
|