pycoze 0.1.456__py3-none-any.whl → 0.1.458__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.
- pycoze/bot/chat_base.py +3 -2
- pycoze/bot/lib.py +64 -27
- {pycoze-0.1.456.dist-info → pycoze-0.1.458.dist-info}/METADATA +1 -1
- {pycoze-0.1.456.dist-info → pycoze-0.1.458.dist-info}/RECORD +7 -7
- {pycoze-0.1.456.dist-info → pycoze-0.1.458.dist-info}/LICENSE +0 -0
- {pycoze-0.1.456.dist-info → pycoze-0.1.458.dist-info}/WHEEL +0 -0
- {pycoze-0.1.456.dist-info → pycoze-0.1.458.dist-info}/top_level.txt +0 -0
pycoze/bot/chat_base.py
CHANGED
@@ -107,7 +107,7 @@ class BufferProcessor:
|
|
107
107
|
"""
|
108
108
|
if not self.in_json_block:
|
109
109
|
# 查找 JSON 代码块的起始标记
|
110
|
-
json_start_match = re.search(r"```json", self.buffer, re.IGNORECASE)
|
110
|
+
json_start_match = re.search(r"```json\n", self.buffer, re.IGNORECASE)
|
111
111
|
if json_start_match:
|
112
112
|
# 提取 JSON 代码块之前的文本
|
113
113
|
self.text_content += self.buffer[:json_start_match.start()]
|
@@ -126,7 +126,7 @@ class BufferProcessor:
|
|
126
126
|
self.buffer = ""
|
127
127
|
else:
|
128
128
|
# 查找 JSON 代码块的结束标记
|
129
|
-
json_end_match = re.search(r"
|
129
|
+
json_end_match = re.search(r"```\n", self.buffer)
|
130
130
|
if json_end_match:
|
131
131
|
# 提取 JSON 代码块内容
|
132
132
|
self.json_block_content += self.buffer[:json_end_match.start()]
|
@@ -196,6 +196,7 @@ async def stream_openai_response(conversation_history, start_new_stream):
|
|
196
196
|
|
197
197
|
if buffer_processor.can_process():
|
198
198
|
result = buffer_processor.process_buffer()
|
199
|
+
print("result", result)
|
199
200
|
if result:
|
200
201
|
yield result
|
201
202
|
|
pycoze/bot/lib.py
CHANGED
@@ -127,33 +127,70 @@ def read_local_file(file_path: str) -> str:
|
|
127
127
|
|
128
128
|
# 全局忽略列表
|
129
129
|
IGNORE_LIST = [
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
130
|
+
'node_modules',
|
131
|
+
'.git',
|
132
|
+
'.vscode',
|
133
|
+
'.idea',
|
134
|
+
'gitServer',
|
135
|
+
'.DS_Store',
|
136
|
+
'$RECYCLE.BIN',
|
137
|
+
'.Trash-1000',
|
138
|
+
'.Spotlight-V100',
|
139
|
+
'.Trashes',
|
140
|
+
'.TemporaryItems',
|
141
|
+
'.fseventsd',
|
142
|
+
'System Volume Information',
|
143
|
+
'pycache',
|
144
|
+
'env',
|
145
|
+
'venv',
|
146
|
+
'target/dependency',
|
147
|
+
'build/dependencies',
|
148
|
+
'dist',
|
149
|
+
'out',
|
150
|
+
'bundle',
|
151
|
+
'vendor',
|
152
|
+
'tmp',
|
153
|
+
'temp',
|
154
|
+
'deps',
|
155
|
+
'pkg',
|
156
|
+
'Pods',
|
157
|
+
'build',
|
158
|
+
'.egg-info',
|
159
|
+
'.venv',
|
160
|
+
'__pycache__',
|
161
|
+
'.vs',
|
162
|
+
'.next',
|
163
|
+
'.nuxt',
|
164
|
+
'.cache',
|
165
|
+
'.sass-cache',
|
166
|
+
'.gradle',
|
167
|
+
'.ipynb_checkpoints',
|
168
|
+
'.pytest_cache',
|
169
|
+
'.mypy_cache',
|
170
|
+
'.tox',
|
171
|
+
'.hg',
|
172
|
+
'.svn',
|
173
|
+
'.bzr',
|
174
|
+
'.lock-wscript',
|
175
|
+
'.wafpickle-[0-9]*',
|
176
|
+
'.lock-waf_[0-9]*',
|
177
|
+
'.Python',
|
178
|
+
'.jupyter',
|
179
|
+
'.vscode-test',
|
180
|
+
'.history',
|
181
|
+
'.yarn',
|
182
|
+
'.yarn-cache',
|
183
|
+
'.eslintcache',
|
184
|
+
'.parcel-cache',
|
185
|
+
'.cache-loader',
|
186
|
+
'.nyc_output',
|
187
|
+
'.node_repl_history',
|
188
|
+
'.pnp.js',
|
189
|
+
'.pnp',
|
190
|
+
'.obsidian',
|
191
|
+
".husky",
|
192
|
+
'.github',
|
193
|
+
".changeset"
|
157
194
|
]
|
158
195
|
|
159
196
|
|
@@ -11,8 +11,8 @@ pycoze/api/lib/web.py,sha256=4HaOV_zYHq6-SSQQIc_O7REnC1asIlXIELxee-pU6zc,2421
|
|
11
11
|
pycoze/api/lib/window.py,sha256=ZZacqnX0fvZUnLUhNVjbbjhBcKkYdi_6E0LswLp1MqM,2071
|
12
12
|
pycoze/bot/__init__.py,sha256=rL3Q-ycczRpSFfKn84fg3QBl5k22WpyeIU5qOEjEby8,79
|
13
13
|
pycoze/bot/chat.py,sha256=bScsMc0hGh2NlvhQxzWEbnA_WXU9JdAJv-rx27SpEB8,6554
|
14
|
-
pycoze/bot/chat_base.py,sha256=
|
15
|
-
pycoze/bot/lib.py,sha256=
|
14
|
+
pycoze/bot/chat_base.py,sha256=drF1VBBngaCWavpp42rrolYjUw-e4ToHxGf7ceestWg,12645
|
15
|
+
pycoze/bot/lib.py,sha256=WU4h3B7SG7vh9p9BxhtPlaJ7TkU9VsL3HyCn9hKhWOo,7753
|
16
16
|
pycoze/bot/message.py,sha256=udnIi-h4QgGzkbr_5VcAsVGjoLp9wXJSfBCeuOz7_Bk,802
|
17
17
|
pycoze/bot/prompt.md,sha256=UtwZ31wFvNtvM9ZTA4BU2yT1Rb-qnUdU3Ny1O37Tt3Q,14077
|
18
18
|
pycoze/bot/tools.py,sha256=BWMdwvqLzvcyaW38lzxUWtc0K1V-C_qPSEZ3OKlAQvU,11108
|
@@ -33,8 +33,8 @@ pycoze/utils/env.py,sha256=5pWlXfM1F5ZU9hhv1rHlDEanjEW5wf0nbyez9bNRqqA,559
|
|
33
33
|
pycoze/utils/process.py,sha256=U2MURGmxfyWBqdbKfy5UvyV17M40B6HHlNELgWfgrTE,3824
|
34
34
|
pycoze/utils/socket.py,sha256=4Wm4LlwdWXC_kAV0NnZbUc0Y3Kc6KRMyFRqSw79u-9w,2468
|
35
35
|
pycoze/utils/text_or_file.py,sha256=gpxZVWt2DW6YiEg_MnMuwg36VNf3TX383QD_1oZNB0Y,551
|
36
|
-
pycoze-0.1.
|
37
|
-
pycoze-0.1.
|
38
|
-
pycoze-0.1.
|
39
|
-
pycoze-0.1.
|
40
|
-
pycoze-0.1.
|
36
|
+
pycoze-0.1.458.dist-info/LICENSE,sha256=QStd_Qsd0-kAam_-sOesCIp_uKrGWeoKwt9M49NVkNU,1090
|
37
|
+
pycoze-0.1.458.dist-info/METADATA,sha256=Ac4uU3jGJkYgeQBo9oig9E9U4GgFpKMZFDfD3Verd2I,854
|
38
|
+
pycoze-0.1.458.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
39
|
+
pycoze-0.1.458.dist-info/top_level.txt,sha256=76dPeDhKvOCleL3ZC5gl1-y4vdS1tT_U1hxWVAn7sFo,7
|
40
|
+
pycoze-0.1.458.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|