LuffyTheFox

Untitled

Mar 18th, 2026 (edited)
6,365
1
Never
3
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.68 KB | None | 1 0
  1. {%- set image_count = namespace(value=0) %}
  2. {%- set video_count = namespace(value=0) %}
  3. {%- set enable_thinking = False %}
  4. {%- macro render_content(content, do_vision_count, is_system_content=false) %}
  5. {%- if content is string %}
  6. {{- content }}
  7. {%- elif content is iterable and content is not mapping %}
  8. {%- for item in content %}
  9. {%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
  10. {%- if is_system_content %}
  11. {{- raise_exception('System message cannot contain images.') }}
  12. {%- endif %}
  13. {%- if do_vision_count %}
  14. {%- set image_count.value = image_count.value + 1 %}
  15. {%- endif %}
  16. {%- if add_vision_id is defined and add_vision_id %}
  17. {{- 'Picture ' ~ image_count.value ~ ': ' }}
  18. {%- endif %}
  19. {{- '<|vision_start|><|image_pad|><|vision_end|>' }}
  20. {%- elif 'video' in item or item.type == 'video' %}
  21. {%- if is_system_content %}
  22. {{- raise_exception('System message cannot contain videos.') }}
  23. {%- endif %}
  24. {%- if do_vision_count %}
  25. {%- set video_count.value = video_count.value + 1 %}
  26. {%- endif %}
  27. {%- if add_vision_id is defined and add_vision_id %}
  28. {{- 'Video ' ~ video_count.value ~ ': ' }}
  29. {%- endif %}
  30. {{- '<|vision_start|><|video_pad|><|vision_end|>' }}
  31. {%- elif 'text' in item %}
  32. {{- item.text }}
  33. {%- else %}
  34. {{- raise_exception('Unexpected item type in content.') }}
  35. {%- endif %}
  36. {%- endfor %}
  37. {%- elif content is none or content is undefined %}
  38. {{- '' }}
  39. {%- else %}
  40. {{- raise_exception('Unexpected content type.') }}
  41. {%- endif %}
  42. {%- endmacro %}
  43. {%- set ns_flags = namespace(enable_thinking=true) %}
  44. {%- if enable_thinking is defined %}
  45. {%- set ns_flags.enable_thinking = enable_thinking %}
  46. {%- endif %}
  47. {%- if not messages %}
  48. {{- raise_exception('No messages provided.') }}
  49. {%- endif %}
  50. {%- if tools and tools is iterable and tools is not mapping %}
  51. {{- '<|im_start|>system\n' }}
  52. {{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
  53. {%- for tool in tools %}
  54. {{- "\n" }}
  55. {{- tool | tojson }}
  56. {%- endfor %}
  57. {{- "\n</tools>" }}
  58. {{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
  59. {%- if messages[0].role == 'system' or messages[0].role == 'developer' %}
  60. {%- set content = render_content(messages[0].content, false, true)|trim %}
  61. {%- if '<|think_off|>' in content %}
  62. {%- set ns_flags.enable_thinking = false %}
  63. {%- set content = content.replace('<|think_off|>', '').strip() %}
  64. {%- elif '<|think_on|>' in content %}
  65. {%- set ns_flags.enable_thinking = true %}
  66. {%- set content = content.replace('<|think_on|>', '').strip() %}
  67. {%- endif %}
  68. {%- if content %}
  69. {{- '\n\n' + content }}
  70. {%- endif %}
  71. {%- endif %}
  72. {{- '<|im_end|>\n' }}
  73. {%- else %}
  74. {%- if messages[0].role == 'system' or messages[0].role == 'developer' %}
  75. {%- set content = render_content(messages[0].content, false, true)|trim %}
  76. {%- if '<|think_off|>' in content %}
  77. {%- set ns_flags.enable_thinking = false %}
  78. {%- set content = content.replace('<|think_off|>', '').strip() %}
  79. {%- elif '<|think_on|>' in content %}
  80. {%- set ns_flags.enable_thinking = true %}
  81. {%- set content = content.replace('<|think_on|>', '').strip() %}
  82. {%- endif %}
  83. {{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
  84. {%- endif %}
  85. {%- endif %}
  86. {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
  87. {%- for message in messages[::-1] %}
  88. {%- set index = (messages|length - 1) - loop.index0 %}
  89. {%- if ns.multi_step_tool and message.role == "user" %}
  90. {%- set content = render_content(message.content, false)|trim %}
  91. {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
  92. {%- set ns.multi_step_tool = false %}
  93. {%- set ns.last_query_index = index %}
  94. {%- endif %}
  95. {%- endif %}
  96. {%- endfor %}
  97. {%- if ns.multi_step_tool %}
  98. {{- raise_exception('No user query found in messages.') }}
  99. {%- endif %}
  100. {%- for message in messages %}
  101. {%- set content = render_content(message.content, true)|trim %}
  102. {%- if '<|think_off|>' in content %}
  103. {%- set ns_flags.enable_thinking = false %}
  104. {%- set content = content.replace('<|think_off|>', '').strip() %}
  105. {%- elif '<|think_on|>' in content %}
  106. {%- set ns_flags.enable_thinking = true %}
  107. {%- set content = content.replace('<|think_on|>', '').strip() %}
  108. {%- endif %}
  109. {%- if message.role == "system" or message.role == "developer" %}
  110. {%- if not loop.first %}
  111. {{- raise_exception('System message must be at the beginning.') }}
  112. {%- endif %}
  113. {%- elif message.role == "user" %}
  114. {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
  115. {%- elif message.role == "assistant" %}
  116. {%- set reasoning_content = '' %}
  117. {%- if message.reasoning_content is string %}
  118. {%- set reasoning_content = message.reasoning_content %}
  119. {%- else %}
  120. {%- if '</think>' in content %}
  121. {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
  122. {%- set content = content.split('</think>')[-1].lstrip('\n') %}
  123. {%- endif %}
  124. {%- endif %}
  125. {%- set reasoning_content = reasoning_content|trim %}
  126. {%- if loop.index0 > ns.last_query_index and reasoning_content %}
  127. {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
  128. {%- else %}
  129. {{- '<|im_start|>' + message.role + '\n' + content }}
  130. {%- endif %}
  131. {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
  132. {%- for tool_call in message.tool_calls %}
  133. {%- if tool_call.function is defined %}
  134. {%- set tool_call = tool_call.function %}
  135. {%- endif %}
  136. {%- if loop.first %}
  137. {%- if content|trim %}
  138. {{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
  139. {%- else %}
  140. {{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
  141. {%- endif %}
  142. {%- else %}
  143. {{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
  144. {%- endif %}
  145. {%- if tool_call.arguments is defined and tool_call.arguments is mapping %}
  146. {%- if tool_call.arguments|length > 0 %}
  147. {%- for args_name in tool_call.arguments %}
  148. {%- set args_value = tool_call.arguments[args_name] %}
  149. {{- '<parameter=' + args_name + '>\n' }}
  150. {%- set args_value = args_value | tojson if args_value is mapping or (args_value is iterable and args_value is not string) else args_value | string %}
  151. {{- args_value }}
  152. {{- '\n</parameter>\n' }}
  153. {%- endfor %}
  154. {%- endif %}
  155. {%- elif tool_call.arguments is defined and tool_call.arguments is string %}
  156. {%- if tool_call.arguments|trim|length > 0 %}
  157. {{- tool_call.arguments }}
  158. {{- '\n' }}
  159. {%- endif %}
  160. {%- endif %}
  161. {{- '</function>\n</tool_call>' }}
  162. {%- endfor %}
  163. {%- endif %}
  164. {{- '<|im_end|>\n' }}
  165. {%- elif message.role == "tool" %}
  166. {%- if loop.previtem and loop.previtem.role != "tool" %}
  167. {{- '<|im_start|>user' }}
  168. {%- endif %}
  169. {{- '\n<tool_response>\n' }}
  170. {{- content }}
  171. {{- '\n</tool_response>' }}
  172. {%- if not loop.last and loop.nextitem.role != "tool" %}
  173. {{- '<|im_end|>\n' }}
  174. {%- elif loop.last %}
  175. {{- '<|im_end|>\n' }}
  176. {%- endif %}
  177. {%- else %}
  178. {{- raise_exception('Unexpected message role.') }}
  179. {%- endif %}
  180. {%- endfor %}
  181. {%- if add_generation_prompt %}
  182. {{- '<|im_start|>assistant\n' }}
  183. {%- if enable_thinking is defined and enable_thinking is false %}
  184. {{- '<think>\n\n</think>\n\n' }}
  185. {%- else %}
  186. {{- '<think>\n' }}
  187. {%- endif %}
  188. {%- endif %}
Advertisement
Comments
  • Sartetor
    37 days
    Comment was deleted
  • Zornuwyn
    31 days
    # CSS 0.06 KB | 0 0
    1. You literally stole this exploit from https://t.me/theprotocolone
  • Lerasvik
    11 days
    # CSS 0.85 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