@elizaos/python 2.0.0-alpha.10 → 2.0.0-alpha.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/elizaos/__init__.py +0 -1
- package/elizaos/advanced_capabilities/__init__.py +6 -41
- package/elizaos/advanced_capabilities/actions/__init__.py +1 -21
- package/elizaos/advanced_capabilities/actions/add_contact.py +21 -11
- package/elizaos/advanced_capabilities/actions/follow_room.py +28 -28
- package/elizaos/advanced_capabilities/actions/image_generation.py +13 -26
- package/elizaos/advanced_capabilities/actions/mute_room.py +13 -26
- package/elizaos/advanced_capabilities/actions/remove_contact.py +16 -2
- package/elizaos/advanced_capabilities/actions/roles.py +13 -27
- package/elizaos/advanced_capabilities/actions/schedule_follow_up.py +70 -15
- package/elizaos/advanced_capabilities/actions/search_contacts.py +17 -3
- package/elizaos/advanced_capabilities/actions/send_message.py +183 -50
- package/elizaos/advanced_capabilities/actions/settings.py +16 -2
- package/elizaos/advanced_capabilities/actions/unfollow_room.py +13 -26
- package/elizaos/advanced_capabilities/actions/unmute_room.py +13 -26
- package/elizaos/advanced_capabilities/actions/update_contact.py +16 -2
- package/elizaos/advanced_capabilities/actions/update_entity.py +16 -2
- package/elizaos/advanced_capabilities/evaluators/__init__.py +2 -9
- package/elizaos/advanced_capabilities/evaluators/reflection.py +3 -132
- package/elizaos/advanced_capabilities/evaluators/relationship_extraction.py +5 -201
- package/elizaos/advanced_capabilities/providers/__init__.py +1 -12
- package/elizaos/advanced_capabilities/providers/knowledge.py +24 -3
- package/elizaos/advanced_capabilities/services/__init__.py +2 -9
- package/elizaos/advanced_memory/actions/reset_session.py +11 -0
- package/elizaos/advanced_memory/evaluators/reflection.py +134 -0
- package/elizaos/advanced_memory/evaluators/relationship_extraction.py +203 -0
- package/elizaos/advanced_memory/memory_service.py +15 -17
- package/elizaos/advanced_memory/test_advanced_memory.py +357 -0
- package/elizaos/advanced_planning/actions/schedule_follow_up.py +222 -0
- package/elizaos/advanced_planning/planning_service.py +26 -14
- package/elizaos/basic_capabilities/__init__.py +0 -2
- package/elizaos/basic_capabilities/providers/__init__.py +0 -3
- package/elizaos/basic_capabilities/providers/actions.py +118 -29
- package/elizaos/basic_capabilities/providers/agent_settings.py +64 -0
- package/elizaos/basic_capabilities/providers/character.py +19 -21
- package/elizaos/basic_capabilities/providers/contacts.py +79 -0
- package/elizaos/basic_capabilities/providers/current_time.py +7 -4
- package/elizaos/basic_capabilities/providers/facts.py +87 -0
- package/elizaos/basic_capabilities/providers/follow_ups.py +117 -0
- package/elizaos/basic_capabilities/providers/knowledge.py +97 -0
- package/elizaos/basic_capabilities/providers/relationships.py +107 -0
- package/elizaos/basic_capabilities/providers/roles.py +96 -0
- package/elizaos/basic_capabilities/providers/settings.py +56 -0
- package/elizaos/basic_capabilities/providers/time.py +7 -4
- package/elizaos/bootstrap/__init__.py +21 -2
- package/elizaos/bootstrap/actions/schedule_follow_up.py +65 -7
- package/elizaos/bootstrap/actions/send_message.py +162 -15
- package/elizaos/bootstrap/autonomy/__init__.py +5 -1
- package/elizaos/bootstrap/autonomy/action.py +161 -0
- package/elizaos/bootstrap/autonomy/evaluators.py +217 -0
- package/elizaos/bootstrap/autonomy/service.py +238 -28
- package/elizaos/bootstrap/plugin.py +7 -0
- package/elizaos/bootstrap/providers/actions.py +118 -27
- package/elizaos/bootstrap/providers/agent_settings.py +1 -0
- package/elizaos/bootstrap/providers/attachments.py +1 -0
- package/elizaos/bootstrap/providers/capabilities.py +1 -0
- package/elizaos/bootstrap/providers/character.py +1 -0
- package/elizaos/bootstrap/providers/choice.py +1 -0
- package/elizaos/bootstrap/providers/contacts.py +1 -0
- package/elizaos/bootstrap/providers/current_time.py +8 -2
- package/elizaos/bootstrap/providers/entities.py +1 -0
- package/elizaos/bootstrap/providers/evaluators.py +1 -0
- package/elizaos/bootstrap/providers/facts.py +1 -0
- package/elizaos/bootstrap/providers/follow_ups.py +1 -0
- package/elizaos/bootstrap/providers/knowledge.py +27 -3
- package/elizaos/bootstrap/providers/providers_list.py +1 -0
- package/elizaos/bootstrap/providers/relationships.py +1 -0
- package/elizaos/bootstrap/providers/roles.py +1 -0
- package/elizaos/bootstrap/providers/settings.py +1 -0
- package/elizaos/bootstrap/providers/time.py +8 -4
- package/elizaos/bootstrap/providers/world.py +1 -0
- package/elizaos/bootstrap/services/embedding.py +156 -1
- package/elizaos/deterministic.py +193 -0
- package/elizaos/generated/__init__.py +1 -0
- package/elizaos/generated/action_docs.py +3181 -0
- package/elizaos/generated/spec_helpers.py +175 -0
- package/elizaos/media/mime.py +2 -2
- package/elizaos/media/search.py +23 -23
- package/elizaos/runtime.py +215 -57
- package/elizaos/services/message_service.py +175 -29
- package/elizaos/types/components.py +2 -2
- package/elizaos/types/generated/__init__.py +12 -0
- package/elizaos/types/generated/eliza/v1/agent_pb2.py +63 -0
- package/elizaos/types/generated/eliza/v1/agent_pb2.pyi +159 -0
- package/elizaos/types/generated/eliza/v1/components_pb2.py +65 -0
- package/elizaos/types/generated/eliza/v1/components_pb2.pyi +160 -0
- package/elizaos/types/generated/eliza/v1/database_pb2.py +78 -0
- package/elizaos/types/generated/eliza/v1/database_pb2.pyi +305 -0
- package/elizaos/types/generated/eliza/v1/environment_pb2.py +58 -0
- package/elizaos/types/generated/eliza/v1/environment_pb2.pyi +135 -0
- package/elizaos/types/generated/eliza/v1/events_pb2.py +82 -0
- package/elizaos/types/generated/eliza/v1/events_pb2.pyi +322 -0
- package/elizaos/types/generated/eliza/v1/ipc_pb2.py +113 -0
- package/elizaos/types/generated/eliza/v1/ipc_pb2.pyi +367 -0
- package/elizaos/types/generated/eliza/v1/knowledge_pb2.py +41 -0
- package/elizaos/types/generated/eliza/v1/knowledge_pb2.pyi +26 -0
- package/elizaos/types/generated/eliza/v1/memory_pb2.py +55 -0
- package/elizaos/types/generated/eliza/v1/memory_pb2.pyi +111 -0
- package/elizaos/types/generated/eliza/v1/message_service_pb2.py +48 -0
- package/elizaos/types/generated/eliza/v1/message_service_pb2.pyi +69 -0
- package/elizaos/types/generated/eliza/v1/messaging_pb2.py +51 -0
- package/elizaos/types/generated/eliza/v1/messaging_pb2.pyi +97 -0
- package/elizaos/types/generated/eliza/v1/model_pb2.py +84 -0
- package/elizaos/types/generated/eliza/v1/model_pb2.pyi +280 -0
- package/elizaos/types/generated/eliza/v1/payment_pb2.py +44 -0
- package/elizaos/types/generated/eliza/v1/payment_pb2.pyi +70 -0
- package/elizaos/types/generated/eliza/v1/plugin_pb2.py +68 -0
- package/elizaos/types/generated/eliza/v1/plugin_pb2.pyi +145 -0
- package/elizaos/types/generated/eliza/v1/primitives_pb2.py +48 -0
- package/elizaos/types/generated/eliza/v1/primitives_pb2.pyi +92 -0
- package/elizaos/types/generated/eliza/v1/prompts_pb2.py +52 -0
- package/elizaos/types/generated/eliza/v1/prompts_pb2.pyi +74 -0
- package/elizaos/types/generated/eliza/v1/service_interfaces_pb2.py +211 -0
- package/elizaos/types/generated/eliza/v1/service_interfaces_pb2.pyi +1296 -0
- package/elizaos/types/generated/eliza/v1/service_pb2.py +42 -0
- package/elizaos/types/generated/eliza/v1/service_pb2.pyi +69 -0
- package/elizaos/types/generated/eliza/v1/settings_pb2.py +58 -0
- package/elizaos/types/generated/eliza/v1/settings_pb2.pyi +85 -0
- package/elizaos/types/generated/eliza/v1/state_pb2.py +60 -0
- package/elizaos/types/generated/eliza/v1/state_pb2.pyi +114 -0
- package/elizaos/types/generated/eliza/v1/task_pb2.py +42 -0
- package/elizaos/types/generated/eliza/v1/task_pb2.pyi +58 -0
- package/elizaos/types/generated/eliza/v1/tee_pb2.py +52 -0
- package/elizaos/types/generated/eliza/v1/tee_pb2.pyi +90 -0
- package/elizaos/types/generated/eliza/v1/testing_pb2.py +39 -0
- package/elizaos/types/generated/eliza/v1/testing_pb2.pyi +23 -0
- package/elizaos/types/model.py +30 -0
- package/elizaos/types/runtime.py +6 -2
- package/elizaos/utils/validation.py +76 -0
- package/package.json +3 -2
- package/tests/test_action_parameters.py +2 -3
- package/tests/test_actions_provider_examples.py +58 -1
- package/tests/test_advanced_memory_behavior.py +0 -2
- package/tests/test_advanced_memory_flag.py +0 -2
- package/tests/test_advanced_planning_behavior.py +11 -5
- package/tests/test_async_embedding.py +124 -0
- package/tests/test_autonomy.py +24 -3
- package/tests/test_runtime.py +8 -17
- package/tests/test_schedule_follow_up_action.py +260 -0
- package/tests/test_send_message_action_targets.py +114 -0
- package/tests/test_settings_crypto.py +0 -2
- package/tests/test_validation.py +141 -0
- package/tests/verify_memory_architecture.py +192 -0
- package/uv.lock +1565 -0
- package/elizaos/basic_capabilities/providers/capabilities.py +0 -62
|
@@ -262,7 +262,7 @@ def _parse_params_from_xml(xml_response: str) -> dict[str, list[dict[str, str]]]
|
|
|
262
262
|
if not params_content:
|
|
263
263
|
return result
|
|
264
264
|
|
|
265
|
-
# First try XML parsing of the inner params content
|
|
265
|
+
# First try strict XML parsing of the inner params content
|
|
266
266
|
try:
|
|
267
267
|
root = ET.fromstring(f"<params>{params_content}</params>")
|
|
268
268
|
for action_elem in list(root):
|
|
@@ -270,7 +270,8 @@ def _parse_params_from_xml(xml_response: str) -> dict[str, list[dict[str, str]]]
|
|
|
270
270
|
action_params: dict[str, str] = {}
|
|
271
271
|
|
|
272
272
|
for param_elem in list(action_elem):
|
|
273
|
-
|
|
273
|
+
# Use itertext() to capture ALL text including mixed content
|
|
274
|
+
value_text = "".join(param_elem.itertext()).strip()
|
|
274
275
|
action_params[param_elem.tag] = value_text
|
|
275
276
|
|
|
276
277
|
# If the action block contains text but no nested tags, try JSON-in-action.
|
|
@@ -283,35 +284,69 @@ def _parse_params_from_xml(xml_response: str) -> dict[str, list[dict[str, str]]]
|
|
|
283
284
|
for k, v in loaded.items():
|
|
284
285
|
action_params[str(k)] = str(v)
|
|
285
286
|
except json.JSONDecodeError:
|
|
286
|
-
|
|
287
|
+
pass # Fall through to regex fallback
|
|
287
288
|
|
|
288
289
|
if action_params:
|
|
289
290
|
result.setdefault(action_name, []).append(action_params)
|
|
290
291
|
|
|
291
|
-
|
|
292
|
+
if result:
|
|
293
|
+
return result
|
|
292
294
|
except ET.ParseError:
|
|
293
|
-
|
|
295
|
+
pass # Fall through to regex-based extraction
|
|
294
296
|
|
|
295
|
-
#
|
|
296
|
-
|
|
297
|
-
|
|
297
|
+
# Regex-based fallback for content that breaks XML parsing
|
|
298
|
+
# (e.g. C code with <stdio.h>, shell commands with < > &, etc.)
|
|
299
|
+
# Look for <ACTION_NAME>...<param>...</param>...</ACTION_NAME> patterns
|
|
300
|
+
action_block_pattern = re.compile(r"<([A-Z_]+)>(.*?)</\1>", re.DOTALL | re.IGNORECASE)
|
|
301
|
+
param_pattern = re.compile(r"<(\w+)>(.*?)</\1>", re.DOTALL)
|
|
298
302
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
+
for action_match in action_block_pattern.finditer(params_content):
|
|
304
|
+
action_name = action_match.group(1).upper()
|
|
305
|
+
action_body = action_match.group(2).strip()
|
|
306
|
+
action_params: dict[str, str] = {}
|
|
303
307
|
|
|
304
|
-
|
|
308
|
+
# Try JSON inside the action block first
|
|
309
|
+
if action_body.startswith("{"):
|
|
310
|
+
try:
|
|
311
|
+
loaded = json.loads(action_body)
|
|
312
|
+
if isinstance(loaded, dict):
|
|
313
|
+
for k, v in loaded.items():
|
|
314
|
+
action_params[str(k)] = str(v)
|
|
315
|
+
except json.JSONDecodeError:
|
|
316
|
+
pass
|
|
317
|
+
|
|
318
|
+
# Extract nested param tags via regex
|
|
319
|
+
if not action_params:
|
|
320
|
+
for param_match in param_pattern.finditer(action_body):
|
|
321
|
+
param_name = param_match.group(1)
|
|
322
|
+
param_value = param_match.group(2).strip()
|
|
323
|
+
# Skip if the param name looks like an action (all caps)
|
|
324
|
+
if param_name == param_name.upper() and len(param_name) > 2:
|
|
325
|
+
continue
|
|
326
|
+
action_params[param_name] = param_value
|
|
327
|
+
|
|
328
|
+
if action_params:
|
|
329
|
+
result.setdefault(action_name, []).append(action_params)
|
|
330
|
+
|
|
331
|
+
if result:
|
|
305
332
|
return result
|
|
306
333
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
334
|
+
# Fall back to JSON inside <params>...</params>
|
|
335
|
+
if params_content.startswith("{") or params_content.startswith("["):
|
|
336
|
+
try:
|
|
337
|
+
loaded_any = json.loads(params_content)
|
|
338
|
+
except json.JSONDecodeError:
|
|
339
|
+
return result
|
|
340
|
+
|
|
341
|
+
if isinstance(loaded_any, dict):
|
|
342
|
+
for action_name, action_params_raw in loaded_any.items():
|
|
343
|
+
if not isinstance(action_params_raw, dict):
|
|
344
|
+
continue
|
|
345
|
+
params_out: dict[str, str] = {}
|
|
346
|
+
for k, v in action_params_raw.items():
|
|
347
|
+
params_out[str(k)] = str(v)
|
|
348
|
+
if params_out:
|
|
349
|
+
result.setdefault(str(action_name).upper(), []).append(params_out)
|
|
315
350
|
|
|
316
351
|
return result
|
|
317
352
|
|
|
@@ -366,6 +401,9 @@ class DefaultMessageService(IMessageService):
|
|
|
366
401
|
traj_step_id: str | None = None
|
|
367
402
|
if message.metadata is not None:
|
|
368
403
|
maybe_step = getattr(message.metadata, "trajectoryStepId", None)
|
|
404
|
+
if not maybe_step and hasattr(message.metadata, "message"):
|
|
405
|
+
nested_meta = message.metadata.message
|
|
406
|
+
maybe_step = getattr(nested_meta, "trajectory_step_id", None)
|
|
369
407
|
if isinstance(maybe_step, str) and maybe_step:
|
|
370
408
|
traj_step_id = maybe_step
|
|
371
409
|
|
|
@@ -430,9 +468,7 @@ class DefaultMessageService(IMessageService):
|
|
|
430
468
|
# or rewrite it (e.g. redact credentials).
|
|
431
469
|
pre_result = await runtime.evaluate_pre(message)
|
|
432
470
|
if pre_result.blocked:
|
|
433
|
-
runtime.logger.warning(
|
|
434
|
-
f"Message blocked by pre-evaluator: {pre_result.reason}"
|
|
435
|
-
)
|
|
471
|
+
runtime.logger.warning(f"Message blocked by pre-evaluator: {pre_result.reason}")
|
|
436
472
|
return MessageProcessingResult(
|
|
437
473
|
did_respond=False,
|
|
438
474
|
response_content=None,
|
|
@@ -440,9 +476,7 @@ class DefaultMessageService(IMessageService):
|
|
|
440
476
|
state=None,
|
|
441
477
|
)
|
|
442
478
|
if pre_result.rewritten_text is not None:
|
|
443
|
-
runtime.logger.info(
|
|
444
|
-
f"Pre-evaluator rewrote message text: {pre_result.reason}"
|
|
445
|
-
)
|
|
479
|
+
runtime.logger.info(f"Pre-evaluator rewrote message text: {pre_result.reason}")
|
|
446
480
|
message.content.text = pre_result.rewritten_text
|
|
447
481
|
|
|
448
482
|
# Step 1: Save incoming message to memory (if adapter available)
|
|
@@ -452,12 +486,13 @@ class DefaultMessageService(IMessageService):
|
|
|
452
486
|
existing_memory = await runtime.get_memory_by_id(message.id)
|
|
453
487
|
if not existing_memory:
|
|
454
488
|
await runtime.create_memory(message, "messages")
|
|
489
|
+
_spawn_embedding_generation(runtime, message)
|
|
455
490
|
except RuntimeError:
|
|
456
491
|
# No database adapter - skip persistence (benchmark mode)
|
|
457
492
|
runtime.logger.debug("No database adapter, skipping message persistence")
|
|
458
493
|
|
|
459
494
|
# Step 2: Compose state from providers
|
|
460
|
-
state = await runtime.compose_state(message)
|
|
495
|
+
state = await runtime.compose_state(message, trajectory_phase="generate")
|
|
461
496
|
|
|
462
497
|
# Optional: multi-step strategy (TypeScript parity)
|
|
463
498
|
use_multi_step = _parse_bool(runtime.get_setting("USE_MULTI_STEP"))
|
|
@@ -688,6 +723,9 @@ class DefaultMessageService(IMessageService):
|
|
|
688
723
|
},
|
|
689
724
|
)
|
|
690
725
|
|
|
726
|
+
# Spawn async embedding generation for response
|
|
727
|
+
_spawn_embedding_generation(runtime, response_memory)
|
|
728
|
+
|
|
691
729
|
responses = [response_memory]
|
|
692
730
|
|
|
693
731
|
# Step 7: Process actions via runtime.process_actions()
|
|
@@ -701,6 +739,20 @@ class DefaultMessageService(IMessageService):
|
|
|
701
739
|
# Simple chat-style response
|
|
702
740
|
await callback(response_content)
|
|
703
741
|
|
|
742
|
+
# Complete trajectory step with actual action data
|
|
743
|
+
if traj_step_id and traj_logger is not None:
|
|
744
|
+
try:
|
|
745
|
+
if hasattr(traj_logger, "complete_step_by_step_id"):
|
|
746
|
+
traj_logger.complete_step_by_step_id(
|
|
747
|
+
step_id=traj_step_id,
|
|
748
|
+
action_type=",".join(actions) if actions else "REPLY",
|
|
749
|
+
action_name=",".join(actions) if actions else "REPLY",
|
|
750
|
+
success=True,
|
|
751
|
+
reward=0.1,
|
|
752
|
+
)
|
|
753
|
+
except Exception as e:
|
|
754
|
+
runtime.logger.debug(f"Trajectory step completion failed: {e}")
|
|
755
|
+
|
|
704
756
|
# Step 8: Run evaluators via runtime.evaluate()
|
|
705
757
|
runtime.logger.debug("Running evaluators")
|
|
706
758
|
await runtime.evaluate(
|
|
@@ -726,6 +778,22 @@ class DefaultMessageService(IMessageService):
|
|
|
726
778
|
runtime.logger.error(
|
|
727
779
|
f"Error processing message: {e}\n{''.join(_tb.format_exception(e))}"
|
|
728
780
|
)
|
|
781
|
+
|
|
782
|
+
# Mark trajectory step as failed on error
|
|
783
|
+
if traj_step_id and traj_logger is not None:
|
|
784
|
+
try:
|
|
785
|
+
if hasattr(traj_logger, "complete_step_by_step_id"):
|
|
786
|
+
traj_logger.complete_step_by_step_id(
|
|
787
|
+
step_id=traj_step_id,
|
|
788
|
+
action_type="ERROR",
|
|
789
|
+
action_name="ERROR",
|
|
790
|
+
success=False,
|
|
791
|
+
reward=-0.1,
|
|
792
|
+
error=str(e)[:500],
|
|
793
|
+
)
|
|
794
|
+
except Exception:
|
|
795
|
+
pass
|
|
796
|
+
|
|
729
797
|
raise
|
|
730
798
|
finally:
|
|
731
799
|
CURRENT_TRAJECTORY_STEP_ID.reset(token)
|
|
@@ -833,6 +901,7 @@ class DefaultMessageService(IMessageService):
|
|
|
833
901
|
include_list=["RECENT_MESSAGES", "ACTION_STATE", "ACTIONS", "PROVIDERS"],
|
|
834
902
|
only_include=True,
|
|
835
903
|
skip_cache=True,
|
|
904
|
+
trajectory_phase="multi_step_iteration",
|
|
836
905
|
)
|
|
837
906
|
state.data.action_results = list(trace_results)
|
|
838
907
|
state.values["actionResults"] = _format_action_results(trace_results)
|
|
@@ -918,6 +987,7 @@ class DefaultMessageService(IMessageService):
|
|
|
918
987
|
include_list=providers,
|
|
919
988
|
only_include=True,
|
|
920
989
|
skip_cache=True,
|
|
990
|
+
trajectory_phase="multi_step_provider",
|
|
921
991
|
)
|
|
922
992
|
|
|
923
993
|
if action_name:
|
|
@@ -953,6 +1023,7 @@ class DefaultMessageService(IMessageService):
|
|
|
953
1023
|
include_list=["RECENT_MESSAGES", "ACTION_STATE", "ACTIONS", "PROVIDERS"],
|
|
954
1024
|
only_include=True,
|
|
955
1025
|
skip_cache=True,
|
|
1026
|
+
trajectory_phase="multi_step_summary",
|
|
956
1027
|
)
|
|
957
1028
|
state.data.action_results = list(trace_results)
|
|
958
1029
|
state.values["actionResults"] = _format_action_results(trace_results)
|
|
@@ -1176,7 +1247,7 @@ class DefaultMessageService(IMessageService):
|
|
|
1176
1247
|
await runtime.create_memory(message, "messages")
|
|
1177
1248
|
|
|
1178
1249
|
# Compose state from providers
|
|
1179
|
-
state = await runtime.compose_state(message)
|
|
1250
|
+
state = await runtime.compose_state(message, trajectory_phase="generate")
|
|
1180
1251
|
|
|
1181
1252
|
# Build the prompt using canonical template
|
|
1182
1253
|
from elizaos.prompts import MESSAGE_HANDLER_TEMPLATE
|
|
@@ -1246,3 +1317,78 @@ class DefaultMessageService(IMessageService):
|
|
|
1246
1317
|
StreamingMessageResult: Final result with metadata (yielded last)
|
|
1247
1318
|
"""
|
|
1248
1319
|
return self._handle_message_stream_impl(runtime, message)
|
|
1320
|
+
|
|
1321
|
+
|
|
1322
|
+
def _spawn_embedding_generation(runtime: IAgentRuntime, memory: Memory) -> None:
|
|
1323
|
+
"""Spawn a background task to generate intent and embedding for a memory."""
|
|
1324
|
+
import asyncio
|
|
1325
|
+
|
|
1326
|
+
# Create a background task for embedding generation
|
|
1327
|
+
# We don't await it here so it doesn't block the main flow
|
|
1328
|
+
try:
|
|
1329
|
+
loop = asyncio.get_running_loop()
|
|
1330
|
+
loop.create_task(_generate_embedding_task(runtime, memory))
|
|
1331
|
+
except RuntimeError:
|
|
1332
|
+
# If no loop is running, we might be in a thread or startup.
|
|
1333
|
+
# Fallback to creating a new loop or skipping?
|
|
1334
|
+
# Standard asyncio usage implies a loop exists.
|
|
1335
|
+
pass
|
|
1336
|
+
|
|
1337
|
+
|
|
1338
|
+
async def _generate_embedding_task(runtime: IAgentRuntime, memory: Memory) -> None:
|
|
1339
|
+
try:
|
|
1340
|
+
text = memory.content.text or ""
|
|
1341
|
+
if not text:
|
|
1342
|
+
return
|
|
1343
|
+
|
|
1344
|
+
# 1. Generate Intent (Augmented Query)
|
|
1345
|
+
intent_prompt = (
|
|
1346
|
+
"Analyze the following message and extract the core intent or meaning to be used as a search query for retrieval. "
|
|
1347
|
+
"Return ONLY the intent text, no explanation.\\n\\n"
|
|
1348
|
+
f"Message: {text}"
|
|
1349
|
+
)
|
|
1350
|
+
|
|
1351
|
+
intent = text
|
|
1352
|
+
try:
|
|
1353
|
+
# parsing logic handles string response
|
|
1354
|
+
intent_resp = await runtime.use_model(
|
|
1355
|
+
ModelType.TEXT_SMALL,
|
|
1356
|
+
{"prompt": intent_prompt, "maxTokens": 128, "temperature": 0.0},
|
|
1357
|
+
)
|
|
1358
|
+
if isinstance(intent_resp, str):
|
|
1359
|
+
intent = intent_resp.strip()
|
|
1360
|
+
except Exception as e:
|
|
1361
|
+
runtime.logger.debug(f"Failed to generate intent: {e}")
|
|
1362
|
+
|
|
1363
|
+
# Store intent in metadata
|
|
1364
|
+
if memory.metadata is None:
|
|
1365
|
+
from google.protobuf.struct_pb2 import Struct
|
|
1366
|
+
|
|
1367
|
+
memory.metadata = Struct()
|
|
1368
|
+
|
|
1369
|
+
# Handle both dict access (Python object) and struct access (Protobuf)
|
|
1370
|
+
if hasattr(memory.metadata, "update") and callable(memory.metadata.update):
|
|
1371
|
+
# For dict
|
|
1372
|
+
memory.metadata.update({"intent": intent})
|
|
1373
|
+
elif hasattr(memory.metadata, "__setitem__"):
|
|
1374
|
+
memory.metadata["intent"] = intent
|
|
1375
|
+
|
|
1376
|
+
# 2. Generate Embedding for Intent
|
|
1377
|
+
embedding_resp = await runtime.use_model(
|
|
1378
|
+
ModelType.TEXT_EMBEDDING, {"input": intent, "text": intent}
|
|
1379
|
+
)
|
|
1380
|
+
|
|
1381
|
+
embedding: list[float] | None = None
|
|
1382
|
+
if isinstance(embedding_resp, list):
|
|
1383
|
+
embedding = [float(x) for x in embedding_resp]
|
|
1384
|
+
|
|
1385
|
+
if embedding:
|
|
1386
|
+
memory.embedding = embedding
|
|
1387
|
+
|
|
1388
|
+
# 3. Update Memory in DB
|
|
1389
|
+
if runtime._adapter:
|
|
1390
|
+
await runtime.update_memory(memory)
|
|
1391
|
+
runtime.logger.debug(f"Generated intent and embedding for memory {memory.id}")
|
|
1392
|
+
|
|
1393
|
+
except Exception as e:
|
|
1394
|
+
runtime.logger.debug(f"Async embedding task failed for memory {memory.id}: {e}")
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from collections.abc import Awaitable, Callable
|
|
4
|
-
from dataclasses import dataclass
|
|
5
|
-
from enum import Enum
|
|
4
|
+
from dataclasses import dataclass
|
|
6
5
|
from typing import TYPE_CHECKING, Literal, TypeAlias
|
|
7
6
|
|
|
8
7
|
from elizaos.types.generated.eliza.v1 import components_pb2
|
|
@@ -47,6 +46,7 @@ class PreEvaluatorResult:
|
|
|
47
46
|
rewritten_text: str | None = None
|
|
48
47
|
reason: str | None = None
|
|
49
48
|
|
|
49
|
+
|
|
50
50
|
# Proto-backed data types
|
|
51
51
|
ActionExample = components_pb2.ActionExample
|
|
52
52
|
ActionParameterSchema = components_pb2.ActionParameterSchema
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""Generated protobuf modules for elizaOS types.
|
|
2
|
+
|
|
3
|
+
This __init__.py adds the 'generated' directory to sys.path so that
|
|
4
|
+
protobuf-generated files can resolve ``from eliza.v1 import …`` imports.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import os
|
|
8
|
+
import sys
|
|
9
|
+
|
|
10
|
+
_generated_dir = os.path.dirname(os.path.abspath(__file__))
|
|
11
|
+
if _generated_dir not in sys.path:
|
|
12
|
+
sys.path.insert(0, _generated_dir)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: eliza/v1/agent.proto
|
|
5
|
+
# Protobuf Python Version: 6.33.5
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
33,
|
|
16
|
+
5,
|
|
17
|
+
'',
|
|
18
|
+
'eliza/v1/agent.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
from eliza.v1 import primitives_pb2 as eliza_dot_v1_dot_primitives__pb2
|
|
26
|
+
from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x65liza/v1/agent.proto\x12\x08\x65liza.v1\x1a\x19\x65liza/v1/primitives.proto\x1a\x1cgoogle/protobuf/struct.proto\"Q\n\x0eMessageExample\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12+\n\x07\x63ontent\x18\x02 \x01(\x0b\x32\x11.eliza.v1.ContentR\x07\x63ontent\"k\n\rKnowledgeItem\x12\x14\n\x04path\x18\x01 \x01(\tH\x00R\x04path\x12<\n\tdirectory\x18\x02 \x01(\x0b\x32\x1c.eliza.v1.KnowledgeDirectoryH\x00R\tdirectoryB\x06\n\x04item\"P\n\x12KnowledgeDirectory\x12\x12\n\x04path\x18\x01 \x01(\tR\x04path\x12\x1b\n\x06shared\x18\x02 \x01(\x08H\x00R\x06shared\x88\x01\x01\x42\t\n\x07_shared\"\xed\t\n\x11\x43haracterSettings\x12\x35\n\x14should_respond_model\x18\x01 \x01(\tH\x00R\x12shouldRespondModel\x88\x01\x01\x12)\n\x0euse_multi_step\x18\x02 \x01(\x08H\x01R\x0cuseMultiStep\x88\x01\x01\x12=\n\x18max_multistep_iterations\x18\x03 \x01(\x05H\x02R\x16maxMultistepIterations\x88\x01\x01\x12\x34\n\x13\x62ootstrap_defllmoff\x18\x04 \x01(\x08H\x03R\x12\x62ootstrapDefllmoff\x88\x01\x01\x12\x33\n\x13\x62ootstrap_keep_resp\x18\x05 \x01(\x08H\x04R\x11\x62ootstrapKeepResp\x88\x01\x01\x12@\n\x1aproviders_total_timeout_ms\x18\x06 \x01(\x05H\x05R\x17providersTotalTimeoutMs\x88\x01\x01\x12@\n\x1amax_working_memory_entries\x18\x07 \x01(\x05H\x06R\x17maxWorkingMemoryEntries\x88\x01\x01\x12;\n\x17\x61lways_respond_channels\x18\x08 \x01(\tH\x07R\x15\x61lwaysRespondChannels\x88\x01\x01\x12\x39\n\x16\x61lways_respond_sources\x18\t \x01(\tH\x08R\x14\x61lwaysRespondSources\x88\x01\x01\x12\x34\n\x13\x64\x65\x66\x61ult_temperature\x18\n \x01(\x01H\tR\x12\x64\x65\x66\x61ultTemperature\x88\x01\x01\x12\x31\n\x12\x64\x65\x66\x61ult_max_tokens\x18\x0b \x01(\x05H\nR\x10\x64\x65\x66\x61ultMaxTokens\x88\x01\x01\x12?\n\x19\x64\x65\x66\x61ult_frequency_penalty\x18\x0c \x01(\x01H\x0bR\x17\x64\x65\x66\x61ultFrequencyPenalty\x88\x01\x01\x12=\n\x18\x64\x65\x66\x61ult_presence_penalty\x18\r \x01(\x01H\x0cR\x16\x64\x65\x66\x61ultPresencePenalty\x88\x01\x01\x12\x41\n\x1a\x64isable_basic_capabilities\x18\x0e \x01(\x08H\rR\x18\x64isableBasicCapabilities\x88\x01\x01\x12-\n\x05\x65xtra\x18\x10 \x01(\x0b\x32\x17.google.protobuf.StructR\x05\x65xtraB\x17\n\x15_should_respond_modelB\x11\n\x0f_use_multi_stepB\x1b\n\x19_max_multistep_iterationsB\x16\n\x14_bootstrap_defllmoffB\x16\n\x14_bootstrap_keep_respB\x1d\n\x1b_providers_total_timeout_msB\x1d\n\x1b_max_working_memory_entriesB\x1a\n\x18_always_respond_channelsB\x19\n\x17_always_respond_sourcesB\x16\n\x14_default_temperatureB\x15\n\x13_default_max_tokensB\x1c\n\x1a_default_frequency_penaltyB\x1b\n\x19_default_presence_penaltyB\x1d\n\x1b_disable_basic_capabilities\"G\n\x0bStyleGuides\x12\x10\n\x03\x61ll\x18\x01 \x03(\tR\x03\x61ll\x12\x12\n\x04\x63hat\x18\x02 \x03(\tR\x04\x63hat\x12\x12\n\x04post\x18\x03 \x03(\tR\x04post\"\xa4\x07\n\tCharacter\x12\x13\n\x02id\x18\x01 \x01(\tH\x00R\x02id\x88\x01\x01\x12\x12\n\x04name\x18\x02 \x01(\tR\x04name\x12\x1f\n\x08username\x18\x03 \x01(\tH\x01R\x08username\x88\x01\x01\x12\x1b\n\x06system\x18\x04 \x01(\tH\x02R\x06system\x88\x01\x01\x12@\n\ttemplates\x18\x05 \x03(\x0b\x32\".eliza.v1.Character.TemplatesEntryR\ttemplates\x12\x10\n\x03\x62io\x18\x06 \x03(\tR\x03\x62io\x12H\n\x10message_examples\x18\x07 \x03(\x0b\x32\x1d.eliza.v1.MessageExampleGroupR\x0fmessageExamples\x12#\n\rpost_examples\x18\x08 \x03(\tR\x0cpostExamples\x12\x16\n\x06topics\x18\t \x03(\tR\x06topics\x12\x1e\n\nadjectives\x18\n \x03(\tR\nadjectives\x12\x35\n\tknowledge\x18\x0b \x03(\x0b\x32\x17.eliza.v1.KnowledgeItemR\tknowledge\x12\x18\n\x07plugins\x18\x0c \x03(\tR\x07plugins\x12<\n\x08settings\x18\r \x01(\x0b\x32\x1b.eliza.v1.CharacterSettingsH\x03R\x08settings\x88\x01\x01\x12:\n\x07secrets\x18\x0e \x03(\x0b\x32 .eliza.v1.Character.SecretsEntryR\x07secrets\x12\x30\n\x05style\x18\x0f \x01(\x0b\x32\x15.eliza.v1.StyleGuidesH\x04R\x05style\x88\x01\x01\x12\x30\n\x11\x61\x64vanced_planning\x18\x10 \x01(\x08H\x05R\x10\x61\x64vancedPlanning\x88\x01\x01\x12,\n\x0f\x61\x64vanced_memory\x18\x11 \x01(\x08H\x06R\x0e\x61\x64vancedMemory\x88\x01\x01\x1a<\n\x0eTemplatesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\x1a:\n\x0cSecretsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\x42\x05\n\x03_idB\x0b\n\t_usernameB\t\n\x07_systemB\x0b\n\t_settingsB\x08\n\x06_styleB\x14\n\x12_advanced_planningB\x12\n\x10_advanced_memory\"K\n\x13MessageExampleGroup\x12\x34\n\x08\x65xamples\x18\x01 \x03(\x0b\x32\x18.eliza.v1.MessageExampleR\x08\x65xamples\"\xd2\x01\n\x05\x41gent\x12\x31\n\tcharacter\x18\x01 \x01(\x0b\x32\x13.eliza.v1.CharacterR\tcharacter\x12\x1d\n\x07\x65nabled\x18\x02 \x01(\x08H\x00R\x07\x65nabled\x88\x01\x01\x12-\n\x06status\x18\x03 \x01(\x0e\x32\x15.eliza.v1.AgentStatusR\x06status\x12\x1d\n\ncreated_at\x18\x04 \x01(\x03R\tcreatedAt\x12\x1d\n\nupdated_at\x18\x05 \x01(\x03R\tupdatedAtB\n\n\x08_enabled*_\n\x0b\x41gentStatus\x12\x1c\n\x18\x41GENT_STATUS_UNSPECIFIED\x10\x00\x12\x17\n\x13\x41GENT_STATUS_ACTIVE\x10\x01\x12\x19\n\x15\x41GENT_STATUS_INACTIVE\x10\x02\x42\x8d\x01\n\x0c\x63om.eliza.v1B\nAgentProtoP\x01Z0github.com/elizaos/eliza/gen/go/eliza/v1;elizav1\xa2\x02\x03\x45XX\xaa\x02\x08\x45liza.V1\xca\x02\x08\x45liza\\V1\xe2\x02\x14\x45liza\\V1\\GPBMetadata\xea\x02\tEliza::V1b\x06proto3')
|
|
30
|
+
|
|
31
|
+
_globals = globals()
|
|
32
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
33
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'eliza.v1.agent_pb2', _globals)
|
|
34
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
35
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
36
|
+
_globals['DESCRIPTOR']._serialized_options = b'\n\014com.eliza.v1B\nAgentProtoP\001Z0github.com/elizaos/eliza/gen/go/eliza/v1;elizav1\242\002\003EXX\252\002\010Eliza.V1\312\002\010Eliza\\V1\342\002\024Eliza\\V1\\GPBMetadata\352\002\tEliza::V1'
|
|
37
|
+
_globals['_CHARACTER_TEMPLATESENTRY']._loaded_options = None
|
|
38
|
+
_globals['_CHARACTER_TEMPLATESENTRY']._serialized_options = b'8\001'
|
|
39
|
+
_globals['_CHARACTER_SECRETSENTRY']._loaded_options = None
|
|
40
|
+
_globals['_CHARACTER_SECRETSENTRY']._serialized_options = b'8\001'
|
|
41
|
+
_globals['_AGENTSTATUS']._serialized_start=2927
|
|
42
|
+
_globals['_AGENTSTATUS']._serialized_end=3022
|
|
43
|
+
_globals['_MESSAGEEXAMPLE']._serialized_start=91
|
|
44
|
+
_globals['_MESSAGEEXAMPLE']._serialized_end=172
|
|
45
|
+
_globals['_KNOWLEDGEITEM']._serialized_start=174
|
|
46
|
+
_globals['_KNOWLEDGEITEM']._serialized_end=281
|
|
47
|
+
_globals['_KNOWLEDGEDIRECTORY']._serialized_start=283
|
|
48
|
+
_globals['_KNOWLEDGEDIRECTORY']._serialized_end=363
|
|
49
|
+
_globals['_CHARACTERSETTINGS']._serialized_start=366
|
|
50
|
+
_globals['_CHARACTERSETTINGS']._serialized_end=1627
|
|
51
|
+
_globals['_STYLEGUIDES']._serialized_start=1629
|
|
52
|
+
_globals['_STYLEGUIDES']._serialized_end=1700
|
|
53
|
+
_globals['_CHARACTER']._serialized_start=1703
|
|
54
|
+
_globals['_CHARACTER']._serialized_end=2635
|
|
55
|
+
_globals['_CHARACTER_TEMPLATESENTRY']._serialized_start=2419
|
|
56
|
+
_globals['_CHARACTER_TEMPLATESENTRY']._serialized_end=2479
|
|
57
|
+
_globals['_CHARACTER_SECRETSENTRY']._serialized_start=2481
|
|
58
|
+
_globals['_CHARACTER_SECRETSENTRY']._serialized_end=2539
|
|
59
|
+
_globals['_MESSAGEEXAMPLEGROUP']._serialized_start=2637
|
|
60
|
+
_globals['_MESSAGEEXAMPLEGROUP']._serialized_end=2712
|
|
61
|
+
_globals['_AGENT']._serialized_start=2715
|
|
62
|
+
_globals['_AGENT']._serialized_end=2925
|
|
63
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
from eliza.v1 import primitives_pb2 as _primitives_pb2
|
|
2
|
+
from google.protobuf import struct_pb2 as _struct_pb2
|
|
3
|
+
from google.protobuf.internal import containers as _containers
|
|
4
|
+
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
|
|
5
|
+
from google.protobuf import descriptor as _descriptor
|
|
6
|
+
from google.protobuf import message as _message
|
|
7
|
+
from collections.abc import Iterable as _Iterable, Mapping as _Mapping
|
|
8
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
|
|
9
|
+
|
|
10
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
11
|
+
|
|
12
|
+
class AgentStatus(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
13
|
+
__slots__ = ()
|
|
14
|
+
AGENT_STATUS_UNSPECIFIED: _ClassVar[AgentStatus]
|
|
15
|
+
AGENT_STATUS_ACTIVE: _ClassVar[AgentStatus]
|
|
16
|
+
AGENT_STATUS_INACTIVE: _ClassVar[AgentStatus]
|
|
17
|
+
AGENT_STATUS_UNSPECIFIED: AgentStatus
|
|
18
|
+
AGENT_STATUS_ACTIVE: AgentStatus
|
|
19
|
+
AGENT_STATUS_INACTIVE: AgentStatus
|
|
20
|
+
|
|
21
|
+
class MessageExample(_message.Message):
|
|
22
|
+
__slots__ = ("name", "content")
|
|
23
|
+
NAME_FIELD_NUMBER: _ClassVar[int]
|
|
24
|
+
CONTENT_FIELD_NUMBER: _ClassVar[int]
|
|
25
|
+
name: str
|
|
26
|
+
content: _primitives_pb2.Content
|
|
27
|
+
def __init__(self, name: _Optional[str] = ..., content: _Optional[_Union[_primitives_pb2.Content, _Mapping]] = ...) -> None: ...
|
|
28
|
+
|
|
29
|
+
class KnowledgeItem(_message.Message):
|
|
30
|
+
__slots__ = ("path", "directory")
|
|
31
|
+
PATH_FIELD_NUMBER: _ClassVar[int]
|
|
32
|
+
DIRECTORY_FIELD_NUMBER: _ClassVar[int]
|
|
33
|
+
path: str
|
|
34
|
+
directory: KnowledgeDirectory
|
|
35
|
+
def __init__(self, path: _Optional[str] = ..., directory: _Optional[_Union[KnowledgeDirectory, _Mapping]] = ...) -> None: ...
|
|
36
|
+
|
|
37
|
+
class KnowledgeDirectory(_message.Message):
|
|
38
|
+
__slots__ = ("path", "shared")
|
|
39
|
+
PATH_FIELD_NUMBER: _ClassVar[int]
|
|
40
|
+
SHARED_FIELD_NUMBER: _ClassVar[int]
|
|
41
|
+
path: str
|
|
42
|
+
shared: bool
|
|
43
|
+
def __init__(self, path: _Optional[str] = ..., shared: _Optional[bool] = ...) -> None: ...
|
|
44
|
+
|
|
45
|
+
class CharacterSettings(_message.Message):
|
|
46
|
+
__slots__ = ("should_respond_model", "use_multi_step", "max_multistep_iterations", "bootstrap_defllmoff", "bootstrap_keep_resp", "providers_total_timeout_ms", "max_working_memory_entries", "always_respond_channels", "always_respond_sources", "default_temperature", "default_max_tokens", "default_frequency_penalty", "default_presence_penalty", "disable_basic_capabilities", "extra")
|
|
47
|
+
SHOULD_RESPOND_MODEL_FIELD_NUMBER: _ClassVar[int]
|
|
48
|
+
USE_MULTI_STEP_FIELD_NUMBER: _ClassVar[int]
|
|
49
|
+
MAX_MULTISTEP_ITERATIONS_FIELD_NUMBER: _ClassVar[int]
|
|
50
|
+
BOOTSTRAP_DEFLLMOFF_FIELD_NUMBER: _ClassVar[int]
|
|
51
|
+
BOOTSTRAP_KEEP_RESP_FIELD_NUMBER: _ClassVar[int]
|
|
52
|
+
PROVIDERS_TOTAL_TIMEOUT_MS_FIELD_NUMBER: _ClassVar[int]
|
|
53
|
+
MAX_WORKING_MEMORY_ENTRIES_FIELD_NUMBER: _ClassVar[int]
|
|
54
|
+
ALWAYS_RESPOND_CHANNELS_FIELD_NUMBER: _ClassVar[int]
|
|
55
|
+
ALWAYS_RESPOND_SOURCES_FIELD_NUMBER: _ClassVar[int]
|
|
56
|
+
DEFAULT_TEMPERATURE_FIELD_NUMBER: _ClassVar[int]
|
|
57
|
+
DEFAULT_MAX_TOKENS_FIELD_NUMBER: _ClassVar[int]
|
|
58
|
+
DEFAULT_FREQUENCY_PENALTY_FIELD_NUMBER: _ClassVar[int]
|
|
59
|
+
DEFAULT_PRESENCE_PENALTY_FIELD_NUMBER: _ClassVar[int]
|
|
60
|
+
DISABLE_BASIC_CAPABILITIES_FIELD_NUMBER: _ClassVar[int]
|
|
61
|
+
EXTRA_FIELD_NUMBER: _ClassVar[int]
|
|
62
|
+
should_respond_model: str
|
|
63
|
+
use_multi_step: bool
|
|
64
|
+
max_multistep_iterations: int
|
|
65
|
+
bootstrap_defllmoff: bool
|
|
66
|
+
bootstrap_keep_resp: bool
|
|
67
|
+
providers_total_timeout_ms: int
|
|
68
|
+
max_working_memory_entries: int
|
|
69
|
+
always_respond_channels: str
|
|
70
|
+
always_respond_sources: str
|
|
71
|
+
default_temperature: float
|
|
72
|
+
default_max_tokens: int
|
|
73
|
+
default_frequency_penalty: float
|
|
74
|
+
default_presence_penalty: float
|
|
75
|
+
disable_basic_capabilities: bool
|
|
76
|
+
extra: _struct_pb2.Struct
|
|
77
|
+
def __init__(self, should_respond_model: _Optional[str] = ..., use_multi_step: _Optional[bool] = ..., max_multistep_iterations: _Optional[int] = ..., bootstrap_defllmoff: _Optional[bool] = ..., bootstrap_keep_resp: _Optional[bool] = ..., providers_total_timeout_ms: _Optional[int] = ..., max_working_memory_entries: _Optional[int] = ..., always_respond_channels: _Optional[str] = ..., always_respond_sources: _Optional[str] = ..., default_temperature: _Optional[float] = ..., default_max_tokens: _Optional[int] = ..., default_frequency_penalty: _Optional[float] = ..., default_presence_penalty: _Optional[float] = ..., disable_basic_capabilities: _Optional[bool] = ..., extra: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ...) -> None: ...
|
|
78
|
+
|
|
79
|
+
class StyleGuides(_message.Message):
|
|
80
|
+
__slots__ = ("all", "chat", "post")
|
|
81
|
+
ALL_FIELD_NUMBER: _ClassVar[int]
|
|
82
|
+
CHAT_FIELD_NUMBER: _ClassVar[int]
|
|
83
|
+
POST_FIELD_NUMBER: _ClassVar[int]
|
|
84
|
+
all: _containers.RepeatedScalarFieldContainer[str]
|
|
85
|
+
chat: _containers.RepeatedScalarFieldContainer[str]
|
|
86
|
+
post: _containers.RepeatedScalarFieldContainer[str]
|
|
87
|
+
def __init__(self, all: _Optional[_Iterable[str]] = ..., chat: _Optional[_Iterable[str]] = ..., post: _Optional[_Iterable[str]] = ...) -> None: ...
|
|
88
|
+
|
|
89
|
+
class Character(_message.Message):
|
|
90
|
+
__slots__ = ("id", "name", "username", "system", "templates", "bio", "message_examples", "post_examples", "topics", "adjectives", "knowledge", "plugins", "settings", "secrets", "style", "advanced_planning", "advanced_memory")
|
|
91
|
+
class TemplatesEntry(_message.Message):
|
|
92
|
+
__slots__ = ("key", "value")
|
|
93
|
+
KEY_FIELD_NUMBER: _ClassVar[int]
|
|
94
|
+
VALUE_FIELD_NUMBER: _ClassVar[int]
|
|
95
|
+
key: str
|
|
96
|
+
value: str
|
|
97
|
+
def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ...
|
|
98
|
+
class SecretsEntry(_message.Message):
|
|
99
|
+
__slots__ = ("key", "value")
|
|
100
|
+
KEY_FIELD_NUMBER: _ClassVar[int]
|
|
101
|
+
VALUE_FIELD_NUMBER: _ClassVar[int]
|
|
102
|
+
key: str
|
|
103
|
+
value: str
|
|
104
|
+
def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ...
|
|
105
|
+
ID_FIELD_NUMBER: _ClassVar[int]
|
|
106
|
+
NAME_FIELD_NUMBER: _ClassVar[int]
|
|
107
|
+
USERNAME_FIELD_NUMBER: _ClassVar[int]
|
|
108
|
+
SYSTEM_FIELD_NUMBER: _ClassVar[int]
|
|
109
|
+
TEMPLATES_FIELD_NUMBER: _ClassVar[int]
|
|
110
|
+
BIO_FIELD_NUMBER: _ClassVar[int]
|
|
111
|
+
MESSAGE_EXAMPLES_FIELD_NUMBER: _ClassVar[int]
|
|
112
|
+
POST_EXAMPLES_FIELD_NUMBER: _ClassVar[int]
|
|
113
|
+
TOPICS_FIELD_NUMBER: _ClassVar[int]
|
|
114
|
+
ADJECTIVES_FIELD_NUMBER: _ClassVar[int]
|
|
115
|
+
KNOWLEDGE_FIELD_NUMBER: _ClassVar[int]
|
|
116
|
+
PLUGINS_FIELD_NUMBER: _ClassVar[int]
|
|
117
|
+
SETTINGS_FIELD_NUMBER: _ClassVar[int]
|
|
118
|
+
SECRETS_FIELD_NUMBER: _ClassVar[int]
|
|
119
|
+
STYLE_FIELD_NUMBER: _ClassVar[int]
|
|
120
|
+
ADVANCED_PLANNING_FIELD_NUMBER: _ClassVar[int]
|
|
121
|
+
ADVANCED_MEMORY_FIELD_NUMBER: _ClassVar[int]
|
|
122
|
+
id: str
|
|
123
|
+
name: str
|
|
124
|
+
username: str
|
|
125
|
+
system: str
|
|
126
|
+
templates: _containers.ScalarMap[str, str]
|
|
127
|
+
bio: _containers.RepeatedScalarFieldContainer[str]
|
|
128
|
+
message_examples: _containers.RepeatedCompositeFieldContainer[MessageExampleGroup]
|
|
129
|
+
post_examples: _containers.RepeatedScalarFieldContainer[str]
|
|
130
|
+
topics: _containers.RepeatedScalarFieldContainer[str]
|
|
131
|
+
adjectives: _containers.RepeatedScalarFieldContainer[str]
|
|
132
|
+
knowledge: _containers.RepeatedCompositeFieldContainer[KnowledgeItem]
|
|
133
|
+
plugins: _containers.RepeatedScalarFieldContainer[str]
|
|
134
|
+
settings: CharacterSettings
|
|
135
|
+
secrets: _containers.ScalarMap[str, str]
|
|
136
|
+
style: StyleGuides
|
|
137
|
+
advanced_planning: bool
|
|
138
|
+
advanced_memory: bool
|
|
139
|
+
def __init__(self, id: _Optional[str] = ..., name: _Optional[str] = ..., username: _Optional[str] = ..., system: _Optional[str] = ..., templates: _Optional[_Mapping[str, str]] = ..., bio: _Optional[_Iterable[str]] = ..., message_examples: _Optional[_Iterable[_Union[MessageExampleGroup, _Mapping]]] = ..., post_examples: _Optional[_Iterable[str]] = ..., topics: _Optional[_Iterable[str]] = ..., adjectives: _Optional[_Iterable[str]] = ..., knowledge: _Optional[_Iterable[_Union[KnowledgeItem, _Mapping]]] = ..., plugins: _Optional[_Iterable[str]] = ..., settings: _Optional[_Union[CharacterSettings, _Mapping]] = ..., secrets: _Optional[_Mapping[str, str]] = ..., style: _Optional[_Union[StyleGuides, _Mapping]] = ..., advanced_planning: _Optional[bool] = ..., advanced_memory: _Optional[bool] = ...) -> None: ...
|
|
140
|
+
|
|
141
|
+
class MessageExampleGroup(_message.Message):
|
|
142
|
+
__slots__ = ("examples",)
|
|
143
|
+
EXAMPLES_FIELD_NUMBER: _ClassVar[int]
|
|
144
|
+
examples: _containers.RepeatedCompositeFieldContainer[MessageExample]
|
|
145
|
+
def __init__(self, examples: _Optional[_Iterable[_Union[MessageExample, _Mapping]]] = ...) -> None: ...
|
|
146
|
+
|
|
147
|
+
class Agent(_message.Message):
|
|
148
|
+
__slots__ = ("character", "enabled", "status", "created_at", "updated_at")
|
|
149
|
+
CHARACTER_FIELD_NUMBER: _ClassVar[int]
|
|
150
|
+
ENABLED_FIELD_NUMBER: _ClassVar[int]
|
|
151
|
+
STATUS_FIELD_NUMBER: _ClassVar[int]
|
|
152
|
+
CREATED_AT_FIELD_NUMBER: _ClassVar[int]
|
|
153
|
+
UPDATED_AT_FIELD_NUMBER: _ClassVar[int]
|
|
154
|
+
character: Character
|
|
155
|
+
enabled: bool
|
|
156
|
+
status: AgentStatus
|
|
157
|
+
created_at: int
|
|
158
|
+
updated_at: int
|
|
159
|
+
def __init__(self, character: _Optional[_Union[Character, _Mapping]] = ..., enabled: _Optional[bool] = ..., status: _Optional[_Union[AgentStatus, str]] = ..., created_at: _Optional[int] = ..., updated_at: _Optional[int] = ...) -> None: ...
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: eliza/v1/components.proto
|
|
5
|
+
# Protobuf Python Version: 6.33.5
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
33,
|
|
16
|
+
5,
|
|
17
|
+
'',
|
|
18
|
+
'eliza/v1/components.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
from eliza.v1 import primitives_pb2 as eliza_dot_v1_dot_primitives__pb2
|
|
26
|
+
from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19\x65liza/v1/components.proto\x12\x08\x65liza.v1\x1a\x19\x65liza/v1/primitives.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xb8\x04\n\x15\x41\x63tionParameterSchema\x12\x12\n\x04type\x18\x01 \x01(\tR\x04type\x12%\n\x0b\x64\x65scription\x18\x02 \x01(\tH\x00R\x0b\x64\x65scription\x88\x01\x01\x12;\n\rdefault_value\x18\x03 \x01(\x0b\x32\x16.google.protobuf.ValueR\x0c\x64\x65\x66\x61ultValue\x12\x1f\n\x0b\x65num_values\x18\x04 \x03(\tR\nenumValues\x12O\n\nproperties\x18\x05 \x03(\x0b\x32/.eliza.v1.ActionParameterSchema.PropertiesEntryR\nproperties\x12:\n\x05items\x18\x06 \x01(\x0b\x32\x1f.eliza.v1.ActionParameterSchemaH\x01R\x05items\x88\x01\x01\x12\x1d\n\x07minimum\x18\x07 \x01(\x01H\x02R\x07minimum\x88\x01\x01\x12\x1d\n\x07maximum\x18\x08 \x01(\x01H\x03R\x07maximum\x88\x01\x01\x12\x1d\n\x07pattern\x18\t \x01(\tH\x04R\x07pattern\x88\x01\x01\x1a^\n\x0fPropertiesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x35\n\x05value\x18\x02 \x01(\x0b\x32\x1f.eliza.v1.ActionParameterSchemaR\x05value:\x02\x38\x01\x42\x0e\n\x0c_descriptionB\x08\n\x06_itemsB\n\n\x08_minimumB\n\n\x08_maximumB\n\n\x08_pattern\"\xae\x01\n\x0f\x41\x63tionParameter\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12 \n\x0b\x64\x65scription\x18\x02 \x01(\tR\x0b\x64\x65scription\x12\x1f\n\x08required\x18\x03 \x01(\x08H\x00R\x08required\x88\x01\x01\x12\x37\n\x06schema\x18\x04 \x01(\x0b\x32\x1f.eliza.v1.ActionParameterSchemaR\x06schemaB\x0b\n\t_required\"P\n\rActionExample\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12+\n\x07\x63ontent\x18\x02 \x01(\x0b\x32\x11.eliza.v1.ContentR\x07\x63ontent\"C\n\x10\x41\x63tionParameters\x12/\n\x06values\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructR\x06values\"\xcd\x01\n\x0c\x41\x63tionResult\x12\x18\n\x07success\x18\x01 \x01(\x08R\x07success\x12\x17\n\x04text\x18\x02 \x01(\tH\x00R\x04text\x88\x01\x01\x12/\n\x06values\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructR\x06values\x12+\n\x04\x64\x61ta\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructR\x04\x64\x61ta\x12\x19\n\x05\x65rror\x18\x05 \x01(\tH\x01R\x05\x65rror\x88\x01\x01\x42\x07\n\x05_textB\x08\n\x06_error\"R\n\rActionContext\x12\x41\n\x10previous_results\x18\x01 \x03(\x0b\x32\x16.eliza.v1.ActionResultR\x0fpreviousResults\"\xfc\x01\n\x0eHandlerOptions\x12\x43\n\x0e\x61\x63tion_context\x18\x01 \x01(\x0b\x32\x17.eliza.v1.ActionContextH\x00R\ractionContext\x88\x01\x01\x12-\n\x10\x61\x63tion_plan_json\x18\x02 \x01(\tH\x01R\x0e\x61\x63tionPlanJson\x88\x01\x01\x12?\n\nparameters\x18\x03 \x01(\x0b\x32\x1a.eliza.v1.ActionParametersH\x02R\nparameters\x88\x01\x01\x42\x11\n\x0f_action_contextB\x13\n\x11_action_plan_jsonB\r\n\x0b_parameters\"\x92\x02\n\x0e\x41\x63tionManifest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12 \n\x0b\x64\x65scription\x18\x02 \x01(\tR\x0b\x64\x65scription\x12\x18\n\x07similes\x18\x03 \x03(\tR\x07similes\x12\x33\n\x08\x65xamples\x18\x04 \x03(\x0b\x32\x17.eliza.v1.ActionExampleR\x08\x65xamples\x12\x1f\n\x08priority\x18\x05 \x01(\x05H\x00R\x08priority\x88\x01\x01\x12\x12\n\x04tags\x18\x06 \x03(\tR\x04tags\x12\x39\n\nparameters\x18\x07 \x03(\x0b\x32\x19.eliza.v1.ActionParameterR\nparametersB\x0b\n\t_priority\"\x90\x01\n\x0eProviderResult\x12\x17\n\x04text\x18\x01 \x01(\tH\x00R\x04text\x88\x01\x01\x12/\n\x06values\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructR\x06values\x12+\n\x04\x64\x61ta\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructR\x04\x64\x61taB\x07\n\x05_text\"\xe1\x01\n\x10ProviderManifest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12%\n\x0b\x64\x65scription\x18\x02 \x01(\tH\x00R\x0b\x64\x65scription\x88\x01\x01\x12\x1d\n\x07\x64ynamic\x18\x03 \x01(\x08H\x01R\x07\x64ynamic\x88\x01\x01\x12\x1f\n\x08position\x18\x04 \x01(\x05H\x02R\x08position\x88\x01\x01\x12\x1d\n\x07private\x18\x05 \x01(\x08H\x03R\x07private\x88\x01\x01\x42\x0e\n\x0c_descriptionB\n\n\x08_dynamicB\x0b\n\t_positionB\n\n\x08_private\"z\n\x11\x45valuationExample\x12\x16\n\x06prompt\x18\x01 \x01(\tR\x06prompt\x12\x33\n\x08messages\x18\x02 \x03(\x0b\x32\x17.eliza.v1.ActionExampleR\x08messages\x12\x18\n\x07outcome\x18\x03 \x01(\tR\x07outcome\"\xcf\x01\n\x11\x45valuatorManifest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12 \n\x0b\x64\x65scription\x18\x02 \x01(\tR\x0b\x64\x65scription\x12\"\n\nalways_run\x18\x03 \x01(\x08H\x00R\talwaysRun\x88\x01\x01\x12\x18\n\x07similes\x18\x04 \x03(\tR\x07similes\x12\x37\n\x08\x65xamples\x18\x05 \x03(\x0b\x32\x1b.eliza.v1.EvaluationExampleR\x08\x65xamplesB\r\n\x0b_always_runB\x92\x01\n\x0c\x63om.eliza.v1B\x0f\x43omponentsProtoP\x01Z0github.com/elizaos/eliza/gen/go/eliza/v1;elizav1\xa2\x02\x03\x45XX\xaa\x02\x08\x45liza.V1\xca\x02\x08\x45liza\\V1\xe2\x02\x14\x45liza\\V1\\GPBMetadata\xea\x02\tEliza::V1b\x06proto3')
|
|
30
|
+
|
|
31
|
+
_globals = globals()
|
|
32
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
33
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'eliza.v1.components_pb2', _globals)
|
|
34
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
35
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
36
|
+
_globals['DESCRIPTOR']._serialized_options = b'\n\014com.eliza.v1B\017ComponentsProtoP\001Z0github.com/elizaos/eliza/gen/go/eliza/v1;elizav1\242\002\003EXX\252\002\010Eliza.V1\312\002\010Eliza\\V1\342\002\024Eliza\\V1\\GPBMetadata\352\002\tEliza::V1'
|
|
37
|
+
_globals['_ACTIONPARAMETERSCHEMA_PROPERTIESENTRY']._loaded_options = None
|
|
38
|
+
_globals['_ACTIONPARAMETERSCHEMA_PROPERTIESENTRY']._serialized_options = b'8\001'
|
|
39
|
+
_globals['_ACTIONPARAMETERSCHEMA']._serialized_start=97
|
|
40
|
+
_globals['_ACTIONPARAMETERSCHEMA']._serialized_end=665
|
|
41
|
+
_globals['_ACTIONPARAMETERSCHEMA_PROPERTIESENTRY']._serialized_start=509
|
|
42
|
+
_globals['_ACTIONPARAMETERSCHEMA_PROPERTIESENTRY']._serialized_end=603
|
|
43
|
+
_globals['_ACTIONPARAMETER']._serialized_start=668
|
|
44
|
+
_globals['_ACTIONPARAMETER']._serialized_end=842
|
|
45
|
+
_globals['_ACTIONEXAMPLE']._serialized_start=844
|
|
46
|
+
_globals['_ACTIONEXAMPLE']._serialized_end=924
|
|
47
|
+
_globals['_ACTIONPARAMETERS']._serialized_start=926
|
|
48
|
+
_globals['_ACTIONPARAMETERS']._serialized_end=993
|
|
49
|
+
_globals['_ACTIONRESULT']._serialized_start=996
|
|
50
|
+
_globals['_ACTIONRESULT']._serialized_end=1201
|
|
51
|
+
_globals['_ACTIONCONTEXT']._serialized_start=1203
|
|
52
|
+
_globals['_ACTIONCONTEXT']._serialized_end=1285
|
|
53
|
+
_globals['_HANDLEROPTIONS']._serialized_start=1288
|
|
54
|
+
_globals['_HANDLEROPTIONS']._serialized_end=1540
|
|
55
|
+
_globals['_ACTIONMANIFEST']._serialized_start=1543
|
|
56
|
+
_globals['_ACTIONMANIFEST']._serialized_end=1817
|
|
57
|
+
_globals['_PROVIDERRESULT']._serialized_start=1820
|
|
58
|
+
_globals['_PROVIDERRESULT']._serialized_end=1964
|
|
59
|
+
_globals['_PROVIDERMANIFEST']._serialized_start=1967
|
|
60
|
+
_globals['_PROVIDERMANIFEST']._serialized_end=2192
|
|
61
|
+
_globals['_EVALUATIONEXAMPLE']._serialized_start=2194
|
|
62
|
+
_globals['_EVALUATIONEXAMPLE']._serialized_end=2316
|
|
63
|
+
_globals['_EVALUATORMANIFEST']._serialized_start=2319
|
|
64
|
+
_globals['_EVALUATORMANIFEST']._serialized_end=2526
|
|
65
|
+
# @@protoc_insertion_point(module_scope)
|