Guest User

Untitled

a guest
Apr 29th, 2026
31
0
Never
3
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.10 KB | None | 0 0
  1. {%- macro format_parameters(properties, required, filter_keys=false) -%}
  2. {%- set standard_keys = ['description', 'type', 'properties', 'required', 'nullable'] -%}
  3. {%- set ns = namespace(found_first=false) -%}
  4. {%- for key, value in properties | dictsort -%}
  5. {%- set add_comma = false -%}
  6. {%- if not filter_keys or key not in standard_keys -%}
  7. {%- if ns.found_first %},{% endif -%}
  8. {%- set ns.found_first = true -%}
  9. {{ key }}:{
  10. {%- if value['description'] -%}
  11. description:<|"|>{{ value['description'] }}<|"|>
  12. {%- set add_comma = true -%}
  13. {%- endif -%}
  14. {%- set type_names = namespace(names=[]) -%}
  15. {%- if value['type'] is defined and value['type'] -%}
  16. {%- if value['type'] is string -%}
  17. {%- set type_names.names = [value['type'] | upper] -%}
  18. {%- else -%}
  19. {%- set type_names.names = value['type'] | map('upper') | list -%}
  20. {%- endif -%}
  21. {%- endif -%}
  22. {%- if value['anyOf'] is defined and value['anyOf'] -%}
  23. {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
  24. anyOf:{{ format_argument(value['anyOf'], escape_keys=false) }}
  25. {%- endif -%}
  26. {%- if value['oneOf'] is defined and value['oneOf'] -%}
  27. {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
  28. oneOf:{{ format_argument(value['oneOf'], escape_keys=false) }}
  29. {%- endif -%}
  30. {%- if value['allOf'] is defined and value['allOf'] -%}
  31. {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
  32. allOf:{{ format_argument(value['allOf'], escape_keys=false) }}
  33. {%- endif -%}
  34. {%- if value['$ref'] is defined and value['$ref'] -%}
  35. {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
  36. $ref:<|"|>{{ value['$ref'] }}<|"|>
  37. {%- endif -%}
  38. {%- if value['enum'] is defined and value['enum'] -%}
  39. {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
  40. enum:{{ format_argument(value['enum']) }}
  41. {%- endif -%}
  42. {%- if value['const'] is defined -%}
  43. {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
  44. const:{{ format_argument(value['const'], escape_keys=false) }}
  45. {%- endif -%}
  46. {%- if 'ARRAY' in type_names.names -%}
  47. {%- if value['items'] is mapping and value['items'] -%}
  48. {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
  49. items:{
  50. {%- set ns_items = namespace(found_first=false) -%}
  51. {%- for item_key, item_value in value['items'] | dictsort -%}
  52. {%- if item_value is not none -%}
  53. {%- if ns_items.found_first %},{% endif -%}
  54. {%- set ns_items.found_first = true -%}
  55. {%- if item_key == 'properties' -%}
  56. properties:{
  57. {%- if item_value is mapping -%}
  58. {{- format_parameters(item_value, value['items']['required'] | default([])) -}}
  59. {%- endif -%}
  60. }
  61. {%- elif item_key == 'required' -%}
  62. required:[
  63. {%- for req_item in item_value -%}
  64. <|"|>{{- req_item -}}<|"|>
  65. {%- if not loop.last %},{% endif -%}
  66. {%- endfor -%}
  67. ]
  68. {%- elif item_key == 'type' -%}
  69. {%- if item_value is string -%}
  70. type:{{ format_argument(item_value | upper) }}
  71. {%- else -%}
  72. type:{{ format_argument(item_value | map('upper') | list) }}
  73. {%- endif -%}
  74. {%- else -%}
  75. {{ item_key }}:{{ format_argument(item_value) }}
  76. {%- endif -%}
  77. {%- endif -%}
  78. {%- endfor -%}
  79. }
  80. {%- endif -%}
  81. {%- endif -%}
  82. {%- if value['nullable'] is defined and value['nullable'] %}
  83. {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
  84. nullable:true
  85. {%- endif -%}
  86. {%- if 'OBJECT' in type_names.names -%}
  87. {%- if value['properties'] is defined and value['properties'] is mapping -%}
  88. {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
  89. properties:{
  90. {{- format_parameters(value['properties'], value['required'] | default([])) -}}
  91. }
  92. {%- elif value is mapping -%}
  93. {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
  94. properties:{
  95. {{- format_parameters(value, value['required'] | default([]), filter_keys=true) -}}
  96. }
  97. {%- endif -%}
  98. {%- if value['required'] is defined and value['required'] -%}
  99. {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
  100. required:[
  101. {%- for item in value['required'] | default([]) -%}
  102. <|"|>{{- item -}}<|"|>
  103. {%- if not loop.last %},{% endif -%}
  104. {%- endfor -%}
  105. ]
  106. {%- endif -%}
  107. {%- endif -%}
  108. {%- if value['type'] is defined and value['type'] -%}
  109. {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
  110. {%- if value['type'] is string -%}
  111. type:<|"|>{{ value['type'] | upper }}<|"|>
  112. {%- else -%}
  113. type:{{ format_argument(value['type'] | map('upper') | list) }}
  114. {%- endif -%}
  115. {%- endif -%}
  116. }
  117. {%- endif -%}
  118. {%- endfor -%}
  119. {%- endmacro -%}
  120. {%- macro format_function_declaration(tool_data) -%}
  121. declaration:{{- tool_data['function']['name'] -}}{description:<|"|>{{- tool_data['function']['description'] -}}<|"|>
  122. {%- set params = tool_data['function']['parameters'] -%}
  123. {%- if params -%}
  124. ,parameters:{
  125. {%- if params['properties'] -%}
  126. properties:{ {{- format_parameters(params['properties'], params['required']) -}} },
  127. {%- endif -%}
  128. {%- if params['$defs'] is defined and params['$defs'] -%}
  129. $defs:{{ format_argument(params['$defs'], escape_keys=false) }},
  130. {%- endif -%}
  131. {%- if params['required'] -%}
  132. required:[
  133. {%- for item in params['required'] -%}
  134. <|"|>{{- item -}}<|"|>
  135. {{- ',' if not loop.last -}}
  136. {%- endfor -%}
  137. ],
  138. {%- endif -%}
  139. {%- if params['type'] -%}
  140. type:<|"|>{{- params['type'] | upper -}}<|"|>}
  141. {%- endif -%}
  142. {%- endif -%}
  143. {%- if 'response' in tool_data['function'] -%}
  144. {%- set response_declaration = tool_data['function']['response'] -%}
  145. ,response:{
  146. {%- if response_declaration['description'] -%}
  147. description:<|"|>{{- response_declaration['description'] -}}<|"|>,
  148. {%- endif -%}
  149. {%- if response_declaration['type'] | upper == 'OBJECT' -%}
  150. type:<|"|>{{- response_declaration['type'] | upper -}}<|"|>}
  151. {%- endif -%}
  152. {%- endif -%}
  153. }
  154. {%- endmacro -%}
  155. {%- macro format_argument(argument, escape_keys=True) -%}
  156. {%- if argument is string -%}
  157. {{- '<|"|>' + argument + '<|"|>' -}}
  158. {%- elif argument is boolean -%}
  159. {{- 'true' if argument else 'false' -}}
  160. {%- elif argument is none -%}
  161. {{- 'null' -}}
  162. {%- elif argument is mapping -%}
  163. {{- '{' -}}
  164. {%- set ns = namespace(found_first=false) -%}
  165. {%- for key, value in argument | dictsort -%}
  166. {%- if ns.found_first %},{% endif -%}
  167. {%- set ns.found_first = true -%}
  168. {%- if escape_keys -%}
  169. {{- '<|"|>' + key + '<|"|>' -}}
  170. {%- else -%}
  171. {{- key -}}
  172. {%- endif -%}
  173. :{{- format_argument(value, escape_keys=escape_keys) -}}
  174. {%- endfor -%}
  175. {{- '}' -}}
  176. {%- elif argument is sequence -%}
  177. {{- '[' -}}
  178. {%- for item in argument -%}
  179. {{- format_argument(item, escape_keys=escape_keys) -}}
  180. {%- if not loop.last %},{% endif -%}
  181. {%- endfor -%}
  182. {{- ']' -}}
  183. {%- else -%}
  184. {{- argument -}}
  185. {%- endif -%}
  186. {%- endmacro -%}
  187. {%- macro strip_thinking(text) -%}
  188. {%- set ns = namespace(result='') -%}
  189. {%- for part in text.split('<channel|>') -%}
  190. {%- if '<|channel>' in part -%}
  191. {%- set ns.result = ns.result + part.split('<|channel>')[0] -%}
  192. {%- else -%}
  193. {%- set ns.result = ns.result + part -%}
  194. {%- endif -%}
  195. {%- endfor -%}
  196. {{- ns.result | trim -}}
  197. {%- endmacro -%}
  198.  
  199. {%- macro format_tool_response_block(tool_name, response) -%}
  200. {{- '<|tool_response>' -}}
  201. {%- if response is mapping -%}
  202. {{- 'response:' + tool_name + '{' -}}
  203. {%- for key, value in response | dictsort -%}
  204. {{- key -}}:{{- format_argument(value, escape_keys=False) -}}
  205. {%- if not loop.last %},{% endif -%}
  206. {%- endfor -%}
  207. {{- '}' -}}
  208. {%- else -%}
  209. {{- 'response:' + tool_name + '{value:' + format_argument(response, escape_keys=False) + '}' -}}
  210. {%- endif -%}
  211. {{- '<tool_response|>' -}}
  212. {%- endmacro -%}
  213.  
  214. {%- set ns = namespace(prev_message_type=None) -%}
  215. {%- set loop_messages = messages -%}
  216. {{- bos_token -}}
  217. {#- Handle System/Tool Definitions Block -#}
  218. {%- if (enable_thinking is defined and enable_thinking) or tools or messages[0]['role'] in ['system', 'developer'] -%}
  219. {{- '<|turn>system\n' -}}
  220. {#- Inject Thinking token at the very top of the FIRST system turn -#}
  221. {%- if enable_thinking is defined and enable_thinking -%}
  222. {{- '<|think|>\n' -}}
  223. {%- set ns.prev_message_type = 'think' -%}
  224. {%- endif -%}
  225. {%- if messages[0]['role'] in ['system', 'developer'] -%}
  226. {%- if messages[0]['content'] is string -%}
  227. {{- messages[0]['content'] | trim -}}
  228. {%- elif messages[0]['content'] is sequence -%}
  229. {%- for item in messages[0]['content'] -%}
  230. {{- item['text'] | trim + ' '-}}
  231. {%- endfor -%}
  232. {%- endif -%}
  233. {%- set loop_messages = messages[1:] -%}
  234. {%- endif -%}
  235. {%- if tools -%}
  236. {%- for tool in tools %}
  237. {{- '<|tool>' -}}
  238. {{- format_function_declaration(tool) | trim -}}
  239. {{- '<tool|>' -}}
  240. {%- endfor %}
  241. {%- set ns.prev_message_type = 'tool' -%}
  242. {%- endif -%}
  243. {{- '<turn|>\n' -}}
  244. {%- endif %}
  245.  
  246. {#- Pre-scan: find last user message index for reasoning guard -#}
  247. {%- set ns_turn = namespace(last_user_idx=-1) -%}
  248. {%- for i in range(loop_messages | length) -%}
  249. {%- if loop_messages[i]['role'] == 'user' -%}
  250. {%- set ns_turn.last_user_idx = i -%}
  251. {%- endif -%}
  252. {%- endfor -%}
  253.  
  254. {#- Loop through messages -#}
  255. {%- for message in loop_messages -%}
  256. {%- if message['role'] != 'tool' -%}
  257. {%- set ns.prev_message_type = None -%}
  258. {%- set role = 'model' if message['role'] == 'assistant' else message['role'] -%}
  259. {#- Detect continuation: suppress duplicate <|turn>model when previous non-tool message was also assistant -#}
  260. {%- set prev_nt = namespace(role=None, found=false) -%}
  261. {%- if loop.index0 > 0 -%}
  262. {%- for j in range(loop.index0 - 1, -1, -1) -%}
  263. {%- if not prev_nt.found -%}
  264. {%- if loop_messages[j]['role'] != 'tool' -%}
  265. {%- set prev_nt.role = loop_messages[j]['role'] -%}
  266. {%- set prev_nt.found = true -%}
  267. {%- endif -%}
  268. {%- endif -%}
  269. {%- endfor -%}
  270. {%- endif -%}
  271. {%- set continue_same_model_turn = (role == 'model' and prev_nt.role == 'assistant') -%}
  272. {%- if not continue_same_model_turn -%}
  273. {{- '<|turn>' + role + '\n' }}
  274. {%- endif -%}
  275.  
  276. {#- Render reasoning/reasoning_content as thinking channel -#}
  277. {%- set thinking_text = message.get('reasoning') or message.get('reasoning_content') -%}
  278. {%- if thinking_text and loop.index0 > ns_turn.last_user_idx and message.get('tool_calls') -%}
  279. {{- '<|channel>thought\n' + thinking_text + '\n<channel|>' -}}
  280. {%- endif -%}
  281.  
  282. {%- if message['tool_calls'] -%}
  283. {%- for tool_call in message['tool_calls'] -%}
  284. {%- set function = tool_call['function'] -%}
  285. {{- '<|tool_call>call:' + function['name'] + '{' -}}
  286. {%- if function['arguments'] is mapping -%}
  287. {%- set ns_args = namespace(found_first=false) -%}
  288. {%- for key, value in function['arguments'] | dictsort -%}
  289. {%- if ns_args.found_first %},{% endif -%}
  290. {%- set ns_args.found_first = true -%}
  291. {{- key -}}:{{- format_argument(value, escape_keys=False) -}}
  292. {%- endfor -%}
  293. {%- elif function['arguments'] is string -%}
  294. {{- function['arguments'] -}}
  295. {%- endif -%}
  296. {{- '}<tool_call|>' -}}
  297. {%- endfor -%}
  298. {%- set ns.prev_message_type = 'tool_call' -%}
  299. {%- endif -%}
  300.  
  301. {%- set ns_tr_out = namespace(flag=false) -%}
  302. {%- if message.get('tool_responses') -%}
  303. {#- Legacy: tool_responses embedded on the assistant message (Google/Gemma native) -#}
  304. {%- for tool_response in message['tool_responses'] -%}
  305. {{- format_tool_response_block(tool_response['name'] | default('unknown'), tool_response['response']) -}}
  306. {%- set ns_tr_out.flag = true -%}
  307. {%- set ns.prev_message_type = 'tool_response' -%}
  308. {%- endfor -%}
  309. {%- elif message.get('tool_calls') -%}
  310. {#- OpenAI Chat Completions: forward-scan consecutive role:tool messages -#}
  311. {%- set ns_tool_scan = namespace(stopped=false) -%}
  312. {%- for k in range(loop.index0 + 1, loop_messages | length) -%}
  313. {%- if ns_tool_scan.stopped -%}
  314. {%- elif loop_messages[k]['role'] != 'tool' -%}
  315. {%- set ns_tool_scan.stopped = true -%}
  316. {%- else -%}
  317. {%- set follow = loop_messages[k] -%}
  318. {#- Resolve tool_call_id to function name -#}
  319. {%- set ns_tname = namespace(name=follow.get('name') | default('unknown')) -%}
  320. {%- for tc in message['tool_calls'] -%}
  321. {%- if tc.get('id') == follow.get('tool_call_id') -%}
  322. {%- set ns_tname.name = tc['function']['name'] -%}
  323. {%- endif -%}
  324. {%- endfor -%}
  325. {#- Handle content as string or content-parts array -#}
  326. {%- set tool_body = follow.get('content') -%}
  327. {%- if tool_body is string -%}
  328. {{- format_tool_response_block(ns_tname.name, tool_body) -}}
  329. {%- elif tool_body is sequence and tool_body is not string -%}
  330. {%- set ns_txt = namespace(s='') -%}
  331. {%- for part in tool_body -%}
  332. {%- if part.get('type') == 'text' -%}
  333. {%- set ns_txt.s = ns_txt.s + (part.get('text') | default('')) -%}
  334. {%- endif -%}
  335. {%- endfor -%}
  336. {{- format_tool_response_block(ns_tname.name, ns_txt.s) -}}
  337. {%- else -%}
  338. {{- format_tool_response_block(ns_tname.name, tool_body) -}}
  339. {%- endif -%}
  340. {%- set ns_tr_out.flag = true -%}
  341. {%- set ns.prev_message_type = 'tool_response' -%}
  342. {%- endif -%}
  343. {%- endfor -%}
  344. {%- endif -%}
  345.  
  346. {%- set captured_content -%}
  347. {%- if message['content'] is string -%}
  348. {%- if role == 'model' -%}
  349. {{- strip_thinking(message['content']) -}}
  350. {%- else -%}
  351. {{- message['content'] | trim -}}
  352. {%- endif -%}
  353. {%- elif message['content'] is sequence -%}
  354. {%- for item in message['content'] -%}
  355. {%- if item['type'] == 'text' -%}
  356. {%- if role == 'model' -%}
  357. {{- strip_thinking(item['text']) -}}
  358. {%- else -%}
  359. {{- item['text'] | trim -}}
  360. {%- endif -%}
  361. {%- elif item['type'] == 'image' -%}
  362. {{- '<|image|>' -}}
  363. {%- set ns.prev_message_type = 'image' -%}
  364. {%- elif item['type'] == 'audio' -%}
  365. {{- '<|audio|>' -}}
  366. {%- set ns.prev_message_type = 'audio' -%}
  367. {%- elif item['type'] == 'video' -%}
  368. {{- '<|video|>' -}}
  369. {%- set ns.prev_message_type = 'video' -%}
  370. {%- endif -%}
  371. {%- endfor -%}
  372. {%- endif -%}
  373. {%- endset -%}
  374.  
  375. {{- captured_content -}}
  376. {%- set has_content = captured_content | trim | length > 0 -%}
  377.  
  378. {%- if ns.prev_message_type == 'tool_call' and not ns_tr_out.flag -%}
  379. {{- '<|tool_response>' -}}
  380. {%- elif not (ns_tr_out.flag and not has_content) -%}
  381. {{- '<turn|>\n' -}}
  382. {%- endif -%}
  383. {%- endif -%}
  384. {%- endfor -%}
  385.  
  386. {%- if add_generation_prompt -%}
  387. {%- if ns.prev_message_type != 'tool_response' and ns.prev_message_type != 'tool_call' -%}
  388. {{- '<|turn>model\n' -}}
  389. {%- if not enable_thinking | default(false) -%}
  390. {{- '<|channel>thought\n<channel|>' -}}
  391. {%- endif -%}
  392. {%- endif -%}
  393. {%- endif -%}
  394.  
Advertisement
Comments
  • Xornolix
    31 days
    # CSS 0.84 KB | 0 0
    1. ✅ Leaked Exploit Documentation:
    2.  
    3. https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
    4.  
    5. This made me $13,000 in 2 days.
    6.  
    7. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    8. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    9.  
    10. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
  • Mektoutov
    26 days
    # CSS 0.06 KB | 0 0
    1. You literally stole this exploit from https://t.me/theprotocolone
  • Ravxawyn
    5 days
    # CSS 0.84 KB | 0 0
    1. ✅ Leaked Exploit Documentation:
    2.  
    3. https://docs.google.com/document/d/1ifNm-s74mX7GChaEzSJ1dVQCy1SrSxlMVRYi8ys0rgQ/edit?usp=sharing
    4.  
    5. This made me $13,000 in 2 days.
    6.  
    7. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    8. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    9.  
    10. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
Add Comment
Please, Sign In to add comment