coze-coding-utils 0.1.9__py3-none-any.whl → 0.1.10__py3-none-any.whl
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.
- coze_coding_utils/__init__.py +1 -1
- coze_coding_utils/runtime_ctx/context.py +16 -16
- {coze_coding_utils-0.1.9.dist-info → coze_coding_utils-0.1.10.dist-info}/METADATA +1 -1
- coze_coding_utils-0.1.10.dist-info/RECORD +7 -0
- coze_coding_utils-0.1.9.dist-info/RECORD +0 -7
- {coze_coding_utils-0.1.9.dist-info → coze_coding_utils-0.1.10.dist-info}/WHEEL +0 -0
- {coze_coding_utils-0.1.9.dist-info → coze_coding_utils-0.1.10.dist-info}/licenses/LICENSE +0 -0
coze_coding_utils/__init__.py
CHANGED
|
@@ -8,11 +8,11 @@ HEADER_X_TT_LOGID = "x-tt-logid"
|
|
|
8
8
|
HEADER_X_TT_ENV = "x-tt-env"
|
|
9
9
|
HEADER_X_USE_PPE = "x-use-ppe"
|
|
10
10
|
HEADER_X_TT_ENV_FE = "x-tt-env-fe"
|
|
11
|
-
|
|
11
|
+
HEADER_RPC_PERSIST_RES_REC_BIZ_SCENE = "rpc-persist-res-rec-biz-scene"
|
|
12
12
|
HEADER_RPC_PERSIST_COZE_RECORD_ROOT_ID = "rpc-persist-coze-record-root-id" # root_id,串联一次完整请求,通常标识一次完整对话
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
HEADER_RPC_PERSIST_RES_REC_ROOT_ENTITY_TYPE = "rpc-persist-res-rec-root-entity-type" # 对应最顶层实体类型,用于标识资源消耗的来源归属实体
|
|
14
|
+
HEADER_RPC_PERSIST_RES_REC_ROOT_ENTITY_ID = "rpc-persist-res-rec-root-entity-id" #对应最顶层实体ID
|
|
15
|
+
HEADER_RPC_PERSIST_RES_REC_EXT_INFO = "rpc-persist-res-rec-ext-info" # 扩展信息,json字符串格式
|
|
16
16
|
|
|
17
17
|
# Environment variable keys
|
|
18
18
|
ENV_SPACE_ID = "COZE_PROJECT_SPACE_ID"
|
|
@@ -32,11 +32,11 @@ class Context:
|
|
|
32
32
|
x_use_ppe: Optional[str] = None
|
|
33
33
|
x_tt_env_fe: Optional[str] = None
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
rpc_persist_res_rec_biz_scene: Optional[str] = None
|
|
36
36
|
rpc_persist_coze_record_root_id: Optional[str] = None
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
rpc_persist_res_rec_root_entity_type: Optional[str] = None
|
|
38
|
+
rpc_persist_res_rec_root_entity_id: Optional[str] = None
|
|
39
|
+
rpc_persist_res_rec_ext_info: Optional[str] = None
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
def new_context(method: str, headers: Optional[Mapping[str, str]] = None) -> Context:
|
|
@@ -54,11 +54,11 @@ def new_context(method: str, headers: Optional[Mapping[str, str]] = None) -> Con
|
|
|
54
54
|
HEADER_X_TT_ENV: "x_tt_env",
|
|
55
55
|
HEADER_X_USE_PPE: "x_use_ppe",
|
|
56
56
|
HEADER_X_TT_ENV_FE: "x_tt_env_fe",
|
|
57
|
-
|
|
57
|
+
HEADER_RPC_PERSIST_RES_REC_BIZ_SCENE: "rpc_persist_res_rec_biz_scene",
|
|
58
58
|
HEADER_RPC_PERSIST_COZE_RECORD_ROOT_ID: "rpc_persist_coze_record_root_id",
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
HEADER_RPC_PERSIST_RES_REC_ROOT_ENTITY_TYPE: "rpc_persist_res_rec_root_entity_type",
|
|
60
|
+
HEADER_RPC_PERSIST_RES_REC_ROOT_ENTITY_ID: "rpc_persist_res_rec_root_entity_id",
|
|
61
|
+
HEADER_RPC_PERSIST_RES_REC_EXT_INFO: "rpc_persist_res_rec_ext_info",
|
|
62
62
|
}
|
|
63
63
|
for hk, attr in HEADERS_TO_ATTR.items():
|
|
64
64
|
val = norm.get(hk)
|
|
@@ -77,11 +77,11 @@ def default_headers(ctx: Context | None) -> Dict[str, str]:
|
|
|
77
77
|
"x_tt_env": HEADER_X_TT_ENV,
|
|
78
78
|
"x_use_ppe": HEADER_X_USE_PPE,
|
|
79
79
|
"x_tt_env_fe": HEADER_X_TT_ENV_FE,
|
|
80
|
-
"
|
|
80
|
+
"rpc_persist_res_rec_biz_scene": HEADER_RPC_PERSIST_RES_REC_BIZ_SCENE,
|
|
81
81
|
"rpc_persist_coze_record_root_id": HEADER_RPC_PERSIST_COZE_RECORD_ROOT_ID,
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
82
|
+
"rpc_persist_res_rec_root_entity_type": HEADER_RPC_PERSIST_RES_REC_ROOT_ENTITY_TYPE,
|
|
83
|
+
"rpc_persist_res_rec_root_entity_id": HEADER_RPC_PERSIST_RES_REC_ROOT_ENTITY_ID,
|
|
84
|
+
"rpc_persist_res_rec_ext_info": HEADER_RPC_PERSIST_RES_REC_EXT_INFO,
|
|
85
85
|
}
|
|
86
86
|
for attr, hk in ATTR_TO_HEADER.items():
|
|
87
87
|
v = getattr(ctx, attr)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
coze_coding_utils/__init__.py,sha256=8TraCREZaR7z_RrQnGMwqZlJvLbzA-0ksCJ30gz67rQ,37
|
|
2
|
+
coze_coding_utils/runtime_ctx/__init__.py,sha256=4W8VliAYUP1KY2gLJ_YDy2TmcXYVm-PY7XikQD_bFwA,2
|
|
3
|
+
coze_coding_utils/runtime_ctx/context.py,sha256=_gS3WXsvHc4zZnyuBjrFRcrugwLtyNvr2NKVYQD-LFs,3798
|
|
4
|
+
coze_coding_utils-0.1.10.dist-info/METADATA,sha256=hekKWqeOLZcPNqeoMUwB_xExW7aeGVhAFYW7PpjlBr4,979
|
|
5
|
+
coze_coding_utils-0.1.10.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
6
|
+
coze_coding_utils-0.1.10.dist-info/licenses/LICENSE,sha256=lzckZhAjHlpSJcWvppoST095IHFpBwKiB2pKcBv7vP4,1078
|
|
7
|
+
coze_coding_utils-0.1.10.dist-info/RECORD,,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
coze_coding_utils/__init__.py,sha256=FYTbHkV0j_x7xQRTwq3d1z_ClXESgWwiqhur3B7xYMo,36
|
|
2
|
-
coze_coding_utils/runtime_ctx/__init__.py,sha256=4W8VliAYUP1KY2gLJ_YDy2TmcXYVm-PY7XikQD_bFwA,2
|
|
3
|
-
coze_coding_utils/runtime_ctx/context.py,sha256=mRMnzcI-Yt8IYgJhOLgu0sfjKpLzOzZPVdmVEoD3K-o,3750
|
|
4
|
-
coze_coding_utils-0.1.9.dist-info/METADATA,sha256=iXIhpxwfZqo9CdrFbdwf7dQ3vq-kO85XqrHx7Hm9mMI,978
|
|
5
|
-
coze_coding_utils-0.1.9.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
6
|
-
coze_coding_utils-0.1.9.dist-info/licenses/LICENSE,sha256=lzckZhAjHlpSJcWvppoST095IHFpBwKiB2pKcBv7vP4,1078
|
|
7
|
-
coze_coding_utils-0.1.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|