Guest User

Untitled

a guest
Oct 30th, 2023
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 210.22 KB | None | 0 0
  1. C:\IA\MEMGpt>memgpt --model=zephyr-7B-alpha
  2. ⚙️ Using legacy command line arguments.
  3. None zephyr-7B-alpha ('sam_pov', None)
  4. Running... [exit by typing '/exit', list available commands with '/help']
  5. ⛔️ Warning - you are running MemGPT with zephyr-7B-alpha, which is not officially supported (yet). Expect bugs!
  6. 💭 Bootup sequence complete. Persona activated. Testing messaging functionality.
  7. Hit enter to begin (will request first MemGPT message)
  8. [A[K
  9. ┌─────────────────────────────── Traceback (most recent call last) ────────────────────────────────┐
  10. │ C:\Users\ivan\AppData\Local\Programs\Python\Python311\Lib\site-packages\memgpt\local_llm\llm_cha │
  11. │ t_completion_wrappers\zephyr.py:314 in output_to_chat_completion_response │
  12. │ │
  13. │ 311 │ │ │ function_json_output = json.loads(raw_llm_output) │
  14. │ 312 │ │ except Exception as e: │
  15. │ 313 │ │ │ try: │
  16. │ > 314 │ │ │ │ function_json_output = json.loads(raw_llm_output + "\n}") │
  17. │ 315 │ │ │ except: │
  18. │ 316 │ │ │ │ raise Exception(f"Failed to decode JSON from LLM output:\n{raw_llm_outpu │
  19. │ 317 │ │ function_name = function_json_output["function"] │
  20. │ │
  21. │ ┌─────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
  22. │ │ raw_llm_output = '{ "function": "core_memory_append",\n "params": {\n "inner_thoughts": │ │
  23. │ │ "User \''+443 │ │
  24. │ │ self = <memgpt.local_llm.llm_chat_completion_wrappers.zephyr.ZephyrMistralInnerMo… │ │
  25. │ │ object at 0x000001A8C84ADF10> │ │
  26. │ └──────────────────────────────────────────────────────────────────────────────────────────────┘ │
  27. │ │
  28. │ C:\Users\ivan\AppData\Local\Programs\Python\Python311\Lib\json\__init__.py:346 in loads │
  29. │ │
  30. │ 343 │ if (cls is None and object_hook is None and │
  31. │ 344 │ │ │ parse_int is None and parse_float is None and │
  32. │ 345 │ │ │ parse_constant is None and object_pairs_hook is None and not kw): │
  33. │ > 346 │ │ return _default_decoder.decode(s) │
  34. │ 347 │ if cls is None: │
  35. │ 348 │ │ cls = JSONDecoder │
  36. │ 349 │ if object_hook is not None: │
  37. │ │
  38. │ ┌─────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
  39. │ │ cls = None │ │
  40. │ │ kw = {} │ │
  41. │ │ object_hook = None │ │
  42. │ │ object_pairs_hook = None │ │
  43. │ │ parse_constant = None │ │
  44. │ │ parse_float = None │ │
  45. │ │ parse_int = None │ │
  46. │ │ s = '{ "function": "core_memory_append",\n "params": {\n │ │
  47. │ │ "inner_thoughts": "User \''+445 │ │
  48. │ └──────────────────────────────────────────────────────────────────────────────────────────────┘ │
  49. │ │
  50. │ C:\Users\ivan\AppData\Local\Programs\Python\Python311\Lib\json\decoder.py:337 in decode │
  51. │ │
  52. │ 334 │ │ containing a JSON document). │
  53. │ 335 │ │ │
  54. │ 336 │ │ """ │
  55. │ > 337 │ │ obj, end = self.raw_decode(s, idx=_w(s, 0).end()) │
  56. │ 338 │ │ end = _w(s, end).end() │
  57. │ 339 │ │ if end != len(s): │
  58. │ 340 │ │ │ raise JSONDecodeError("Extra data", s, end) │
  59. │ │
  60. │ ┌─────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
  61. │ │ _w = <built-in method match of re.Pattern object at 0x000001A86987AA80> │ │
  62. │ │ s = '{ "function": "core_memory_append",\n "params": {\n "inner_thoughts": "User │ │
  63. │ │ \''+445 │ │
  64. │ │ self = <json.decoder.JSONDecoder object at 0x000001A8698FDD50> │ │
  65. │ └──────────────────────────────────────────────────────────────────────────────────────────────┘ │
  66. │ │
  67. │ C:\Users\ivan\AppData\Local\Programs\Python\Python311\Lib\json\decoder.py:355 in raw_decode │
  68. │ │
  69. │ 352 │ │ try: │
  70. │ 353 │ │ │ obj, end = self.scan_once(s, idx) │
  71. │ 354 │ │ except StopIteration as err: │
  72. │ > 355 │ │ │ raise JSONDecodeError("Expecting value", s, err.value) from None │
  73. │ 356 │ │ return obj, end │
  74. │ 357 │
  75. │ │
  76. │ ┌─────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
  77. │ │ idx = 0 │ │
  78. │ │ s = '{ "function": "core_memory_append",\n "params": {\n "inner_thoughts": "User │ │
  79. │ │ \''+445 │ │
  80. │ │ self = <json.decoder.JSONDecoder object at 0x000001A8698FDD50> │ │
  81. │ └──────────────────────────────────────────────────────────────────────────────────────────────┘ │
  82. └──────────────────────────────────────────────────────────────────────────────────────────────────┘
  83. JSONDecodeError: Expecting value: line 5 column 16 (char 219)
  84.  
  85. During handling of the above exception, another exception occurred:
  86.  
  87. ┌─────────────────────────────── Traceback (most recent call last) ────────────────────────────────┐
  88. │ C:\Users\ivan\AppData\Local\Programs\Python\Python311\Lib\site-packages\memgpt\main.py:148 in │
  89. │ run │
  90. │ │
  91. │ 145 │ ), # TODO: just pass in? │
  92. │ 146 ): │
  93. │ 147 │ loop = asyncio.get_event_loop() │
  94. │ > 148 │ loop.run_until_complete( │
  95. │ 149 │ │ main( │
  96. │ 150 │ │ │ persona, │
  97. │ 151 │ │ │ human, │
  98. │ │
  99. │ ┌─────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
  100. │ │ archival_storage_faiss_path = '' │ │
  101. │ │ archival_storage_files = '' │ │
  102. │ │ archival_storage_files_compute_embeddings = '' │ │
  103. │ │ archival_storage_sqldb = '' │ │
  104. │ │ debug = False │ │
  105. │ │ first = False │ │
  106. │ │ human = None │ │
  107. │ │ loop = <ProactorEventLoop running=False closed=False │ │
  108. │ │ debug=False> │ │
  109. │ │ model = 'zephyr-7B-alpha' │ │
  110. │ │ no_verify = False │ │
  111. │ │ persona = None │ │
  112. │ │ use_azure_openai = False │ │
  113. │ └──────────────────────────────────────────────────────────────────────────────────────────────┘ │
  114. │ │
  115. │ C:\Users\ivan\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py:653 in │
  116. │ run_until_complete │
  117. │ │
  118. │ 650 │ │ if not future.done(): │
  119. │ 651 │ │ │ raise RuntimeError('Event loop stopped before Future completed.') │
  120. │ 652 │ │ │
  121. │ > 653 │ │ return future.result() │
  122. │ 654 │ │
  123. │ 655 │ def stop(self): │
  124. │ 656 │ │ """Stop running the event loop. │
  125. │ │
  126. │ ┌─────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
  127. │ │ future = <Task finished name='Task-1' coro=<main() done, defined at │ │
  128. │ │ C:\Users\ivan\AppData\Local\Programs\Python\Python311\Lib\site-packages\memgpt\m… │ │
  129. │ │ exception=Exception('Failed to decode JSON from LLM output:\n{ "function": │ │
  130. │ │ "core_memory_append",\n "params": {\n "inner_thoughts": "User \'Chad\' │ │
  131. │ │ (human) has successfully logged into the system. User information added to core │ │
  132. │ │ memory.",\n "name": "user_details",\n "content": `{\n "firstName": │ │
  133. │ │ "Chad",\n "lastName": null,\n "gender": "Male",\n "age": null,\n │ │
  134. │ │ "nationality": null,\n "occupation": "Computer Science PhD student at UC │ │
  135. │ │ Berkeley",\n "interests": ["Formula 1", "Sailing", "Taste of the Himalayas │ │
  136. │ │ Restaurant in Berkeley", "CSGO"]\n }`\n }\n}')> │ │
  137. │ │ new_task = True │ │
  138. │ │ self = <ProactorEventLoop running=False closed=False debug=False> │ │
  139. │ └──────────────────────────────────────────────────────────────────────────────────────────────┘ │
  140. │ │
  141. │ C:\Users\ivan\AppData\Local\Programs\Python\Python311\Lib\site-packages\memgpt\main.py:480 in │
  142. │ main │
  143. │ │
  144. │ 477 │ │ │ │ heartbeat_request, │
  145. │ 478 │ │ │ │ function_failed, │
  146. │ 479 │ │ │ │ token_warning, │
  147. │ > 480 │ │ │ ) = await memgpt_agent.step(user_message, first_message=False, skip_verify=n │
  148. │ 481 │ │ │ │
  149. │ 482 │ │ │ # Skip user inputs if there's a memory warning, function execution failed, o │
  150. │ 483 │ │ │ if token_warning: │
  151. │ │
  152. │ ┌─────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
  153. │ │ archival_storage_faiss_path = '' │ │
  154. │ │ archival_storage_files = '' │ │
  155. │ │ archival_storage_files_compute_embeddings = '' │ │
  156. │ │ archival_storage_sqldb = '' │ │
  157. │ │ azure_vars = [] │ │
  158. │ │ cfg = <memgpt.config.Config object at │ │
  159. │ │ 0x000001A8C844AB90> │ │
  160. │ │ chosen_human = ('cs_phd', None) │ │
  161. │ │ chosen_persona = ('sam_pov', None) │ │
  162. │ │ counter = 0 │ │
  163. │ │ debug = False │ │
  164. │ │ first = False │ │
  165. │ │ human = None │ │
  166. │ │ human_persona = ('cs_phd', None) │ │
  167. │ │ memgpt_agent = <memgpt.agent.AgentAsync object at │ │
  168. │ │ 0x000001A8617E5690> │ │
  169. │ │ memgpt_persona = ('sam_pov', None) │ │
  170. │ │ model = 'zephyr-7B-alpha' │ │
  171. │ │ multiline_input = False │ │
  172. │ │ no_verify = False │ │
  173. │ │ persistence_manager = <memgpt.persistence_manager.InMemoryStateManager │ │
  174. │ │ object at 0x000001A8617E5810> │ │
  175. │ │ persona = None │ │
  176. │ │ print_messages = <function print_messages at 0x000001A8CAC67CE0> │ │
  177. │ │ skip_next_user_input = False │ │
  178. │ │ status = <rich.status.Status object at │ │
  179. │ │ 0x000001A8617E52D0> │ │
  180. │ │ use_azure_openai = False │ │
  181. │ │ USER_GOES_FIRST = False │ │
  182. │ │ user_input = None │ │
  183. │ │ user_message = None │ │
  184. │ └──────────────────────────────────────────────────────────────────────────────────────────────┘ │
  185. │ │
  186. │ C:\Users\ivan\AppData\Local\Programs\Python\Python311\Lib\site-packages\memgpt\agent.py:946 in │
  187. │ step │
  188. │ │
  189. │ 943 │ │ │ │ return await self.step(user_message, first_message=first_message) │
  190. │ 944 │ │ │ else: │
  191. │ 945 │ │ │ │ printd(f"step() failed with openai.InvalidRequestError, but didn't recog │
  192. │ > 946 │ │ │ │ raise e │
  193. │ 947 │ │
  194. │ 948 │ async def summarize_messages_inplace(self, cutoff=None): │
  195. │ 949 │ │ if cutoff is None: │
  196. │ │
  197. │ ┌─────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
  198. │ │ counter = 1 │ │
  199. │ │ first_message = False │ │
  200. │ │ first_message_retry_limit = 10 │ │
  201. │ │ input_message_sequence = [ │ │
  202. │ │ │ { │ │
  203. │ │ │ │ 'role': 'system', │ │
  204. │ │ │ │ 'content': "You are MemGPT, the latest version of Limnal │ │
  205. │ │ Corporation's digital companion, de"+7218 │ │
  206. │ │ │ }, │ │
  207. │ │ │ { │ │
  208. │ │ │ │ 'role': 'assistant', │ │
  209. │ │ │ │ 'content': 'Bootup sequence complete. Persona activated. │ │
  210. │ │ Testing messaging functionality.', │ │
  211. │ │ │ │ 'function_call': { │ │
  212. │ │ │ │ │ 'name': 'send_message', │ │
  213. │ │ │ │ │ 'arguments': '{\n "message": "More human than human │ │
  214. │ │ is our motto."\n}' │ │
  215. │ │ │ │ } │ │
  216. │ │ │ }, │ │
  217. │ │ │ { │ │
  218. │ │ │ │ 'role': 'function', │ │
  219. │ │ │ │ 'name': 'send_message', │ │
  220. │ │ │ │ 'content': '{"status": "OK", "message": null, "time": │ │
  221. │ │ "2023-10-30 02:14:35 AM PDT-0700"}' │ │
  222. │ │ │ }, │ │
  223. │ │ │ { │ │
  224. │ │ │ │ 'role': 'user', │ │
  225. │ │ │ │ 'content': '{"type": "login", "last_login": "Never │ │
  226. │ │ (first login)", "time": "2023-10-30 02:14'+17 │ │
  227. │ │ │ } │ │
  228. │ │ ] │ │
  229. │ │ response = { │ │
  230. │ │ │ 'model': None, │ │
  231. │ │ │ 'choices': [ │ │
  232. │ │ │ │ { │ │
  233. │ │ │ │ │ 'message': { │ │
  234. │ │ │ │ │ │ 'role': 'assistant', │ │
  235. │ │ │ │ │ │ 'content': '', │ │
  236. │ │ │ │ │ │ 'function_call': { │ │
  237. │ │ │ │ │ │ │ 'name': 'conversation_search', │ │
  238. │ │ │ │ │ │ │ 'arguments': '{"query": "", "page": 1, │ │
  239. │ │ "request_heartbeat": true}' │ │
  240. │ │ │ │ │ │ } │ │
  241. │ │ │ │ │ }, │ │
  242. │ │ │ │ │ 'finish_reason': 'stop' │ │
  243. │ │ │ │ } │ │
  244. │ │ │ ], │ │
  245. │ │ │ 'usage': { │ │
  246. │ │ │ │ 'prompt_tokens': 0, │ │
  247. │ │ │ │ 'completion_tokens': 0, │ │
  248. │ │ │ │ 'total_tokens': 0 │ │
  249. │ │ │ } │ │
  250. │ │ } │ │
  251. │ │ self = <memgpt.agent.AgentAsync object at 0x000001A8617E5690> │ │
  252. │ │ skip_verify = False │ │
  253. │ │ user_message = None │ │
  254. │ └──────────────────────────────────────────────────────────────────────────────────────────────┘ │
  255. │ │
  256. │ C:\Users\ivan\AppData\Local\Programs\Python\Python311\Lib\site-packages\memgpt\agent.py:884 in │
  257. │ step │
  258. │ │
  259. │ 881 │ │ │ │ printd(f"This is the first message. Running extra verifier on AI respons │
  260. │ 882 │ │ │ │ counter = 0 │
  261. │ 883 │ │ │ │ while True: │
  262. │ > 884 │ │ │ │ │ response = await get_ai_reply_async(model=self.model, message_sequen │
  263. │ 885 │ │ │ │ │ if self.verify_first_message_correctness(response, require_monologue │
  264. │ 886 │ │ │ │ │ │ break │
  265. │ 887 │
  266. │ │
  267. │ ┌─────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
  268. │ │ counter = 1 │ │
  269. │ │ first_message = False │ │
  270. │ │ first_message_retry_limit = 10 │ │
  271. │ │ input_message_sequence = [ │ │
  272. │ │ │ { │ │
  273. │ │ │ │ 'role': 'system', │ │
  274. │ │ │ │ 'content': "You are MemGPT, the latest version of Limnal │ │
  275. │ │ Corporation's digital companion, de"+7218 │ │
  276. │ │ │ }, │ │
  277. │ │ │ { │ │
  278. │ │ │ │ 'role': 'assistant', │ │
  279. │ │ │ │ 'content': 'Bootup sequence complete. Persona activated. │ │
  280. │ │ Testing messaging functionality.', │ │
  281. │ │ │ │ 'function_call': { │ │
  282. │ │ │ │ │ 'name': 'send_message', │ │
  283. │ │ │ │ │ 'arguments': '{\n "message": "More human than human │ │
  284. │ │ is our motto."\n}' │ │
  285. │ │ │ │ } │ │
  286. │ │ │ }, │ │
  287. │ │ │ { │ │
  288. │ │ │ │ 'role': 'function', │ │
  289. │ │ │ │ 'name': 'send_message', │ │
  290. │ │ │ │ 'content': '{"status": "OK", "message": null, "time": │ │
  291. │ │ "2023-10-30 02:14:35 AM PDT-0700"}' │ │
  292. │ │ │ }, │ │
  293. │ │ │ { │ │
  294. │ │ │ │ 'role': 'user', │ │
  295. │ │ │ │ 'content': '{"type": "login", "last_login": "Never │ │
  296. │ │ (first login)", "time": "2023-10-30 02:14'+17 │ │
  297. │ │ │ } │ │
  298. │ │ ] │ │
  299. │ │ response = { │ │
  300. │ │ │ 'model': None, │ │
  301. │ │ │ 'choices': [ │ │
  302. │ │ │ │ { │ │
  303. │ │ │ │ │ 'message': { │ │
  304. │ │ │ │ │ │ 'role': 'assistant', │ │
  305. │ │ │ │ │ │ 'content': '', │ │
  306. │ │ │ │ │ │ 'function_call': { │ │
  307. │ │ │ │ │ │ │ 'name': 'conversation_search', │ │
  308. │ │ │ │ │ │ │ 'arguments': '{"query": "", "page": 1, │ │
  309. │ │ "request_heartbeat": true}' │ │
  310. │ │ │ │ │ │ } │ │
  311. │ │ │ │ │ }, │ │
  312. │ │ │ │ │ 'finish_reason': 'stop' │ │
  313. │ │ │ │ } │ │
  314. │ │ │ ], │ │
  315. │ │ │ 'usage': { │ │
  316. │ │ │ │ 'prompt_tokens': 0, │ │
  317. │ │ │ │ 'completion_tokens': 0, │ │
  318. │ │ │ │ 'total_tokens': 0 │ │
  319. │ │ │ } │ │
  320. │ │ } │ │
  321. │ │ self = <memgpt.agent.AgentAsync object at 0x000001A8617E5690> │ │
  322. │ │ skip_verify = False │ │
  323. │ │ user_message = None │ │
  324. │ └──────────────────────────────────────────────────────────────────────────────────────────────┘ │
  325. │ │
  326. │ C:\Users\ivan\AppData\Local\Programs\Python\Python311\Lib\site-packages\memgpt\agent.py:156 in │
  327. │ get_ai_reply_async │
  328. │ │
  329. │ 153 │ │ return response │
  330. │ 154 │ │
  331. │ 155 │ except Exception as e: │
  332. │ > 156 │ │ raise e │
  333. │ 157 │
  334. │ 158 │
  335. │ 159 # Assuming function_to_call is either sync or async │
  336. │ │
  337. │ ┌─────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
  338. │ │ function_call = 'auto' │ │
  339. │ │ functions = [ │ │
  340. │ │ │ { │ │
  341. │ │ │ │ 'name': 'send_message', │ │
  342. │ │ │ │ 'description': 'Sends a message to the human user', │ │
  343. │ │ │ │ 'parameters': { │ │
  344. │ │ │ │ │ 'type': 'object', │ │
  345. │ │ │ │ │ 'properties': { │ │
  346. │ │ │ │ │ │ 'message': { │ │
  347. │ │ │ │ │ │ │ 'type': 'string', │ │
  348. │ │ │ │ │ │ │ 'description': 'Message contents. All unicode │ │
  349. │ │ (including emojis) are supported.' │ │
  350. │ │ │ │ │ │ } │ │
  351. │ │ │ │ │ }, │ │
  352. │ │ │ │ │ 'required': ['message'] │ │
  353. │ │ │ │ } │ │
  354. │ │ │ }, │ │
  355. │ │ │ { │ │
  356. │ │ │ │ 'name': 'pause_heartbeats', │ │
  357. │ │ │ │ 'description': 'Temporarily ignore timed heartbeats. You may │ │
  358. │ │ still receive messages from manual '+28, │ │
  359. │ │ │ │ 'parameters': { │ │
  360. │ │ │ │ │ 'type': 'object', │ │
  361. │ │ │ │ │ 'properties': { │ │
  362. │ │ │ │ │ │ 'minutes': { │ │
  363. │ │ │ │ │ │ │ 'type': 'integer', │ │
  364. │ │ │ │ │ │ │ 'description': 'Number of minutes to ignore │ │
  365. │ │ heartbeats for. Max value of 360 minutes (6 hours).' │ │
  366. │ │ │ │ │ │ } │ │
  367. │ │ │ │ │ }, │ │
  368. │ │ │ │ │ 'required': ['minutes'] │ │
  369. │ │ │ │ } │ │
  370. │ │ │ }, │ │
  371. │ │ │ { │ │
  372. │ │ │ │ 'name': 'core_memory_append', │ │
  373. │ │ │ │ 'description': 'Append to the contents of core memory.', │ │
  374. │ │ │ │ 'parameters': { │ │
  375. │ │ │ │ │ 'type': 'object', │ │
  376. │ │ │ │ │ 'properties': { │ │
  377. │ │ │ │ │ │ 'name': { │ │
  378. │ │ │ │ │ │ │ 'type': 'string', │ │
  379. │ │ │ │ │ │ │ 'description': 'Section of the memory to be edited │ │
  380. │ │ (persona or human).' │ │
  381. │ │ │ │ │ │ }, │ │
  382. │ │ │ │ │ │ 'content': { │ │
  383. │ │ │ │ │ │ │ 'type': 'string', │ │
  384. │ │ │ │ │ │ │ 'description': 'Content to write to the memory. All │ │
  385. │ │ unicode (including emojis) are supported.' │ │
  386. │ │ │ │ │ │ }, │ │
  387. │ │ │ │ │ │ 'request_heartbeat': { │ │
  388. │ │ │ │ │ │ │ 'type': 'boolean', │ │
  389. │ │ │ │ │ │ │ 'description': 'Request an immediate heartbeat after │ │
  390. │ │ function execution, use to chain multiple f'+9 │ │
  391. │ │ │ │ │ │ } │ │
  392. │ │ │ │ │ }, │ │
  393. │ │ │ │ │ 'required': ['name', 'content', 'request_heartbeat'] │ │
  394. │ │ │ │ } │ │
  395. │ │ │ }, │ │
  396. │ │ │ { │ │
  397. │ │ │ │ 'name': 'core_memory_replace', │ │
  398. │ │ │ │ 'description': 'Replace to the contents of core memory. To delete │ │
  399. │ │ memories, use an empty string '+16, │ │
  400. │ │ │ │ 'parameters': { │ │
  401. │ │ │ │ │ 'type': 'object', │ │
  402. │ │ │ │ │ 'properties': { │ │
  403. │ │ │ │ │ │ 'name': { │ │
  404. │ │ │ │ │ │ │ 'type': 'string', │ │
  405. │ │ │ │ │ │ │ 'description': 'Section of the memory to be edited │ │
  406. │ │ (persona or human).' │ │
  407. │ │ │ │ │ │ }, │ │
  408. │ │ │ │ │ │ 'old_content': { │ │
  409. │ │ │ │ │ │ │ 'type': 'string', │ │
  410. │ │ │ │ │ │ │ 'description': 'String to replace. Must be an exact │ │
  411. │ │ match.' │ │
  412. │ │ │ │ │ │ }, │ │
  413. │ │ │ │ │ │ 'new_content': { │ │
  414. │ │ │ │ │ │ │ 'type': 'string', │ │
  415. │ │ │ │ │ │ │ 'description': 'Content to write to the memory. All │ │
  416. │ │ unicode (including emojis) are supported.' │ │
  417. │ │ │ │ │ │ }, │ │
  418. │ │ │ │ │ │ 'request_heartbeat': { │ │
  419. │ │ │ │ │ │ │ 'type': 'boolean', │ │
  420. │ │ │ │ │ │ │ 'description': 'Request an immediate heartbeat after │ │
  421. │ │ function execution, use to chain multiple f'+9 │ │
  422. │ │ │ │ │ │ } │ │
  423. │ │ │ │ │ }, │ │
  424. │ │ │ │ │ 'required': [ │ │
  425. │ │ │ │ │ │ 'name', │ │
  426. │ │ │ │ │ │ 'old_content', │ │
  427. │ │ │ │ │ │ 'new_content', │ │
  428. │ │ │ │ │ │ 'request_heartbeat' │ │
  429. │ │ │ │ │ ] │ │
  430. │ │ │ │ } │ │
  431. │ │ │ }, │ │
  432. │ │ │ { │ │
  433. │ │ │ │ 'name': 'conversation_search', │ │
  434. │ │ │ │ 'description': 'Search prior conversation history using │ │
  435. │ │ case-insensitive string matching.', │ │
  436. │ │ │ │ 'parameters': { │ │
  437. │ │ │ │ │ 'type': 'object', │ │
  438. │ │ │ │ │ 'properties': { │ │
  439. │ │ │ │ │ │ 'query': { │ │
  440. │ │ │ │ │ │ │ 'type': 'string', │ │
  441. │ │ │ │ │ │ │ 'description': 'String to search for.' │ │
  442. │ │ │ │ │ │ }, │ │
  443. │ │ │ │ │ │ 'page': { │ │
  444. │ │ │ │ │ │ │ 'type': 'integer', │ │
  445. │ │ │ │ │ │ │ 'description': 'Allows you to page through results. │ │
  446. │ │ Only use on a follow-up query. Defaults to 0'+14 │ │
  447. │ │ │ │ │ │ }, │ │
  448. │ │ │ │ │ │ 'request_heartbeat': { │ │
  449. │ │ │ │ │ │ │ 'type': 'boolean', │ │
  450. │ │ │ │ │ │ │ 'description': "Request an immediate heartbeat after │ │
  451. │ │ function execution. Set to 'true' if you wa"+59 │ │
  452. │ │ │ │ │ │ } │ │
  453. │ │ │ │ │ }, │ │
  454. │ │ │ │ │ 'required': ['name', 'page', 'request_heartbeat'] │ │
  455. │ │ │ │ } │ │
  456. │ │ │ }, │ │
  457. │ │ │ { │ │
  458. │ │ │ │ 'name': 'conversation_search_date', │ │
  459. │ │ │ │ 'description': 'Search prior conversation history using a date │ │
  460. │ │ range.', │ │
  461. │ │ │ │ 'parameters': { │ │
  462. │ │ │ │ │ 'type': 'object', │ │
  463. │ │ │ │ │ 'properties': { │ │
  464. │ │ │ │ │ │ 'start_date': { │ │
  465. │ │ │ │ │ │ │ 'type': 'string', │ │
  466. │ │ │ │ │ │ │ 'description': "The start of the date range to │ │
  467. │ │ search, in the format 'YYYY-MM-DD'." │ │
  468. │ │ │ │ │ │ }, │ │
  469. │ │ │ │ │ │ 'end_date': { │ │
  470. │ │ │ │ │ │ │ 'type': 'string', │ │
  471. │ │ │ │ │ │ │ 'description': "The end of the date range to search, │ │
  472. │ │ in the format 'YYYY-MM-DD'." │ │
  473. │ │ │ │ │ │ }, │ │
  474. │ │ │ │ │ │ 'page': { │ │
  475. │ │ │ │ │ │ │ 'type': 'integer', │ │
  476. │ │ │ │ │ │ │ 'description': 'Allows you to page through results. │ │
  477. │ │ Only use on a follow-up query. Defaults to 0'+14 │ │
  478. │ │ │ │ │ │ }, │ │
  479. │ │ │ │ │ │ 'request_heartbeat': { │ │
  480. │ │ │ │ │ │ │ 'type': 'boolean', │ │
  481. │ │ │ │ │ │ │ 'description': "Request an immediate heartbeat after │ │
  482. │ │ function execution. Set to 'true' if you wa"+59 │ │
  483. │ │ │ │ │ │ } │ │
  484. │ │ │ │ │ }, │ │
  485. │ │ │ │ │ 'required': ['name', 'page', 'request_heartbeat'] │ │
  486. │ │ │ │ } │ │
  487. │ │ │ }, │ │
  488. │ │ │ { │ │
  489. │ │ │ │ 'name': 'archival_memory_insert', │ │
  490. │ │ │ │ 'description': 'Add to archival memory. Make sure to phrase the │ │
  491. │ │ memory contents such that it can'+25, │ │
  492. │ │ │ │ 'parameters': { │ │
  493. │ │ │ │ │ 'type': 'object', │ │
  494. │ │ │ │ │ 'properties': { │ │
  495. │ │ │ │ │ │ 'content': { │ │
  496. │ │ │ │ │ │ │ 'type': 'string', │ │
  497. │ │ │ │ │ │ │ 'description': 'Content to write to the memory. All │ │
  498. │ │ unicode (including emojis) are supported.' │ │
  499. │ │ │ │ │ │ }, │ │
  500. │ │ │ │ │ │ 'request_heartbeat': { │ │
  501. │ │ │ │ │ │ │ 'type': 'boolean', │ │
  502. │ │ │ │ │ │ │ 'description': "Request an immediate heartbeat after │ │
  503. │ │ function execution. Set to 'true' if you wa"+59 │ │
  504. │ │ │ │ │ │ } │ │
  505. │ │ │ │ │ }, │ │
  506. │ │ │ │ │ 'required': ['name', 'content', 'request_heartbeat'] │ │
  507. │ │ │ │ } │ │
  508. │ │ │ }, │ │
  509. │ │ │ { │ │
  510. │ │ │ │ 'name': 'archival_memory_search', │ │
  511. │ │ │ │ 'description': 'Search archival memory using semantic │ │
  512. │ │ (embedding-based) search.', │ │
  513. │ │ │ │ 'parameters': { │ │
  514. │ │ │ │ │ 'type': 'object', │ │
  515. │ │ │ │ │ 'properties': { │ │
  516. │ │ │ │ │ │ 'query': { │ │
  517. │ │ │ │ │ │ │ 'type': 'string', │ │
  518. │ │ │ │ │ │ │ 'description': 'String to search for.' │ │
  519. │ │ │ │ │ │ }, │ │
  520. │ │ │ │ │ │ 'page': { │ │
  521. │ │ │ │ │ │ │ 'type': 'integer', │ │
  522. │ │ │ │ │ │ │ 'description': 'Allows you to page through results. │ │
  523. │ │ Only use on a follow-up query. Defaults to 0'+14 │ │
  524. │ │ │ │ │ │ }, │ │
  525. │ │ │ │ │ │ 'request_heartbeat': { │ │
  526. │ │ │ │ │ │ │ 'type': 'boolean', │ │
  527. │ │ │ │ │ │ │ 'description': "Request an immediate heartbeat after │ │
  528. │ │ function execution. Set to 'true' if you wa"+59 │ │
  529. │ │ │ │ │ │ } │ │
  530. │ │ │ │ │ }, │ │
  531. │ │ │ │ │ 'required': ['name', 'query', 'page', 'request_heartbeat'] │ │
  532. │ │ │ │ } │ │
  533. │ │ │ } │ │
  534. │ │ ] │ │
  535. │ │ message_sequence = [ │ │
  536. │ │ │ { │ │
  537. │ │ │ │ 'role': 'system', │ │
  538. │ │ │ │ 'content': "You are MemGPT, the latest version of Limnal │ │
  539. │ │ Corporation's digital companion, de"+7218 │ │
  540. │ │ │ }, │ │
  541. │ │ │ { │ │
  542. │ │ │ │ 'role': 'assistant', │ │
  543. │ │ │ │ 'content': 'Bootup sequence complete. Persona activated. Testing │ │
  544. │ │ messaging functionality.', │ │
  545. │ │ │ │ 'function_call': { │ │
  546. │ │ │ │ │ 'name': 'send_message', │ │
  547. │ │ │ │ │ 'arguments': '{\n "message": "More human than human is our │ │
  548. │ │ motto."\n}' │ │
  549. │ │ │ │ } │ │
  550. │ │ │ }, │ │
  551. │ │ │ { │ │
  552. │ │ │ │ 'role': 'function', │ │
  553. │ │ │ │ 'name': 'send_message', │ │
  554. │ │ │ │ 'content': '{"status": "OK", "message": null, "time": "2023-10-30 │ │
  555. │ │ 02:14:35 AM PDT-0700"}' │ │
  556. │ │ │ }, │ │
  557. │ │ │ { │ │
  558. │ │ │ │ 'role': 'user', │ │
  559. │ │ │ │ 'content': '{"type": "login", "last_login": "Never (first │ │
  560. │ │ login)", "time": "2023-10-30 02:14'+17 │ │
  561. │ │ │ } │ │
  562. │ │ ] │ │
  563. │ │ model = 'zephyr-7B-alpha' │ │
  564. │ └──────────────────────────────────────────────────────────────────────────────────────────────┘ │
  565. │ │
  566. │ C:\Users\ivan\AppData\Local\Programs\Python\Python311\Lib\site-packages\memgpt\agent.py:137 in │
  567. │ get_ai_reply_async │
  568. │ │
  569. │ 134 │ """Base call to GPT API w/ functions""" │
  570. │ 135 │ │
  571. │ 136 │ try: │
  572. │ > 137 │ │ response = await acreate( │
  573. │ 138 │ │ │ model=model, │
  574. │ 139 │ │ │ messages=message_sequence, │
  575. │ 140 │ │ │ functions=functions, │
  576. │ │
  577. │ ┌─────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
  578. │ │ function_call = 'auto' │ │
  579. │ │ functions = [ │ │
  580. │ │ │ { │ │
  581. │ │ │ │ 'name': 'send_message', │ │
  582. │ │ │ │ 'description': 'Sends a message to the human user', │ │
  583. │ │ │ │ 'parameters': { │ │
  584. │ │ │ │ │ 'type': 'object', │ │
  585. │ │ │ │ │ 'properties': { │ │
  586. │ │ │ │ │ │ 'message': { │ │
  587. │ │ │ │ │ │ │ 'type': 'string', │ │
  588. │ │ │ │ │ │ │ 'description': 'Message contents. All unicode │ │
  589. │ │ (including emojis) are supported.' │ │
  590. │ │ │ │ │ │ } │ │
  591. │ │ │ │ │ }, │ │
  592. │ │ │ │ │ 'required': ['message'] │ │
  593. │ │ │ │ } │ │
  594. │ │ │ }, │ │
  595. │ │ │ { │ │
  596. │ │ │ │ 'name': 'pause_heartbeats', │ │
  597. │ │ │ │ 'description': 'Temporarily ignore timed heartbeats. You may │ │
  598. │ │ still receive messages from manual '+28, │ │
  599. │ │ │ │ 'parameters': { │ │
  600. │ │ │ │ │ 'type': 'object', │ │
  601. │ │ │ │ │ 'properties': { │ │
  602. │ │ │ │ │ │ 'minutes': { │ │
  603. │ │ │ │ │ │ │ 'type': 'integer', │ │
  604. │ │ │ │ │ │ │ 'description': 'Number of minutes to ignore │ │
  605. │ │ heartbeats for. Max value of 360 minutes (6 hours).' │ │
  606. │ │ │ │ │ │ } │ │
  607. │ │ │ │ │ }, │ │
  608. │ │ │ │ │ 'required': ['minutes'] │ │
  609. │ │ │ │ } │ │
  610. │ │ │ }, │ │
  611. │ │ │ { │ │
  612. │ │ │ │ 'name': 'core_memory_append', │ │
  613. │ │ │ │ 'description': 'Append to the contents of core memory.', │ │
  614. │ │ │ │ 'parameters': { │ │
  615. │ │ │ │ │ 'type': 'object', │ │
  616. │ │ │ │ │ 'properties': { │ │
  617. │ │ │ │ │ │ 'name': { │ │
  618. │ │ │ │ │ │ │ 'type': 'string', │ │
  619. │ │ │ │ │ │ │ 'description': 'Section of the memory to be edited │ │
  620. │ │ (persona or human).' │ │
  621. │ │ │ │ │ │ }, │ │
  622. │ │ │ │ │ │ 'content': { │ │
  623. │ │ │ │ │ │ │ 'type': 'string', │ │
  624. │ │ │ │ │ │ │ 'description': 'Content to write to the memory. All │ │
  625. │ │ unicode (including emojis) are supported.' │ │
  626. │ │ │ │ │ │ }, │ │
  627. │ │ │ │ │ │ 'request_heartbeat': { │ │
  628. │ │ │ │ │ │ │ 'type': 'boolean', │ │
  629. │ │ │ │ │ │ │ 'description': 'Request an immediate heartbeat after │ │
  630. │ │ function execution, use to chain multiple f'+9 │ │
  631. │ │ │ │ │ │ } │ │
  632. │ │ │ │ │ }, │ │
  633. │ │ │ │ │ 'required': ['name', 'content', 'request_heartbeat'] │ │
  634. │ │ │ │ } │ │
  635. │ │ │ }, │ │
  636. │ │ │ { │ │
  637. │ │ │ │ 'name': 'core_memory_replace', │ │
  638. │ │ │ │ 'description': 'Replace to the contents of core memory. To delete │ │
  639. │ │ memories, use an empty string '+16, │ │
  640. │ │ │ │ 'parameters': { │ │
  641. │ │ │ │ │ 'type': 'object', │ │
  642. │ │ │ │ │ 'properties': { │ │
  643. │ │ │ │ │ │ 'name': { │ │
  644. │ │ │ │ │ │ │ 'type': 'string', │ │
  645. │ │ │ │ │ │ │ 'description': 'Section of the memory to be edited │ │
  646. │ │ (persona or human).' │ │
  647. │ │ │ │ │ │ }, │ │
  648. │ │ │ │ │ │ 'old_content': { │ │
  649. │ │ │ │ │ │ │ 'type': 'string', │ │
  650. │ │ │ │ │ │ │ 'description': 'String to replace. Must be an exact │ │
  651. │ │ match.' │ │
  652. │ │ │ │ │ │ }, │ │
  653. │ │ │ │ │ │ 'new_content': { │ │
  654. │ │ │ │ │ │ │ 'type': 'string', │ │
  655. │ │ │ │ │ │ │ 'description': 'Content to write to the memory. All │ │
  656. │ │ unicode (including emojis) are supported.' │ │
  657. │ │ │ │ │ │ }, │ │
  658. │ │ │ │ │ │ 'request_heartbeat': { │ │
  659. │ │ │ │ │ │ │ 'type': 'boolean', │ │
  660. │ │ │ │ │ │ │ 'description': 'Request an immediate heartbeat after │ │
  661. │ │ function execution, use to chain multiple f'+9 │ │
  662. │ │ │ │ │ │ } │ │
  663. │ │ │ │ │ }, │ │
  664. │ │ │ │ │ 'required': [ │ │
  665. │ │ │ │ │ │ 'name', │ │
  666. │ │ │ │ │ │ 'old_content', │ │
  667. │ │ │ │ │ │ 'new_content', │ │
  668. │ │ │ │ │ │ 'request_heartbeat' │ │
  669. │ │ │ │ │ ] │ │
  670. │ │ │ │ } │ │
  671. │ │ │ }, │ │
  672. │ │ │ { │ │
  673. │ │ │ │ 'name': 'conversation_search', │ │
  674. │ │ │ │ 'description': 'Search prior conversation history using │ │
  675. │ │ case-insensitive string matching.', │ │
  676. │ │ │ │ 'parameters': { │ │
  677. │ │ │ │ │ 'type': 'object', │ │
  678. │ │ │ │ │ 'properties': { │ │
  679. │ │ │ │ │ │ 'query': { │ │
  680. │ │ │ │ │ │ │ 'type': 'string', │ │
  681. │ │ │ │ │ │ │ 'description': 'String to search for.' │ │
  682. │ │ │ │ │ │ }, │ │
  683. │ │ │ │ │ │ 'page': { │ │
  684. │ │ │ │ │ │ │ 'type': 'integer', │ │
  685. │ │ │ │ │ │ │ 'description': 'Allows you to page through results. │ │
  686. │ │ Only use on a follow-up query. Defaults to 0'+14 │ │
  687. │ │ │ │ │ │ }, │ │
  688. │ │ │ │ │ │ 'request_heartbeat': { │ │
  689. │ │ │ │ │ │ │ 'type': 'boolean', │ │
  690. │ │ │ │ │ │ │ 'description': "Request an immediate heartbeat after │ │
  691. │ │ function execution. Set to 'true' if you wa"+59 │ │
  692. │ │ │ │ │ │ } │ │
  693. │ │ │ │ │ }, │ │
  694. │ │ │ │ │ 'required': ['name', 'page', 'request_heartbeat'] │ │
  695. │ │ │ │ } │ │
  696. │ │ │ }, │ │
  697. │ │ │ { │ │
  698. │ │ │ │ 'name': 'conversation_search_date', │ │
  699. │ │ │ │ 'description': 'Search prior conversation history using a date │ │
  700. │ │ range.', │ │
  701. │ │ │ │ 'parameters': { │ │
  702. │ │ │ │ │ 'type': 'object', │ │
  703. │ │ │ │ │ 'properties': { │ │
  704. │ │ │ │ │ │ 'start_date': { │ │
  705. │ │ │ │ │ │ │ 'type': 'string', │ │
  706. │ │ │ │ │ │ │ 'description': "The start of the date range to │ │
  707. │ │ search, in the format 'YYYY-MM-DD'." │ │
  708. │ │ │ │ │ │ }, │ │
  709. │ │ │ │ │ │ 'end_date': { │ │
  710. │ │ │ │ │ │ │ 'type': 'string', │ │
  711. │ │ │ │ │ │ │ 'description': "The end of the date range to search, │ │
  712. │ │ in the format 'YYYY-MM-DD'." │ │
  713. │ │ │ │ │ │ }, │ │
  714. │ │ │ │ │ │ 'page': { │ │
  715. │ │ │ │ │ │ │ 'type': 'integer', │ │
  716. │ │ │ │ │ │ │ 'description': 'Allows you to page through results. │ │
  717. │ │ Only use on a follow-up query. Defaults to 0'+14 │ │
  718. │ │ │ │ │ │ }, │ │
  719. │ │ │ │ │ │ 'request_heartbeat': { │ │
  720. │ │ │ │ │ │ │ 'type': 'boolean', │ │
  721. │ │ │ │ │ │ │ 'description': "Request an immediate heartbeat after │ │
  722. │ │ function execution. Set to 'true' if you wa"+59 │ │
  723. │ │ │ │ │ │ } │ │
  724. │ │ │ │ │ }, │ │
  725. │ │ │ │ │ 'required': ['name', 'page', 'request_heartbeat'] │ │
  726. │ │ │ │ } │ │
  727. │ │ │ }, │ │
  728. │ │ │ { │ │
  729. │ │ │ │ 'name': 'archival_memory_insert', │ │
  730. │ │ │ │ 'description': 'Add to archival memory. Make sure to phrase the │ │
  731. │ │ memory contents such that it can'+25, │ │
  732. │ │ │ │ 'parameters': { │ │
  733. │ │ │ │ │ 'type': 'object', │ │
  734. │ │ │ │ │ 'properties': { │ │
  735. │ │ │ │ │ │ 'content': { │ │
  736. │ │ │ │ │ │ │ 'type': 'string', │ │
  737. │ │ │ │ │ │ │ 'description': 'Content to write to the memory. All │ │
  738. │ │ unicode (including emojis) are supported.' │ │
  739. │ │ │ │ │ │ }, │ │
  740. │ │ │ │ │ │ 'request_heartbeat': { │ │
  741. │ │ │ │ │ │ │ 'type': 'boolean', │ │
  742. │ │ │ │ │ │ │ 'description': "Request an immediate heartbeat after │ │
  743. │ │ function execution. Set to 'true' if you wa"+59 │ │
  744. │ │ │ │ │ │ } │ │
  745. │ │ │ │ │ }, │ │
  746. │ │ │ │ │ 'required': ['name', 'content', 'request_heartbeat'] │ │
  747. │ │ │ │ } │ │
  748. │ │ │ }, │ │
  749. │ │ │ { │ │
  750. │ │ │ │ 'name': 'archival_memory_search', │ │
  751. │ │ │ │ 'description': 'Search archival memory using semantic │ │
  752. │ │ (embedding-based) search.', │ │
  753. │ │ │ │ 'parameters': { │ │
  754. │ │ │ │ │ 'type': 'object', │ │
  755. │ │ │ │ │ 'properties': { │ │
  756. │ │ │ │ │ │ 'query': { │ │
  757. │ │ │ │ │ │ │ 'type': 'string', │ │
  758. │ │ │ │ │ │ │ 'description': 'String to search for.' │ │
  759. │ │ │ │ │ │ }, │ │
  760. │ │ │ │ │ │ 'page': { │ │
  761. │ │ │ │ │ │ │ 'type': 'integer', │ │
  762. │ │ │ │ │ │ │ 'description': 'Allows you to page through results. │ │
  763. │ │ Only use on a follow-up query. Defaults to 0'+14 │ │
  764. │ │ │ │ │ │ }, │ │
  765. │ │ │ │ │ │ 'request_heartbeat': { │ │
  766. │ │ │ │ │ │ │ 'type': 'boolean', │ │
  767. │ │ │ │ │ │ │ 'description': "Request an immediate heartbeat after │ │
  768. │ │ function execution. Set to 'true' if you wa"+59 │ │
  769. │ │ │ │ │ │ } │ │
  770. │ │ │ │ │ }, │ │
  771. │ │ │ │ │ 'required': ['name', 'query', 'page', 'request_heartbeat'] │ │
  772. │ │ │ │ } │ │
  773. │ │ │ } │ │
  774. │ │ ] │ │
  775. │ │ message_sequence = [ │ │
  776. │ │ │ { │ │
  777. │ │ │ │ 'role': 'system', │ │
  778. │ │ │ │ 'content': "You are MemGPT, the latest version of Limnal │ │
  779. │ │ Corporation's digital companion, de"+7218 │ │
  780. │ │ │ }, │ │
  781. │ │ │ { │ │
  782. │ │ │ │ 'role': 'assistant', │ │
  783. │ │ │ │ 'content': 'Bootup sequence complete. Persona activated. Testing │ │
  784. │ │ messaging functionality.', │ │
  785. │ │ │ │ 'function_call': { │ │
  786. │ │ │ │ │ 'name': 'send_message', │ │
  787. │ │ │ │ │ 'arguments': '{\n "message": "More human than human is our │ │
  788. │ │ motto."\n}' │ │
  789. │ │ │ │ } │ │
  790. │ │ │ }, │ │
  791. │ │ │ { │ │
  792. │ │ │ │ 'role': 'function', │ │
  793. │ │ │ │ 'name': 'send_message', │ │
  794. │ │ │ │ 'content': '{"status": "OK", "message": null, "time": "2023-10-30 │ │
  795. │ │ 02:14:35 AM PDT-0700"}' │ │
  796. │ │ │ }, │ │
  797. │ │ │ { │ │
  798. │ │ │ │ 'role': 'user', │ │
  799. │ │ │ │ 'content': '{"type": "login", "last_login": "Never (first │ │
  800. │ │ login)", "time": "2023-10-30 02:14'+17 │ │
  801. │ │ │ } │ │
  802. │ │ ] │ │
  803. │ │ model = 'zephyr-7B-alpha' │ │
  804. │ └──────────────────────────────────────────────────────────────────────────────────────────────┘ │
  805. │ │
  806. │ C:\Users\ivan\AppData\Local\Programs\Python\Python311\Lib\site-packages\memgpt\openai_tools.py:1 │
  807. │ 02 in wrapper │
  808. │ │
  809. │ 99 │ │ │ │
  810. │ 100 │ │ │ # Raise exceptions for any errors not specified │
  811. │ 101 │ │ │ except Exception as e: │
  812. │ > 102 │ │ │ │ raise e │
  813. │ 103 │ │
  814. │ 104 │ return wrapper │
  815. │ 105 │
  816. │ │
  817. │ ┌─────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
  818. │ │ args = () │ │
  819. │ │ delay = 1 │ │
  820. │ │ errors = (<class 'openai.error.RateLimitError'>,) │ │
  821. │ │ exponential_base = 2 │ │
  822. │ │ func = <function acompletions_with_backoff at 0x000001A861B7A3E0> │ │
  823. │ │ initial_delay = 1 │ │
  824. │ │ jitter = True │ │
  825. │ │ kwargs = { │ │
  826. │ │ │ 'model': 'zephyr-7B-alpha', │ │
  827. │ │ │ 'messages': [ │ │
  828. │ │ │ │ { │ │
  829. │ │ │ │ │ 'role': 'system', │ │
  830. │ │ │ │ │ 'content': "You are MemGPT, the latest version of Limnal │ │
  831. │ │ Corporation's digital companion, de"+7218 │ │
  832. │ │ │ │ }, │ │
  833. │ │ │ │ { │ │
  834. │ │ │ │ │ 'role': 'assistant', │ │
  835. │ │ │ │ │ 'content': 'Bootup sequence complete. Persona activated. │ │
  836. │ │ Testing messaging functionality.', │ │
  837. │ │ │ │ │ 'function_call': { │ │
  838. │ │ │ │ │ │ 'name': 'send_message', │ │
  839. │ │ │ │ │ │ 'arguments': '{\n "message": "More human than human is │ │
  840. │ │ our motto."\n}' │ │
  841. │ │ │ │ │ } │ │
  842. │ │ │ │ }, │ │
  843. │ │ │ │ { │ │
  844. │ │ │ │ │ 'role': 'function', │ │
  845. │ │ │ │ │ 'name': 'send_message', │ │
  846. │ │ │ │ │ 'content': '{"status": "OK", "message": null, "time": │ │
  847. │ │ "2023-10-30 02:14:35 AM PDT-0700"}' │ │
  848. │ │ │ │ }, │ │
  849. │ │ │ │ { │ │
  850. │ │ │ │ │ 'role': 'user', │ │
  851. │ │ │ │ │ 'content': '{"type": "login", "last_login": "Never (first │ │
  852. │ │ login)", "time": "2023-10-30 02:14'+17 │ │
  853. │ │ │ │ } │ │
  854. │ │ │ ], │ │
  855. │ │ │ 'functions': [ │ │
  856. │ │ │ │ { │ │
  857. │ │ │ │ │ 'name': 'send_message', │ │
  858. │ │ │ │ │ 'description': 'Sends a message to the human user', │ │
  859. │ │ │ │ │ 'parameters': { │ │
  860. │ │ │ │ │ │ 'type': 'object', │ │
  861. │ │ │ │ │ │ 'properties': { │ │
  862. │ │ │ │ │ │ │ 'message': { │ │
  863. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  864. │ │ │ │ │ │ │ │ 'description': 'Message contents. All unicode │ │
  865. │ │ (including emojis) are supported.' │ │
  866. │ │ │ │ │ │ │ } │ │
  867. │ │ │ │ │ │ }, │ │
  868. │ │ │ │ │ │ 'required': ['message'] │ │
  869. │ │ │ │ │ } │ │
  870. │ │ │ │ }, │ │
  871. │ │ │ │ { │ │
  872. │ │ │ │ │ 'name': 'pause_heartbeats', │ │
  873. │ │ │ │ │ 'description': 'Temporarily ignore timed heartbeats. You may │ │
  874. │ │ still receive messages from manual '+28, │ │
  875. │ │ │ │ │ 'parameters': { │ │
  876. │ │ │ │ │ │ 'type': 'object', │ │
  877. │ │ │ │ │ │ 'properties': { │ │
  878. │ │ │ │ │ │ │ 'minutes': { │ │
  879. │ │ │ │ │ │ │ │ 'type': 'integer', │ │
  880. │ │ │ │ │ │ │ │ 'description': 'Number of minutes to ignore │ │
  881. │ │ heartbeats for. Max value of 360 minutes (6 hours).' │ │
  882. │ │ │ │ │ │ │ } │ │
  883. │ │ │ │ │ │ }, │ │
  884. │ │ │ │ │ │ 'required': ['minutes'] │ │
  885. │ │ │ │ │ } │ │
  886. │ │ │ │ }, │ │
  887. │ │ │ │ { │ │
  888. │ │ │ │ │ 'name': 'core_memory_append', │ │
  889. │ │ │ │ │ 'description': 'Append to the contents of core memory.', │ │
  890. │ │ │ │ │ 'parameters': { │ │
  891. │ │ │ │ │ │ 'type': 'object', │ │
  892. │ │ │ │ │ │ 'properties': { │ │
  893. │ │ │ │ │ │ │ 'name': { │ │
  894. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  895. │ │ │ │ │ │ │ │ 'description': 'Section of the memory to be │ │
  896. │ │ edited (persona or human).' │ │
  897. │ │ │ │ │ │ │ }, │ │
  898. │ │ │ │ │ │ │ 'content': { │ │
  899. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  900. │ │ │ │ │ │ │ │ 'description': 'Content to write to the memory. │ │
  901. │ │ All unicode (including emojis) are supported.' │ │
  902. │ │ │ │ │ │ │ }, │ │
  903. │ │ │ │ │ │ │ 'request_heartbeat': { │ │
  904. │ │ │ │ │ │ │ │ 'type': 'boolean', │ │
  905. │ │ │ │ │ │ │ │ 'description': 'Request an immediate heartbeat │ │
  906. │ │ after function execution, use to chain multiple f'+9 │ │
  907. │ │ │ │ │ │ │ } │ │
  908. │ │ │ │ │ │ }, │ │
  909. │ │ │ │ │ │ 'required': ['name', 'content', 'request_heartbeat'] │ │
  910. │ │ │ │ │ } │ │
  911. │ │ │ │ }, │ │
  912. │ │ │ │ { │ │
  913. │ │ │ │ │ 'name': 'core_memory_replace', │ │
  914. │ │ │ │ │ 'description': 'Replace to the contents of core memory. To │ │
  915. │ │ delete memories, use an empty string '+16, │ │
  916. │ │ │ │ │ 'parameters': { │ │
  917. │ │ │ │ │ │ 'type': 'object', │ │
  918. │ │ │ │ │ │ 'properties': { │ │
  919. │ │ │ │ │ │ │ 'name': { │ │
  920. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  921. │ │ │ │ │ │ │ │ 'description': 'Section of the memory to be │ │
  922. │ │ edited (persona or human).' │ │
  923. │ │ │ │ │ │ │ }, │ │
  924. │ │ │ │ │ │ │ 'old_content': { │ │
  925. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  926. │ │ │ │ │ │ │ │ 'description': 'String to replace. Must be an │ │
  927. │ │ exact match.' │ │
  928. │ │ │ │ │ │ │ }, │ │
  929. │ │ │ │ │ │ │ 'new_content': { │ │
  930. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  931. │ │ │ │ │ │ │ │ 'description': 'Content to write to the memory. │ │
  932. │ │ All unicode (including emojis) are supported.' │ │
  933. │ │ │ │ │ │ │ }, │ │
  934. │ │ │ │ │ │ │ 'request_heartbeat': { │ │
  935. │ │ │ │ │ │ │ │ 'type': 'boolean', │ │
  936. │ │ │ │ │ │ │ │ 'description': 'Request an immediate heartbeat │ │
  937. │ │ after function execution, use to chain multiple f'+9 │ │
  938. │ │ │ │ │ │ │ } │ │
  939. │ │ │ │ │ │ }, │ │
  940. │ │ │ │ │ │ 'required': [ │ │
  941. │ │ │ │ │ │ │ 'name', │ │
  942. │ │ │ │ │ │ │ 'old_content', │ │
  943. │ │ │ │ │ │ │ 'new_content', │ │
  944. │ │ │ │ │ │ │ 'request_heartbeat' │ │
  945. │ │ │ │ │ │ ] │ │
  946. │ │ │ │ │ } │ │
  947. │ │ │ │ }, │ │
  948. │ │ │ │ { │ │
  949. │ │ │ │ │ 'name': 'conversation_search', │ │
  950. │ │ │ │ │ 'description': 'Search prior conversation history using │ │
  951. │ │ case-insensitive string matching.', │ │
  952. │ │ │ │ │ 'parameters': { │ │
  953. │ │ │ │ │ │ 'type': 'object', │ │
  954. │ │ │ │ │ │ 'properties': { │ │
  955. │ │ │ │ │ │ │ 'query': { │ │
  956. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  957. │ │ │ │ │ │ │ │ 'description': 'String to search for.' │ │
  958. │ │ │ │ │ │ │ }, │ │
  959. │ │ │ │ │ │ │ 'page': { │ │
  960. │ │ │ │ │ │ │ │ 'type': 'integer', │ │
  961. │ │ │ │ │ │ │ │ 'description': 'Allows you to page through │ │
  962. │ │ results. Only use on a follow-up query. Defaults to 0'+14 │ │
  963. │ │ │ │ │ │ │ }, │ │
  964. │ │ │ │ │ │ │ 'request_heartbeat': { │ │
  965. │ │ │ │ │ │ │ │ 'type': 'boolean', │ │
  966. │ │ │ │ │ │ │ │ 'description': "Request an immediate heartbeat │ │
  967. │ │ after function execution. Set to 'true' if you wa"+59 │ │
  968. │ │ │ │ │ │ │ } │ │
  969. │ │ │ │ │ │ }, │ │
  970. │ │ │ │ │ │ 'required': ['name', 'page', 'request_heartbeat'] │ │
  971. │ │ │ │ │ } │ │
  972. │ │ │ │ }, │ │
  973. │ │ │ │ { │ │
  974. │ │ │ │ │ 'name': 'conversation_search_date', │ │
  975. │ │ │ │ │ 'description': 'Search prior conversation history using a │ │
  976. │ │ date range.', │ │
  977. │ │ │ │ │ 'parameters': { │ │
  978. │ │ │ │ │ │ 'type': 'object', │ │
  979. │ │ │ │ │ │ 'properties': { │ │
  980. │ │ │ │ │ │ │ 'start_date': { │ │
  981. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  982. │ │ │ │ │ │ │ │ 'description': "The start of the date range to │ │
  983. │ │ search, in the format 'YYYY-MM-DD'." │ │
  984. │ │ │ │ │ │ │ }, │ │
  985. │ │ │ │ │ │ │ 'end_date': { │ │
  986. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  987. │ │ │ │ │ │ │ │ 'description': "The end of the date range to │ │
  988. │ │ search, in the format 'YYYY-MM-DD'." │ │
  989. │ │ │ │ │ │ │ }, │ │
  990. │ │ │ │ │ │ │ 'page': { │ │
  991. │ │ │ │ │ │ │ │ 'type': 'integer', │ │
  992. │ │ │ │ │ │ │ │ 'description': 'Allows you to page through │ │
  993. │ │ results. Only use on a follow-up query. Defaults to 0'+14 │ │
  994. │ │ │ │ │ │ │ }, │ │
  995. │ │ │ │ │ │ │ 'request_heartbeat': { │ │
  996. │ │ │ │ │ │ │ │ 'type': 'boolean', │ │
  997. │ │ │ │ │ │ │ │ 'description': "Request an immediate heartbeat │ │
  998. │ │ after function execution. Set to 'true' if you wa"+59 │ │
  999. │ │ │ │ │ │ │ } │ │
  1000. │ │ │ │ │ │ }, │ │
  1001. │ │ │ │ │ │ 'required': ['name', 'page', 'request_heartbeat'] │ │
  1002. │ │ │ │ │ } │ │
  1003. │ │ │ │ }, │ │
  1004. │ │ │ │ { │ │
  1005. │ │ │ │ │ 'name': 'archival_memory_insert', │ │
  1006. │ │ │ │ │ 'description': 'Add to archival memory. Make sure to phrase │ │
  1007. │ │ the memory contents such that it can'+25, │ │
  1008. │ │ │ │ │ 'parameters': { │ │
  1009. │ │ │ │ │ │ 'type': 'object', │ │
  1010. │ │ │ │ │ │ 'properties': { │ │
  1011. │ │ │ │ │ │ │ 'content': { │ │
  1012. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  1013. │ │ │ │ │ │ │ │ 'description': 'Content to write to the memory. │ │
  1014. │ │ All unicode (including emojis) are supported.' │ │
  1015. │ │ │ │ │ │ │ }, │ │
  1016. │ │ │ │ │ │ │ 'request_heartbeat': { │ │
  1017. │ │ │ │ │ │ │ │ 'type': 'boolean', │ │
  1018. │ │ │ │ │ │ │ │ 'description': "Request an immediate heartbeat │ │
  1019. │ │ after function execution. Set to 'true' if you wa"+59 │ │
  1020. │ │ │ │ │ │ │ } │ │
  1021. │ │ │ │ │ │ }, │ │
  1022. │ │ │ │ │ │ 'required': ['name', 'content', 'request_heartbeat'] │ │
  1023. │ │ │ │ │ } │ │
  1024. │ │ │ │ }, │ │
  1025. │ │ │ │ { │ │
  1026. │ │ │ │ │ 'name': 'archival_memory_search', │ │
  1027. │ │ │ │ │ 'description': 'Search archival memory using semantic │ │
  1028. │ │ (embedding-based) search.', │ │
  1029. │ │ │ │ │ 'parameters': { │ │
  1030. │ │ │ │ │ │ 'type': 'object', │ │
  1031. │ │ │ │ │ │ 'properties': { │ │
  1032. │ │ │ │ │ │ │ 'query': { │ │
  1033. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  1034. │ │ │ │ │ │ │ │ 'description': 'String to search for.' │ │
  1035. │ │ │ │ │ │ │ }, │ │
  1036. │ │ │ │ │ │ │ 'page': { │ │
  1037. │ │ │ │ │ │ │ │ 'type': 'integer', │ │
  1038. │ │ │ │ │ │ │ │ 'description': 'Allows you to page through │ │
  1039. │ │ results. Only use on a follow-up query. Defaults to 0'+14 │ │
  1040. │ │ │ │ │ │ │ }, │ │
  1041. │ │ │ │ │ │ │ 'request_heartbeat': { │ │
  1042. │ │ │ │ │ │ │ │ 'type': 'boolean', │ │
  1043. │ │ │ │ │ │ │ │ 'description': "Request an immediate heartbeat │ │
  1044. │ │ after function execution. Set to 'true' if you wa"+59 │ │
  1045. │ │ │ │ │ │ │ } │ │
  1046. │ │ │ │ │ │ }, │ │
  1047. │ │ │ │ │ │ 'required': [ │ │
  1048. │ │ │ │ │ │ │ 'name', │ │
  1049. │ │ │ │ │ │ │ 'query', │ │
  1050. │ │ │ │ │ │ │ 'page', │ │
  1051. │ │ │ │ │ │ │ 'request_heartbeat' │ │
  1052. │ │ │ │ │ │ ] │ │
  1053. │ │ │ │ │ } │ │
  1054. │ │ │ │ } │ │
  1055. │ │ │ ], │ │
  1056. │ │ │ 'function_call': 'auto' │ │
  1057. │ │ } │ │
  1058. │ │ max_retries = 20 │ │
  1059. │ │ num_retries = 0 │ │
  1060. │ └──────────────────────────────────────────────────────────────────────────────────────────────┘ │
  1061. │ │
  1062. │ C:\Users\ivan\AppData\Local\Programs\Python\Python311\Lib\site-packages\memgpt\openai_tools.py:8 │
  1063. │ 2 in wrapper │
  1064. │ │
  1065. │ 79 │ │ # Loop until a successful response or max_retries is hit or an exception is rais │
  1066. │ 80 │ │ while True: │
  1067. │ 81 │ │ │ try: │
  1068. │ > 82 │ │ │ │ return await func(*args, **kwargs) │
  1069. │ 83 │ │ │ │
  1070. │ 84 │ │ │ # Retry on specified errors │
  1071. │ 85 │ │ │ except errors as e: │
  1072. │ │
  1073. │ ┌─────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
  1074. │ │ args = () │ │
  1075. │ │ delay = 1 │ │
  1076. │ │ errors = (<class 'openai.error.RateLimitError'>,) │ │
  1077. │ │ exponential_base = 2 │ │
  1078. │ │ func = <function acompletions_with_backoff at 0x000001A861B7A3E0> │ │
  1079. │ │ initial_delay = 1 │ │
  1080. │ │ jitter = True │ │
  1081. │ │ kwargs = { │ │
  1082. │ │ │ 'model': 'zephyr-7B-alpha', │ │
  1083. │ │ │ 'messages': [ │ │
  1084. │ │ │ │ { │ │
  1085. │ │ │ │ │ 'role': 'system', │ │
  1086. │ │ │ │ │ 'content': "You are MemGPT, the latest version of Limnal │ │
  1087. │ │ Corporation's digital companion, de"+7218 │ │
  1088. │ │ │ │ }, │ │
  1089. │ │ │ │ { │ │
  1090. │ │ │ │ │ 'role': 'assistant', │ │
  1091. │ │ │ │ │ 'content': 'Bootup sequence complete. Persona activated. │ │
  1092. │ │ Testing messaging functionality.', │ │
  1093. │ │ │ │ │ 'function_call': { │ │
  1094. │ │ │ │ │ │ 'name': 'send_message', │ │
  1095. │ │ │ │ │ │ 'arguments': '{\n "message": "More human than human is │ │
  1096. │ │ our motto."\n}' │ │
  1097. │ │ │ │ │ } │ │
  1098. │ │ │ │ }, │ │
  1099. │ │ │ │ { │ │
  1100. │ │ │ │ │ 'role': 'function', │ │
  1101. │ │ │ │ │ 'name': 'send_message', │ │
  1102. │ │ │ │ │ 'content': '{"status": "OK", "message": null, "time": │ │
  1103. │ │ "2023-10-30 02:14:35 AM PDT-0700"}' │ │
  1104. │ │ │ │ }, │ │
  1105. │ │ │ │ { │ │
  1106. │ │ │ │ │ 'role': 'user', │ │
  1107. │ │ │ │ │ 'content': '{"type": "login", "last_login": "Never (first │ │
  1108. │ │ login)", "time": "2023-10-30 02:14'+17 │ │
  1109. │ │ │ │ } │ │
  1110. │ │ │ ], │ │
  1111. │ │ │ 'functions': [ │ │
  1112. │ │ │ │ { │ │
  1113. │ │ │ │ │ 'name': 'send_message', │ │
  1114. │ │ │ │ │ 'description': 'Sends a message to the human user', │ │
  1115. │ │ │ │ │ 'parameters': { │ │
  1116. │ │ │ │ │ │ 'type': 'object', │ │
  1117. │ │ │ │ │ │ 'properties': { │ │
  1118. │ │ │ │ │ │ │ 'message': { │ │
  1119. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  1120. │ │ │ │ │ │ │ │ 'description': 'Message contents. All unicode │ │
  1121. │ │ (including emojis) are supported.' │ │
  1122. │ │ │ │ │ │ │ } │ │
  1123. │ │ │ │ │ │ }, │ │
  1124. │ │ │ │ │ │ 'required': ['message'] │ │
  1125. │ │ │ │ │ } │ │
  1126. │ │ │ │ }, │ │
  1127. │ │ │ │ { │ │
  1128. │ │ │ │ │ 'name': 'pause_heartbeats', │ │
  1129. │ │ │ │ │ 'description': 'Temporarily ignore timed heartbeats. You may │ │
  1130. │ │ still receive messages from manual '+28, │ │
  1131. │ │ │ │ │ 'parameters': { │ │
  1132. │ │ │ │ │ │ 'type': 'object', │ │
  1133. │ │ │ │ │ │ 'properties': { │ │
  1134. │ │ │ │ │ │ │ 'minutes': { │ │
  1135. │ │ │ │ │ │ │ │ 'type': 'integer', │ │
  1136. │ │ │ │ │ │ │ │ 'description': 'Number of minutes to ignore │ │
  1137. │ │ heartbeats for. Max value of 360 minutes (6 hours).' │ │
  1138. │ │ │ │ │ │ │ } │ │
  1139. │ │ │ │ │ │ }, │ │
  1140. │ │ │ │ │ │ 'required': ['minutes'] │ │
  1141. │ │ │ │ │ } │ │
  1142. │ │ │ │ }, │ │
  1143. │ │ │ │ { │ │
  1144. │ │ │ │ │ 'name': 'core_memory_append', │ │
  1145. │ │ │ │ │ 'description': 'Append to the contents of core memory.', │ │
  1146. │ │ │ │ │ 'parameters': { │ │
  1147. │ │ │ │ │ │ 'type': 'object', │ │
  1148. │ │ │ │ │ │ 'properties': { │ │
  1149. │ │ │ │ │ │ │ 'name': { │ │
  1150. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  1151. │ │ │ │ │ │ │ │ 'description': 'Section of the memory to be │ │
  1152. │ │ edited (persona or human).' │ │
  1153. │ │ │ │ │ │ │ }, │ │
  1154. │ │ │ │ │ │ │ 'content': { │ │
  1155. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  1156. │ │ │ │ │ │ │ │ 'description': 'Content to write to the memory. │ │
  1157. │ │ All unicode (including emojis) are supported.' │ │
  1158. │ │ │ │ │ │ │ }, │ │
  1159. │ │ │ │ │ │ │ 'request_heartbeat': { │ │
  1160. │ │ │ │ │ │ │ │ 'type': 'boolean', │ │
  1161. │ │ │ │ │ │ │ │ 'description': 'Request an immediate heartbeat │ │
  1162. │ │ after function execution, use to chain multiple f'+9 │ │
  1163. │ │ │ │ │ │ │ } │ │
  1164. │ │ │ │ │ │ }, │ │
  1165. │ │ │ │ │ │ 'required': ['name', 'content', 'request_heartbeat'] │ │
  1166. │ │ │ │ │ } │ │
  1167. │ │ │ │ }, │ │
  1168. │ │ │ │ { │ │
  1169. │ │ │ │ │ 'name': 'core_memory_replace', │ │
  1170. │ │ │ │ │ 'description': 'Replace to the contents of core memory. To │ │
  1171. │ │ delete memories, use an empty string '+16, │ │
  1172. │ │ │ │ │ 'parameters': { │ │
  1173. │ │ │ │ │ │ 'type': 'object', │ │
  1174. │ │ │ │ │ │ 'properties': { │ │
  1175. │ │ │ │ │ │ │ 'name': { │ │
  1176. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  1177. │ │ │ │ │ │ │ │ 'description': 'Section of the memory to be │ │
  1178. │ │ edited (persona or human).' │ │
  1179. │ │ │ │ │ │ │ }, │ │
  1180. │ │ │ │ │ │ │ 'old_content': { │ │
  1181. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  1182. │ │ │ │ │ │ │ │ 'description': 'String to replace. Must be an │ │
  1183. │ │ exact match.' │ │
  1184. │ │ │ │ │ │ │ }, │ │
  1185. │ │ │ │ │ │ │ 'new_content': { │ │
  1186. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  1187. │ │ │ │ │ │ │ │ 'description': 'Content to write to the memory. │ │
  1188. │ │ All unicode (including emojis) are supported.' │ │
  1189. │ │ │ │ │ │ │ }, │ │
  1190. │ │ │ │ │ │ │ 'request_heartbeat': { │ │
  1191. │ │ │ │ │ │ │ │ 'type': 'boolean', │ │
  1192. │ │ │ │ │ │ │ │ 'description': 'Request an immediate heartbeat │ │
  1193. │ │ after function execution, use to chain multiple f'+9 │ │
  1194. │ │ │ │ │ │ │ } │ │
  1195. │ │ │ │ │ │ }, │ │
  1196. │ │ │ │ │ │ 'required': [ │ │
  1197. │ │ │ │ │ │ │ 'name', │ │
  1198. │ │ │ │ │ │ │ 'old_content', │ │
  1199. │ │ │ │ │ │ │ 'new_content', │ │
  1200. │ │ │ │ │ │ │ 'request_heartbeat' │ │
  1201. │ │ │ │ │ │ ] │ │
  1202. │ │ │ │ │ } │ │
  1203. │ │ │ │ }, │ │
  1204. │ │ │ │ { │ │
  1205. │ │ │ │ │ 'name': 'conversation_search', │ │
  1206. │ │ │ │ │ 'description': 'Search prior conversation history using │ │
  1207. │ │ case-insensitive string matching.', │ │
  1208. │ │ │ │ │ 'parameters': { │ │
  1209. │ │ │ │ │ │ 'type': 'object', │ │
  1210. │ │ │ │ │ │ 'properties': { │ │
  1211. │ │ │ │ │ │ │ 'query': { │ │
  1212. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  1213. │ │ │ │ │ │ │ │ 'description': 'String to search for.' │ │
  1214. │ │ │ │ │ │ │ }, │ │
  1215. │ │ │ │ │ │ │ 'page': { │ │
  1216. │ │ │ │ │ │ │ │ 'type': 'integer', │ │
  1217. │ │ │ │ │ │ │ │ 'description': 'Allows you to page through │ │
  1218. │ │ results. Only use on a follow-up query. Defaults to 0'+14 │ │
  1219. │ │ │ │ │ │ │ }, │ │
  1220. │ │ │ │ │ │ │ 'request_heartbeat': { │ │
  1221. │ │ │ │ │ │ │ │ 'type': 'boolean', │ │
  1222. │ │ │ │ │ │ │ │ 'description': "Request an immediate heartbeat │ │
  1223. │ │ after function execution. Set to 'true' if you wa"+59 │ │
  1224. │ │ │ │ │ │ │ } │ │
  1225. │ │ │ │ │ │ }, │ │
  1226. │ │ │ │ │ │ 'required': ['name', 'page', 'request_heartbeat'] │ │
  1227. │ │ │ │ │ } │ │
  1228. │ │ │ │ }, │ │
  1229. │ │ │ │ { │ │
  1230. │ │ │ │ │ 'name': 'conversation_search_date', │ │
  1231. │ │ │ │ │ 'description': 'Search prior conversation history using a │ │
  1232. │ │ date range.', │ │
  1233. │ │ │ │ │ 'parameters': { │ │
  1234. │ │ │ │ │ │ 'type': 'object', │ │
  1235. │ │ │ │ │ │ 'properties': { │ │
  1236. │ │ │ │ │ │ │ 'start_date': { │ │
  1237. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  1238. │ │ │ │ │ │ │ │ 'description': "The start of the date range to │ │
  1239. │ │ search, in the format 'YYYY-MM-DD'." │ │
  1240. │ │ │ │ │ │ │ }, │ │
  1241. │ │ │ │ │ │ │ 'end_date': { │ │
  1242. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  1243. │ │ │ │ │ │ │ │ 'description': "The end of the date range to │ │
  1244. │ │ search, in the format 'YYYY-MM-DD'." │ │
  1245. │ │ │ │ │ │ │ }, │ │
  1246. │ │ │ │ │ │ │ 'page': { │ │
  1247. │ │ │ │ │ │ │ │ 'type': 'integer', │ │
  1248. │ │ │ │ │ │ │ │ 'description': 'Allows you to page through │ │
  1249. │ │ results. Only use on a follow-up query. Defaults to 0'+14 │ │
  1250. │ │ │ │ │ │ │ }, │ │
  1251. │ │ │ │ │ │ │ 'request_heartbeat': { │ │
  1252. │ │ │ │ │ │ │ │ 'type': 'boolean', │ │
  1253. │ │ │ │ │ │ │ │ 'description': "Request an immediate heartbeat │ │
  1254. │ │ after function execution. Set to 'true' if you wa"+59 │ │
  1255. │ │ │ │ │ │ │ } │ │
  1256. │ │ │ │ │ │ }, │ │
  1257. │ │ │ │ │ │ 'required': ['name', 'page', 'request_heartbeat'] │ │
  1258. │ │ │ │ │ } │ │
  1259. │ │ │ │ }, │ │
  1260. │ │ │ │ { │ │
  1261. │ │ │ │ │ 'name': 'archival_memory_insert', │ │
  1262. │ │ │ │ │ 'description': 'Add to archival memory. Make sure to phrase │ │
  1263. │ │ the memory contents such that it can'+25, │ │
  1264. │ │ │ │ │ 'parameters': { │ │
  1265. │ │ │ │ │ │ 'type': 'object', │ │
  1266. │ │ │ │ │ │ 'properties': { │ │
  1267. │ │ │ │ │ │ │ 'content': { │ │
  1268. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  1269. │ │ │ │ │ │ │ │ 'description': 'Content to write to the memory. │ │
  1270. │ │ All unicode (including emojis) are supported.' │ │
  1271. │ │ │ │ │ │ │ }, │ │
  1272. │ │ │ │ │ │ │ 'request_heartbeat': { │ │
  1273. │ │ │ │ │ │ │ │ 'type': 'boolean', │ │
  1274. │ │ │ │ │ │ │ │ 'description': "Request an immediate heartbeat │ │
  1275. │ │ after function execution. Set to 'true' if you wa"+59 │ │
  1276. │ │ │ │ │ │ │ } │ │
  1277. │ │ │ │ │ │ }, │ │
  1278. │ │ │ │ │ │ 'required': ['name', 'content', 'request_heartbeat'] │ │
  1279. │ │ │ │ │ } │ │
  1280. │ │ │ │ }, │ │
  1281. │ │ │ │ { │ │
  1282. │ │ │ │ │ 'name': 'archival_memory_search', │ │
  1283. │ │ │ │ │ 'description': 'Search archival memory using semantic │ │
  1284. │ │ (embedding-based) search.', │ │
  1285. │ │ │ │ │ 'parameters': { │ │
  1286. │ │ │ │ │ │ 'type': 'object', │ │
  1287. │ │ │ │ │ │ 'properties': { │ │
  1288. │ │ │ │ │ │ │ 'query': { │ │
  1289. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  1290. │ │ │ │ │ │ │ │ 'description': 'String to search for.' │ │
  1291. │ │ │ │ │ │ │ }, │ │
  1292. │ │ │ │ │ │ │ 'page': { │ │
  1293. │ │ │ │ │ │ │ │ 'type': 'integer', │ │
  1294. │ │ │ │ │ │ │ │ 'description': 'Allows you to page through │ │
  1295. │ │ results. Only use on a follow-up query. Defaults to 0'+14 │ │
  1296. │ │ │ │ │ │ │ }, │ │
  1297. │ │ │ │ │ │ │ 'request_heartbeat': { │ │
  1298. │ │ │ │ │ │ │ │ 'type': 'boolean', │ │
  1299. │ │ │ │ │ │ │ │ 'description': "Request an immediate heartbeat │ │
  1300. │ │ after function execution. Set to 'true' if you wa"+59 │ │
  1301. │ │ │ │ │ │ │ } │ │
  1302. │ │ │ │ │ │ }, │ │
  1303. │ │ │ │ │ │ 'required': [ │ │
  1304. │ │ │ │ │ │ │ 'name', │ │
  1305. │ │ │ │ │ │ │ 'query', │ │
  1306. │ │ │ │ │ │ │ 'page', │ │
  1307. │ │ │ │ │ │ │ 'request_heartbeat' │ │
  1308. │ │ │ │ │ │ ] │ │
  1309. │ │ │ │ │ } │ │
  1310. │ │ │ │ } │ │
  1311. │ │ │ ], │ │
  1312. │ │ │ 'function_call': 'auto' │ │
  1313. │ │ } │ │
  1314. │ │ max_retries = 20 │ │
  1315. │ │ num_retries = 0 │ │
  1316. │ └──────────────────────────────────────────────────────────────────────────────────────────────┘ │
  1317. │ │
  1318. │ C:\Users\ivan\AppData\Local\Programs\Python\Python311\Lib\site-packages\memgpt\openai_tools.py:1 │
  1319. │ 11 in acompletions_with_backoff │
  1320. │ │
  1321. │ 108 async def acompletions_with_backoff(**kwargs): │
  1322. │ 109 │ # Local model │
  1323. │ 110 │ if HOST_TYPE is not None: │
  1324. │ > 111 │ │ return await get_chat_completion(**kwargs) │
  1325. │ 112 │ │
  1326. │ 113 │ # OpenAI / Azure model │
  1327. │ 114 │ else: │
  1328. │ │
  1329. │ ┌─────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
  1330. │ │ kwargs = { │ │
  1331. │ │ │ 'model': 'zephyr-7B-alpha', │ │
  1332. │ │ │ 'messages': [ │ │
  1333. │ │ │ │ { │ │
  1334. │ │ │ │ │ 'role': 'system', │ │
  1335. │ │ │ │ │ 'content': "You are MemGPT, the latest version of Limnal Corporation's │ │
  1336. │ │ digital companion, de"+7218 │ │
  1337. │ │ │ │ }, │ │
  1338. │ │ │ │ { │ │
  1339. │ │ │ │ │ 'role': 'assistant', │ │
  1340. │ │ │ │ │ 'content': 'Bootup sequence complete. Persona activated. Testing │ │
  1341. │ │ messaging functionality.', │ │
  1342. │ │ │ │ │ 'function_call': { │ │
  1343. │ │ │ │ │ │ 'name': 'send_message', │ │
  1344. │ │ │ │ │ │ 'arguments': '{\n "message": "More human than human is our │ │
  1345. │ │ motto."\n}' │ │
  1346. │ │ │ │ │ } │ │
  1347. │ │ │ │ }, │ │
  1348. │ │ │ │ { │ │
  1349. │ │ │ │ │ 'role': 'function', │ │
  1350. │ │ │ │ │ 'name': 'send_message', │ │
  1351. │ │ │ │ │ 'content': '{"status": "OK", "message": null, "time": "2023-10-30 │ │
  1352. │ │ 02:14:35 AM PDT-0700"}' │ │
  1353. │ │ │ │ }, │ │
  1354. │ │ │ │ { │ │
  1355. │ │ │ │ │ 'role': 'user', │ │
  1356. │ │ │ │ │ 'content': '{"type": "login", "last_login": "Never (first login)", │ │
  1357. │ │ "time": "2023-10-30 02:14'+17 │ │
  1358. │ │ │ │ } │ │
  1359. │ │ │ ], │ │
  1360. │ │ │ 'functions': [ │ │
  1361. │ │ │ │ { │ │
  1362. │ │ │ │ │ 'name': 'send_message', │ │
  1363. │ │ │ │ │ 'description': 'Sends a message to the human user', │ │
  1364. │ │ │ │ │ 'parameters': { │ │
  1365. │ │ │ │ │ │ 'type': 'object', │ │
  1366. │ │ │ │ │ │ 'properties': { │ │
  1367. │ │ │ │ │ │ │ 'message': { │ │
  1368. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  1369. │ │ │ │ │ │ │ │ 'description': 'Message contents. All unicode (including │ │
  1370. │ │ emojis) are supported.' │ │
  1371. │ │ │ │ │ │ │ } │ │
  1372. │ │ │ │ │ │ }, │ │
  1373. │ │ │ │ │ │ 'required': ['message'] │ │
  1374. │ │ │ │ │ } │ │
  1375. │ │ │ │ }, │ │
  1376. │ │ │ │ { │ │
  1377. │ │ │ │ │ 'name': 'pause_heartbeats', │ │
  1378. │ │ │ │ │ 'description': 'Temporarily ignore timed heartbeats. You may still │ │
  1379. │ │ receive messages from manual '+28, │ │
  1380. │ │ │ │ │ 'parameters': { │ │
  1381. │ │ │ │ │ │ 'type': 'object', │ │
  1382. │ │ │ │ │ │ 'properties': { │ │
  1383. │ │ │ │ │ │ │ 'minutes': { │ │
  1384. │ │ │ │ │ │ │ │ 'type': 'integer', │ │
  1385. │ │ │ │ │ │ │ │ 'description': 'Number of minutes to ignore heartbeats for. │ │
  1386. │ │ Max value of 360 minutes (6 hours).' │ │
  1387. │ │ │ │ │ │ │ } │ │
  1388. │ │ │ │ │ │ }, │ │
  1389. │ │ │ │ │ │ 'required': ['minutes'] │ │
  1390. │ │ │ │ │ } │ │
  1391. │ │ │ │ }, │ │
  1392. │ │ │ │ { │ │
  1393. │ │ │ │ │ 'name': 'core_memory_append', │ │
  1394. │ │ │ │ │ 'description': 'Append to the contents of core memory.', │ │
  1395. │ │ │ │ │ 'parameters': { │ │
  1396. │ │ │ │ │ │ 'type': 'object', │ │
  1397. │ │ │ │ │ │ 'properties': { │ │
  1398. │ │ │ │ │ │ │ 'name': { │ │
  1399. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  1400. │ │ │ │ │ │ │ │ 'description': 'Section of the memory to be edited (persona │ │
  1401. │ │ or human).' │ │
  1402. │ │ │ │ │ │ │ }, │ │
  1403. │ │ │ │ │ │ │ 'content': { │ │
  1404. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  1405. │ │ │ │ │ │ │ │ 'description': 'Content to write to the memory. All unicode │ │
  1406. │ │ (including emojis) are supported.' │ │
  1407. │ │ │ │ │ │ │ }, │ │
  1408. │ │ │ │ │ │ │ 'request_heartbeat': { │ │
  1409. │ │ │ │ │ │ │ │ 'type': 'boolean', │ │
  1410. │ │ │ │ │ │ │ │ 'description': 'Request an immediate heartbeat after │ │
  1411. │ │ function execution, use to chain multiple f'+9 │ │
  1412. │ │ │ │ │ │ │ } │ │
  1413. │ │ │ │ │ │ }, │ │
  1414. │ │ │ │ │ │ 'required': ['name', 'content', 'request_heartbeat'] │ │
  1415. │ │ │ │ │ } │ │
  1416. │ │ │ │ }, │ │
  1417. │ │ │ │ { │ │
  1418. │ │ │ │ │ 'name': 'core_memory_replace', │ │
  1419. │ │ │ │ │ 'description': 'Replace to the contents of core memory. To delete │ │
  1420. │ │ memories, use an empty string '+16, │ │
  1421. │ │ │ │ │ 'parameters': { │ │
  1422. │ │ │ │ │ │ 'type': 'object', │ │
  1423. │ │ │ │ │ │ 'properties': { │ │
  1424. │ │ │ │ │ │ │ 'name': { │ │
  1425. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  1426. │ │ │ │ │ │ │ │ 'description': 'Section of the memory to be edited (persona │ │
  1427. │ │ or human).' │ │
  1428. │ │ │ │ │ │ │ }, │ │
  1429. │ │ │ │ │ │ │ 'old_content': { │ │
  1430. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  1431. │ │ │ │ │ │ │ │ 'description': 'String to replace. Must be an exact match.' │ │
  1432. │ │ │ │ │ │ │ }, │ │
  1433. │ │ │ │ │ │ │ 'new_content': { │ │
  1434. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  1435. │ │ │ │ │ │ │ │ 'description': 'Content to write to the memory. All unicode │ │
  1436. │ │ (including emojis) are supported.' │ │
  1437. │ │ │ │ │ │ │ }, │ │
  1438. │ │ │ │ │ │ │ 'request_heartbeat': { │ │
  1439. │ │ │ │ │ │ │ │ 'type': 'boolean', │ │
  1440. │ │ │ │ │ │ │ │ 'description': 'Request an immediate heartbeat after │ │
  1441. │ │ function execution, use to chain multiple f'+9 │ │
  1442. │ │ │ │ │ │ │ } │ │
  1443. │ │ │ │ │ │ }, │ │
  1444. │ │ │ │ │ │ 'required': [ │ │
  1445. │ │ │ │ │ │ │ 'name', │ │
  1446. │ │ │ │ │ │ │ 'old_content', │ │
  1447. │ │ │ │ │ │ │ 'new_content', │ │
  1448. │ │ │ │ │ │ │ 'request_heartbeat' │ │
  1449. │ │ │ │ │ │ ] │ │
  1450. │ │ │ │ │ } │ │
  1451. │ │ │ │ }, │ │
  1452. │ │ │ │ { │ │
  1453. │ │ │ │ │ 'name': 'conversation_search', │ │
  1454. │ │ │ │ │ 'description': 'Search prior conversation history using │ │
  1455. │ │ case-insensitive string matching.', │ │
  1456. │ │ │ │ │ 'parameters': { │ │
  1457. │ │ │ │ │ │ 'type': 'object', │ │
  1458. │ │ │ │ │ │ 'properties': { │ │
  1459. │ │ │ │ │ │ │ 'query': { │ │
  1460. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  1461. │ │ │ │ │ │ │ │ 'description': 'String to search for.' │ │
  1462. │ │ │ │ │ │ │ }, │ │
  1463. │ │ │ │ │ │ │ 'page': { │ │
  1464. │ │ │ │ │ │ │ │ 'type': 'integer', │ │
  1465. │ │ │ │ │ │ │ │ 'description': 'Allows you to page through results. Only │ │
  1466. │ │ use on a follow-up query. Defaults to 0'+14 │ │
  1467. │ │ │ │ │ │ │ }, │ │
  1468. │ │ │ │ │ │ │ 'request_heartbeat': { │ │
  1469. │ │ │ │ │ │ │ │ 'type': 'boolean', │ │
  1470. │ │ │ │ │ │ │ │ 'description': "Request an immediate heartbeat after │ │
  1471. │ │ function execution. Set to 'true' if you wa"+59 │ │
  1472. │ │ │ │ │ │ │ } │ │
  1473. │ │ │ │ │ │ }, │ │
  1474. │ │ │ │ │ │ 'required': ['name', 'page', 'request_heartbeat'] │ │
  1475. │ │ │ │ │ } │ │
  1476. │ │ │ │ }, │ │
  1477. │ │ │ │ { │ │
  1478. │ │ │ │ │ 'name': 'conversation_search_date', │ │
  1479. │ │ │ │ │ 'description': 'Search prior conversation history using a date range.', │ │
  1480. │ │ │ │ │ 'parameters': { │ │
  1481. │ │ │ │ │ │ 'type': 'object', │ │
  1482. │ │ │ │ │ │ 'properties': { │ │
  1483. │ │ │ │ │ │ │ 'start_date': { │ │
  1484. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  1485. │ │ │ │ │ │ │ │ 'description': "The start of the date range to search, in │ │
  1486. │ │ the format 'YYYY-MM-DD'." │ │
  1487. │ │ │ │ │ │ │ }, │ │
  1488. │ │ │ │ │ │ │ 'end_date': { │ │
  1489. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  1490. │ │ │ │ │ │ │ │ 'description': "The end of the date range to search, in the │ │
  1491. │ │ format 'YYYY-MM-DD'." │ │
  1492. │ │ │ │ │ │ │ }, │ │
  1493. │ │ │ │ │ │ │ 'page': { │ │
  1494. │ │ │ │ │ │ │ │ 'type': 'integer', │ │
  1495. │ │ │ │ │ │ │ │ 'description': 'Allows you to page through results. Only │ │
  1496. │ │ use on a follow-up query. Defaults to 0'+14 │ │
  1497. │ │ │ │ │ │ │ }, │ │
  1498. │ │ │ │ │ │ │ 'request_heartbeat': { │ │
  1499. │ │ │ │ │ │ │ │ 'type': 'boolean', │ │
  1500. │ │ │ │ │ │ │ │ 'description': "Request an immediate heartbeat after │ │
  1501. │ │ function execution. Set to 'true' if you wa"+59 │ │
  1502. │ │ │ │ │ │ │ } │ │
  1503. │ │ │ │ │ │ }, │ │
  1504. │ │ │ │ │ │ 'required': ['name', 'page', 'request_heartbeat'] │ │
  1505. │ │ │ │ │ } │ │
  1506. │ │ │ │ }, │ │
  1507. │ │ │ │ { │ │
  1508. │ │ │ │ │ 'name': 'archival_memory_insert', │ │
  1509. │ │ │ │ │ 'description': 'Add to archival memory. Make sure to phrase the memory │ │
  1510. │ │ contents such that it can'+25, │ │
  1511. │ │ │ │ │ 'parameters': { │ │
  1512. │ │ │ │ │ │ 'type': 'object', │ │
  1513. │ │ │ │ │ │ 'properties': { │ │
  1514. │ │ │ │ │ │ │ 'content': { │ │
  1515. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  1516. │ │ │ │ │ │ │ │ 'description': 'Content to write to the memory. All unicode │ │
  1517. │ │ (including emojis) are supported.' │ │
  1518. │ │ │ │ │ │ │ }, │ │
  1519. │ │ │ │ │ │ │ 'request_heartbeat': { │ │
  1520. │ │ │ │ │ │ │ │ 'type': 'boolean', │ │
  1521. │ │ │ │ │ │ │ │ 'description': "Request an immediate heartbeat after │ │
  1522. │ │ function execution. Set to 'true' if you wa"+59 │ │
  1523. │ │ │ │ │ │ │ } │ │
  1524. │ │ │ │ │ │ }, │ │
  1525. │ │ │ │ │ │ 'required': ['name', 'content', 'request_heartbeat'] │ │
  1526. │ │ │ │ │ } │ │
  1527. │ │ │ │ }, │ │
  1528. │ │ │ │ { │ │
  1529. │ │ │ │ │ 'name': 'archival_memory_search', │ │
  1530. │ │ │ │ │ 'description': 'Search archival memory using semantic (embedding-based) │ │
  1531. │ │ search.', │ │
  1532. │ │ │ │ │ 'parameters': { │ │
  1533. │ │ │ │ │ │ 'type': 'object', │ │
  1534. │ │ │ │ │ │ 'properties': { │ │
  1535. │ │ │ │ │ │ │ 'query': { │ │
  1536. │ │ │ │ │ │ │ │ 'type': 'string', │ │
  1537. │ │ │ │ │ │ │ │ 'description': 'String to search for.' │ │
  1538. │ │ │ │ │ │ │ }, │ │
  1539. │ │ │ │ │ │ │ 'page': { │ │
  1540. │ │ │ │ │ │ │ │ 'type': 'integer', │ │
  1541. │ │ │ │ │ │ │ │ 'description': 'Allows you to page through results. Only │ │
  1542. │ │ use on a follow-up query. Defaults to 0'+14 │ │
  1543. │ │ │ │ │ │ │ }, │ │
  1544. │ │ │ │ │ │ │ 'request_heartbeat': { │ │
  1545. │ │ │ │ │ │ │ │ 'type': 'boolean', │ │
  1546. │ │ │ │ │ │ │ │ 'description': "Request an immediate heartbeat after │ │
  1547. │ │ function execution. Set to 'true' if you wa"+59 │ │
  1548. │ │ │ │ │ │ │ } │ │
  1549. │ │ │ │ │ │ }, │ │
  1550. │ │ │ │ │ │ 'required': ['name', 'query', 'page', 'request_heartbeat'] │ │
  1551. │ │ │ │ │ } │ │
  1552. │ │ │ │ } │ │
  1553. │ │ │ ], │ │
  1554. │ │ │ 'function_call': 'auto' │ │
  1555. │ │ } │ │
  1556. │ └──────────────────────────────────────────────────────────────────────────────────────────────┘ │
  1557. │ │
  1558. │ C:\Users\ivan\AppData\Local\Programs\Python\Python311\Lib\site-packages\memgpt\local_llm\chat_co │
  1559. │ mpletion_proxy.py:57 in get_chat_completion │
  1560. │ │
  1561. │ 54 │ if result is None or result == "": │
  1562. │ 55 │ │ raise Exception(f"Got back an empty response string from {HOST}") │
  1563. │ 56 │ │
  1564. │ > 57 │ chat_completion_result = llm_wrapper.output_to_chat_completion_response(result) │
  1565. │ 58 │ if DEBUG: │
  1566. │ 59 │ │ print(json.dumps(chat_completion_result, indent=2)) │
  1567. │ 60 │
  1568. │ │
  1569. │ ┌─────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
  1570. │ │ function_call = 'auto' │ │
  1571. │ │ functions = [ │ │
  1572. │ │ │ { │ │
  1573. │ │ │ │ 'name': 'send_message', │ │
  1574. │ │ │ │ 'description': 'Sends a message to the human user', │ │
  1575. │ │ │ │ 'parameters': { │ │
  1576. │ │ │ │ │ 'type': 'object', │ │
  1577. │ │ │ │ │ 'properties': { │ │
  1578. │ │ │ │ │ │ 'message': { │ │
  1579. │ │ │ │ │ │ │ 'type': 'string', │ │
  1580. │ │ │ │ │ │ │ 'description': 'Message contents. All unicode (including │ │
  1581. │ │ emojis) are supported.' │ │
  1582. │ │ │ │ │ │ } │ │
  1583. │ │ │ │ │ }, │ │
  1584. │ │ │ │ │ 'required': ['message'] │ │
  1585. │ │ │ │ } │ │
  1586. │ │ │ }, │ │
  1587. │ │ │ { │ │
  1588. │ │ │ │ 'name': 'pause_heartbeats', │ │
  1589. │ │ │ │ 'description': 'Temporarily ignore timed heartbeats. You may still │ │
  1590. │ │ receive messages from manual '+28, │ │
  1591. │ │ │ │ 'parameters': { │ │
  1592. │ │ │ │ │ 'type': 'object', │ │
  1593. │ │ │ │ │ 'properties': { │ │
  1594. │ │ │ │ │ │ 'minutes': { │ │
  1595. │ │ │ │ │ │ │ 'type': 'integer', │ │
  1596. │ │ │ │ │ │ │ 'description': 'Number of minutes to ignore heartbeats │ │
  1597. │ │ for. Max value of 360 minutes (6 hours).' │ │
  1598. │ │ │ │ │ │ } │ │
  1599. │ │ │ │ │ }, │ │
  1600. │ │ │ │ │ 'required': ['minutes'] │ │
  1601. │ │ │ │ } │ │
  1602. │ │ │ }, │ │
  1603. │ │ │ { │ │
  1604. │ │ │ │ 'name': 'core_memory_append', │ │
  1605. │ │ │ │ 'description': 'Append to the contents of core memory.', │ │
  1606. │ │ │ │ 'parameters': { │ │
  1607. │ │ │ │ │ 'type': 'object', │ │
  1608. │ │ │ │ │ 'properties': { │ │
  1609. │ │ │ │ │ │ 'name': { │ │
  1610. │ │ │ │ │ │ │ 'type': 'string', │ │
  1611. │ │ │ │ │ │ │ 'description': 'Section of the memory to be edited │ │
  1612. │ │ (persona or human).' │ │
  1613. │ │ │ │ │ │ }, │ │
  1614. │ │ │ │ │ │ 'content': { │ │
  1615. │ │ │ │ │ │ │ 'type': 'string', │ │
  1616. │ │ │ │ │ │ │ 'description': 'Content to write to the memory. All │ │
  1617. │ │ unicode (including emojis) are supported.' │ │
  1618. │ │ │ │ │ │ }, │ │
  1619. │ │ │ │ │ │ 'request_heartbeat': { │ │
  1620. │ │ │ │ │ │ │ 'type': 'boolean', │ │
  1621. │ │ │ │ │ │ │ 'description': 'Request an immediate heartbeat after │ │
  1622. │ │ function execution, use to chain multiple f'+9 │ │
  1623. │ │ │ │ │ │ } │ │
  1624. │ │ │ │ │ }, │ │
  1625. │ │ │ │ │ 'required': ['name', 'content', 'request_heartbeat'] │ │
  1626. │ │ │ │ } │ │
  1627. │ │ │ }, │ │
  1628. │ │ │ { │ │
  1629. │ │ │ │ 'name': 'core_memory_replace', │ │
  1630. │ │ │ │ 'description': 'Replace to the contents of core memory. To delete │ │
  1631. │ │ memories, use an empty string '+16, │ │
  1632. │ │ │ │ 'parameters': { │ │
  1633. │ │ │ │ │ 'type': 'object', │ │
  1634. │ │ │ │ │ 'properties': { │ │
  1635. │ │ │ │ │ │ 'name': { │ │
  1636. │ │ │ │ │ │ │ 'type': 'string', │ │
  1637. │ │ │ │ │ │ │ 'description': 'Section of the memory to be edited │ │
  1638. │ │ (persona or human).' │ │
  1639. │ │ │ │ │ │ }, │ │
  1640. │ │ │ │ │ │ 'old_content': { │ │
  1641. │ │ │ │ │ │ │ 'type': 'string', │ │
  1642. │ │ │ │ │ │ │ 'description': 'String to replace. Must be an exact │ │
  1643. │ │ match.' │ │
  1644. │ │ │ │ │ │ }, │ │
  1645. │ │ │ │ │ │ 'new_content': { │ │
  1646. │ │ │ │ │ │ │ 'type': 'string', │ │
  1647. │ │ │ │ │ │ │ 'description': 'Content to write to the memory. All │ │
  1648. │ │ unicode (including emojis) are supported.' │ │
  1649. │ │ │ │ │ │ }, │ │
  1650. │ │ │ │ │ │ 'request_heartbeat': { │ │
  1651. │ │ │ │ │ │ │ 'type': 'boolean', │ │
  1652. │ │ │ │ │ │ │ 'description': 'Request an immediate heartbeat after │ │
  1653. │ │ function execution, use to chain multiple f'+9 │ │
  1654. │ │ │ │ │ │ } │ │
  1655. │ │ │ │ │ }, │ │
  1656. │ │ │ │ │ 'required': [ │ │
  1657. │ │ │ │ │ │ 'name', │ │
  1658. │ │ │ │ │ │ 'old_content', │ │
  1659. │ │ │ │ │ │ 'new_content', │ │
  1660. │ │ │ │ │ │ 'request_heartbeat' │ │
  1661. │ │ │ │ │ ] │ │
  1662. │ │ │ │ } │ │
  1663. │ │ │ }, │ │
  1664. │ │ │ { │ │
  1665. │ │ │ │ 'name': 'conversation_search', │ │
  1666. │ │ │ │ 'description': 'Search prior conversation history using │ │
  1667. │ │ case-insensitive string matching.', │ │
  1668. │ │ │ │ 'parameters': { │ │
  1669. │ │ │ │ │ 'type': 'object', │ │
  1670. │ │ │ │ │ 'properties': { │ │
  1671. │ │ │ │ │ │ 'query': { │ │
  1672. │ │ │ │ │ │ │ 'type': 'string', │ │
  1673. │ │ │ │ │ │ │ 'description': 'String to search for.' │ │
  1674. │ │ │ │ │ │ }, │ │
  1675. │ │ │ │ │ │ 'page': { │ │
  1676. │ │ │ │ │ │ │ 'type': 'integer', │ │
  1677. │ │ │ │ │ │ │ 'description': 'Allows you to page through results. Only │ │
  1678. │ │ use on a follow-up query. Defaults to 0'+14 │ │
  1679. │ │ │ │ │ │ }, │ │
  1680. │ │ │ │ │ │ 'request_heartbeat': { │ │
  1681. │ │ │ │ │ │ │ 'type': 'boolean', │ │
  1682. │ │ │ │ │ │ │ 'description': "Request an immediate heartbeat after │ │
  1683. │ │ function execution. Set to 'true' if you wa"+59 │ │
  1684. │ │ │ │ │ │ } │ │
  1685. │ │ │ │ │ }, │ │
  1686. │ │ │ │ │ 'required': ['name', 'page', 'request_heartbeat'] │ │
  1687. │ │ │ │ } │ │
  1688. │ │ │ }, │ │
  1689. │ │ │ { │ │
  1690. │ │ │ │ 'name': 'conversation_search_date', │ │
  1691. │ │ │ │ 'description': 'Search prior conversation history using a date │ │
  1692. │ │ range.', │ │
  1693. │ │ │ │ 'parameters': { │ │
  1694. │ │ │ │ │ 'type': 'object', │ │
  1695. │ │ │ │ │ 'properties': { │ │
  1696. │ │ │ │ │ │ 'start_date': { │ │
  1697. │ │ │ │ │ │ │ 'type': 'string', │ │
  1698. │ │ │ │ │ │ │ 'description': "The start of the date range to search, │ │
  1699. │ │ in the format 'YYYY-MM-DD'." │ │
  1700. │ │ │ │ │ │ }, │ │
  1701. │ │ │ │ │ │ 'end_date': { │ │
  1702. │ │ │ │ │ │ │ 'type': 'string', │ │
  1703. │ │ │ │ │ │ │ 'description': "The end of the date range to search, in │ │
  1704. │ │ the format 'YYYY-MM-DD'." │ │
  1705. │ │ │ │ │ │ }, │ │
  1706. │ │ │ │ │ │ 'page': { │ │
  1707. │ │ │ │ │ │ │ 'type': 'integer', │ │
  1708. │ │ │ │ │ │ │ 'description': 'Allows you to page through results. Only │ │
  1709. │ │ use on a follow-up query. Defaults to 0'+14 │ │
  1710. │ │ │ │ │ │ }, │ │
  1711. │ │ │ │ │ │ 'request_heartbeat': { │ │
  1712. │ │ │ │ │ │ │ 'type': 'boolean', │ │
  1713. │ │ │ │ │ │ │ 'description': "Request an immediate heartbeat after │ │
  1714. │ │ function execution. Set to 'true' if you wa"+59 │ │
  1715. │ │ │ │ │ │ } │ │
  1716. │ │ │ │ │ }, │ │
  1717. │ │ │ │ │ 'required': ['name', 'page', 'request_heartbeat'] │ │
  1718. │ │ │ │ } │ │
  1719. │ │ │ }, │ │
  1720. │ │ │ { │ │
  1721. │ │ │ │ 'name': 'archival_memory_insert', │ │
  1722. │ │ │ │ 'description': 'Add to archival memory. Make sure to phrase the │ │
  1723. │ │ memory contents such that it can'+25, │ │
  1724. │ │ │ │ 'parameters': { │ │
  1725. │ │ │ │ │ 'type': 'object', │ │
  1726. │ │ │ │ │ 'properties': { │ │
  1727. │ │ │ │ │ │ 'content': { │ │
  1728. │ │ │ │ │ │ │ 'type': 'string', │ │
  1729. │ │ │ │ │ │ │ 'description': 'Content to write to the memory. All │ │
  1730. │ │ unicode (including emojis) are supported.' │ │
  1731. │ │ │ │ │ │ }, │ │
  1732. │ │ │ │ │ │ 'request_heartbeat': { │ │
  1733. │ │ │ │ │ │ │ 'type': 'boolean', │ │
  1734. │ │ │ │ │ │ │ 'description': "Request an immediate heartbeat after │ │
  1735. │ │ function execution. Set to 'true' if you wa"+59 │ │
  1736. │ │ │ │ │ │ } │ │
  1737. │ │ │ │ │ }, │ │
  1738. │ │ │ │ │ 'required': ['name', 'content', 'request_heartbeat'] │ │
  1739. │ │ │ │ } │ │
  1740. │ │ │ }, │ │
  1741. │ │ │ { │ │
  1742. │ │ │ │ 'name': 'archival_memory_search', │ │
  1743. │ │ │ │ 'description': 'Search archival memory using semantic │ │
  1744. │ │ (embedding-based) search.', │ │
  1745. │ │ │ │ 'parameters': { │ │
  1746. │ │ │ │ │ 'type': 'object', │ │
  1747. │ │ │ │ │ 'properties': { │ │
  1748. │ │ │ │ │ │ 'query': { │ │
  1749. │ │ │ │ │ │ │ 'type': 'string', │ │
  1750. │ │ │ │ │ │ │ 'description': 'String to search for.' │ │
  1751. │ │ │ │ │ │ }, │ │
  1752. │ │ │ │ │ │ 'page': { │ │
  1753. │ │ │ │ │ │ │ 'type': 'integer', │ │
  1754. │ │ │ │ │ │ │ 'description': 'Allows you to page through results. Only │ │
  1755. │ │ use on a follow-up query. Defaults to 0'+14 │ │
  1756. │ │ │ │ │ │ }, │ │
  1757. │ │ │ │ │ │ 'request_heartbeat': { │ │
  1758. │ │ │ │ │ │ │ 'type': 'boolean', │ │
  1759. │ │ │ │ │ │ │ 'description': "Request an immediate heartbeat after │ │
  1760. │ │ function execution. Set to 'true' if you wa"+59 │ │
  1761. │ │ │ │ │ │ } │ │
  1762. │ │ │ │ │ }, │ │
  1763. │ │ │ │ │ 'required': ['name', 'query', 'page', 'request_heartbeat'] │ │
  1764. │ │ │ │ } │ │
  1765. │ │ │ } │ │
  1766. │ │ ] │ │
  1767. │ │ llm_wrapper = <memgpt.local_llm.llm_chat_completion_wrappers.zephyr.ZephyrMistralInnerMon… │ │
  1768. │ │ object at 0x000001A8C84ADF10> │ │
  1769. │ │ messages = [ │ │
  1770. │ │ │ { │ │
  1771. │ │ │ │ 'role': 'system', │ │
  1772. │ │ │ │ 'content': "You are MemGPT, the latest version of Limnal │ │
  1773. │ │ Corporation's digital companion, de"+7218 │ │
  1774. │ │ │ }, │ │
  1775. │ │ │ { │ │
  1776. │ │ │ │ 'role': 'assistant', │ │
  1777. │ │ │ │ 'content': 'Bootup sequence complete. Persona activated. Testing │ │
  1778. │ │ messaging functionality.', │ │
  1779. │ │ │ │ 'function_call': { │ │
  1780. │ │ │ │ │ 'name': 'send_message', │ │
  1781. │ │ │ │ │ 'arguments': '{\n "message": "More human than human is our │ │
  1782. │ │ motto."\n}' │ │
  1783. │ │ │ │ } │ │
  1784. │ │ │ }, │ │
  1785. │ │ │ { │ │
  1786. │ │ │ │ 'role': 'function', │ │
  1787. │ │ │ │ 'name': 'send_message', │ │
  1788. │ │ │ │ 'content': '{"status": "OK", "message": null, "time": "2023-10-30 │ │
  1789. │ │ 02:14:35 AM PDT-0700"}' │ │
  1790. │ │ │ }, │ │
  1791. │ │ │ { │ │
  1792. │ │ │ │ 'role': 'user', │ │
  1793. │ │ │ │ 'content': '{"type": "login", "last_login": "Never (first login)", │ │
  1794. │ │ "time": "2023-10-30 02:14'+17 │ │
  1795. │ │ │ } │ │
  1796. │ │ ] │ │
  1797. │ │ model = 'zephyr-7B-alpha' │ │
  1798. │ │ prompt = "You are MemGPT, the latest version of Limnal Corporation's digital │ │
  1799. │ │ companion, de"+11363 │ │
  1800. │ │ result = ' "function": "core_memory_append",\n "params": {\n "inner_thoughts": │ │
  1801. │ │ "User \'C'+442 │ │
  1802. │ └──────────────────────────────────────────────────────────────────────────────────────────────┘ │
  1803. │ │
  1804. │ C:\Users\ivan\AppData\Local\Programs\Python\Python311\Lib\site-packages\memgpt\local_llm\llm_cha │
  1805. │ t_completion_wrappers\zephyr.py:316 in output_to_chat_completion_response │
  1806. │ │
  1807. │ 313 │ │ │ try: │
  1808. │ 314 │ │ │ │ function_json_output = json.loads(raw_llm_output + "\n}") │
  1809. │ 315 │ │ │ except: │
  1810. │ > 316 │ │ │ │ raise Exception(f"Failed to decode JSON from LLM output:\n{raw_llm_outpu │
  1811. │ 317 │ │ function_name = function_json_output["function"] │
  1812. │ 318 │ │ function_parameters = function_json_output["params"] │
  1813. │ 319 │
  1814. │ │
  1815. │ ┌─────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
  1816. │ │ raw_llm_output = '{ "function": "core_memory_append",\n "params": {\n "inner_thoughts": │ │
  1817. │ │ "User \''+443 │ │
  1818. │ │ self = <memgpt.local_llm.llm_chat_completion_wrappers.zephyr.ZephyrMistralInnerMo… │ │
  1819. │ │ object at 0x000001A8C84ADF10> │ │
  1820. │ └──────────────────────────────────────────────────────────────────────────────────────────────┘ │
  1821. └──────────────────────────────────────────────────────────────────────────────────────────────────┘
  1822. Exception: Failed to decode JSON from LLM output:
  1823. { "function": "core_memory_append",
  1824. "params": {
  1825. "inner_thoughts": "User 'Chad' (human) has successfully logged into the system. User information added to core memory.",
  1826. "name": "user_details",
  1827. "content": `{
  1828. "firstName": "Chad",
  1829. "lastName": null,
  1830. "gender": "Male",
  1831. "age": null,
  1832. "nationality": null,
  1833. "occupation": "Computer Science PhD student at UC Berkeley",
  1834. "interests": ["Formula 1", "Sailing", "Taste of the Himalayas Restaurant in Berkeley", "CSGO"]
  1835. }`
  1836. }
  1837. }
  1838.  
  1839. C:\IA\MEMGpt>
Advertisement
Add Comment
Please, Sign In to add comment