beswarm 0.1.63__py3-none-any.whl → 0.1.64__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.
@@ -54,8 +54,6 @@ async def fetch_gemini_response_stream(client, url, headers, payload, model):
54
54
  if line and '\"finishReason\": \"' in line:
55
55
  if "stop" not in line.lower():
56
56
  logger.error(f"finishReason: {line}")
57
- sse_string = await generate_sse_response(timestamp, model, stop="stop")
58
- yield sse_string
59
57
  is_finish = True
60
58
  if is_finish and '\"promptTokenCount\": ' in line:
61
59
  json_data = parse_json_safely( "{" + line + "}")
@@ -117,6 +115,9 @@ async def fetch_gemini_response_stream(client, url, headers, payload, model):
117
115
  sse_string = await generate_sse_response(timestamp, model, content=None, tools_id="chatcmpl-9inWv0yEtgn873CxMBzHeCeiHctTV", function_call_name=None, function_call_content=function_full_response)
118
116
  yield sse_string
119
117
 
118
+ sse_string = await generate_sse_response(timestamp, model, stop="stop")
119
+ yield sse_string
120
+
120
121
  sse_string = await generate_sse_response(timestamp, model, None, None, None, None, None, totalTokenCount, promptTokenCount, candidatesTokenCount)
121
122
  yield sse_string
122
123
 
beswarm/tools/worker.py CHANGED
@@ -99,8 +99,10 @@ async def worker(goal, tools, work_dir, cache_messages=None):
99
99
  extracted_content = f"<latest_file_content>{match.group(1)}</latest_file_content>\n\n"
100
100
  else:
101
101
  extracted_content = ""
102
-
103
- conversation_history[0]["content"] = extracted_content + conversation_history[0]["content"]
102
+ if isinstance(conversation_history[0]["content"], str):
103
+ conversation_history[0]["content"] = extracted_content + conversation_history[0]["content"]
104
+ elif isinstance(conversation_history[0]["content"], list) and extracted_content:
105
+ conversation_history[0]["content"].append({"type": "text", "text": extracted_content})
104
106
 
105
107
  instruction_agent.conversation["default"][1:] = conversation_history
106
108
  if "find_and_click_element" in str(tools_json):
@@ -221,7 +223,10 @@ async def worker_gen(goal, tools, work_dir, cache_messages=None):
221
223
  else:
222
224
  extracted_content = ""
223
225
 
224
- conversation_history[0]["content"] = extracted_content + conversation_history[0]["content"]
226
+ if isinstance(conversation_history[0]["content"], str):
227
+ conversation_history[0]["content"] = extracted_content + conversation_history[0]["content"]
228
+ elif isinstance(conversation_history[0]["content"], list) and extracted_content:
229
+ conversation_history[0]["content"].append({"type": "text", "text": extracted_content})
225
230
 
226
231
  instruction_agent.conversation["default"][1:] = conversation_history
227
232
  if "find_and_click_element" in str(tools_json):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beswarm
3
- Version: 0.1.63
3
+ Version: 0.1.64
4
4
  Summary: MAS
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -7,7 +7,7 @@ beswarm/aient/src/aient/core/__init__.py,sha256=NxjebTlku35S4Dzr16rdSqSTWUvvwEeA
7
7
  beswarm/aient/src/aient/core/log_config.py,sha256=kz2_yJv1p-o3lUQOwA3qh-LSc3wMHv13iCQclw44W9c,274
8
8
  beswarm/aient/src/aient/core/models.py,sha256=kF-HLi1I2k_G5r153ZHuiGH8_NmpTlFMfK0_myB28YQ,7366
9
9
  beswarm/aient/src/aient/core/request.py,sha256=nvF_V71svezQ0-UbnC9RB_pXo_wV6QC7WE_SANwQzxE,66195
10
- beswarm/aient/src/aient/core/response.py,sha256=3OASBI-Y_8VlAusY-ch3oPwBHhn1rMDhhMyDBsK1FcY,33224
10
+ beswarm/aient/src/aient/core/response.py,sha256=YphzhA9jtQKzWb3L4XGTp9xJZ2FOzHr1aAMTsi896FQ,33201
11
11
  beswarm/aient/src/aient/core/utils.py,sha256=VQ9uutGRR_JOvECOrjeoRBO2aA6w-pGwoXnnS2UvfPU,27263
12
12
  beswarm/aient/src/aient/core/test/test_base_api.py,sha256=pWnycRJbuPSXKKU9AQjWrMAX1wiLC_014Qc9hh5C2Pw,524
13
13
  beswarm/aient/src/aient/core/test/test_geminimask.py,sha256=HFX8jDbNg_FjjgPNxfYaR-0-roUrOO-ND-FVsuxSoiw,13254
@@ -127,8 +127,8 @@ beswarm/tools/repomap.py,sha256=N09K0UgwjCN7Zjg_5TYlVsulp3n2fztYlS8twalChU8,4500
127
127
  beswarm/tools/search_arxiv.py,sha256=9slwBemXjEqrd7-YgVmyMijPXlkhZCybEDRVhWVQ9B0,7937
128
128
  beswarm/tools/search_web.py,sha256=B24amOnGHnmdV_6S8bw8O2PdhZRRIDtJjg-wXcfP7dQ,11859
129
129
  beswarm/tools/think.py,sha256=WLw-7jNIsnS6n8MMSYUin_f-BGLENFmnKM2LISEp0co,1760
130
- beswarm/tools/worker.py,sha256=z1DmJ1TxU43tJe3K58JeBM3vNEFSuUbunRFBYoROk4w,12120
131
- beswarm-0.1.63.dist-info/METADATA,sha256=4-0ctzL9yxdo2QbQvHKF6o0NQN2TOvSzYX_fnMQ3s1M,3553
132
- beswarm-0.1.63.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
133
- beswarm-0.1.63.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
134
- beswarm-0.1.63.dist-info/RECORD,,
130
+ beswarm/tools/worker.py,sha256=bZwMGUS4wt4yOleb2kKu0rCLHIJgPcokbCmh9bGMzXA,12679
131
+ beswarm-0.1.64.dist-info/METADATA,sha256=KnWiUh0orLTMVypQqxxo-enfguZLdIWhVvJWCRj0tfE,3553
132
+ beswarm-0.1.64.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
133
+ beswarm-0.1.64.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
134
+ beswarm-0.1.64.dist-info/RECORD,,