@elizaos/python 2.0.0-alpha.10 → 2.0.0-alpha.11
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/actions/schedule_follow_up.py +70 -15
- package/elizaos/advanced_capabilities/actions/send_message.py +9 -184
- package/elizaos/advanced_memory/memory_service.py +15 -17
- package/elizaos/advanced_planning/planning_service.py +26 -14
- package/elizaos/basic_capabilities/providers/actions.py +118 -29
- package/elizaos/basic_capabilities/providers/character.py +19 -21
- package/elizaos/basic_capabilities/providers/current_time.py +7 -4
- 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/service.py +230 -28
- 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 +1 -0
- 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/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 +152 -39
- package/elizaos/services/message_service.py +2 -6
- 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 +161 -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 +3 -0
- package/elizaos/types/runtime.py +1 -1
- package/package.json +3 -2
- package/tests/test_action_parameters.py +2 -3
- 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_autonomy.py +11 -1
- 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/uv.lock +1565 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
from google.protobuf import struct_pb2 as _struct_pb2
|
|
2
|
+
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
|
|
3
|
+
from google.protobuf import descriptor as _descriptor
|
|
4
|
+
from google.protobuf import message as _message
|
|
5
|
+
from collections.abc import Mapping as _Mapping
|
|
6
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
|
|
7
|
+
|
|
8
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
9
|
+
|
|
10
|
+
class TEEMode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
11
|
+
__slots__ = ()
|
|
12
|
+
TEE_MODE_UNSPECIFIED: _ClassVar[TEEMode]
|
|
13
|
+
TEE_MODE_OFF: _ClassVar[TEEMode]
|
|
14
|
+
TEE_MODE_LOCAL: _ClassVar[TEEMode]
|
|
15
|
+
TEE_MODE_DOCKER: _ClassVar[TEEMode]
|
|
16
|
+
TEE_MODE_PRODUCTION: _ClassVar[TEEMode]
|
|
17
|
+
|
|
18
|
+
class TeeType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
19
|
+
__slots__ = ()
|
|
20
|
+
TEE_TYPE_UNSPECIFIED: _ClassVar[TeeType]
|
|
21
|
+
TEE_TYPE_TDX_DSTACK: _ClassVar[TeeType]
|
|
22
|
+
TEE_MODE_UNSPECIFIED: TEEMode
|
|
23
|
+
TEE_MODE_OFF: TEEMode
|
|
24
|
+
TEE_MODE_LOCAL: TEEMode
|
|
25
|
+
TEE_MODE_DOCKER: TEEMode
|
|
26
|
+
TEE_MODE_PRODUCTION: TEEMode
|
|
27
|
+
TEE_TYPE_UNSPECIFIED: TeeType
|
|
28
|
+
TEE_TYPE_TDX_DSTACK: TeeType
|
|
29
|
+
|
|
30
|
+
class TeeAgent(_message.Message):
|
|
31
|
+
__slots__ = ("id", "agent_id", "agent_name", "created_at", "public_key", "attestation")
|
|
32
|
+
ID_FIELD_NUMBER: _ClassVar[int]
|
|
33
|
+
AGENT_ID_FIELD_NUMBER: _ClassVar[int]
|
|
34
|
+
AGENT_NAME_FIELD_NUMBER: _ClassVar[int]
|
|
35
|
+
CREATED_AT_FIELD_NUMBER: _ClassVar[int]
|
|
36
|
+
PUBLIC_KEY_FIELD_NUMBER: _ClassVar[int]
|
|
37
|
+
ATTESTATION_FIELD_NUMBER: _ClassVar[int]
|
|
38
|
+
id: str
|
|
39
|
+
agent_id: str
|
|
40
|
+
agent_name: str
|
|
41
|
+
created_at: int
|
|
42
|
+
public_key: str
|
|
43
|
+
attestation: str
|
|
44
|
+
def __init__(self, id: _Optional[str] = ..., agent_id: _Optional[str] = ..., agent_name: _Optional[str] = ..., created_at: _Optional[int] = ..., public_key: _Optional[str] = ..., attestation: _Optional[str] = ...) -> None: ...
|
|
45
|
+
|
|
46
|
+
class RemoteAttestationQuote(_message.Message):
|
|
47
|
+
__slots__ = ("quote", "timestamp")
|
|
48
|
+
QUOTE_FIELD_NUMBER: _ClassVar[int]
|
|
49
|
+
TIMESTAMP_FIELD_NUMBER: _ClassVar[int]
|
|
50
|
+
quote: str
|
|
51
|
+
timestamp: int
|
|
52
|
+
def __init__(self, quote: _Optional[str] = ..., timestamp: _Optional[int] = ...) -> None: ...
|
|
53
|
+
|
|
54
|
+
class DeriveKeyAttestationData(_message.Message):
|
|
55
|
+
__slots__ = ("agent_id", "public_key", "subject")
|
|
56
|
+
AGENT_ID_FIELD_NUMBER: _ClassVar[int]
|
|
57
|
+
PUBLIC_KEY_FIELD_NUMBER: _ClassVar[int]
|
|
58
|
+
SUBJECT_FIELD_NUMBER: _ClassVar[int]
|
|
59
|
+
agent_id: str
|
|
60
|
+
public_key: str
|
|
61
|
+
subject: str
|
|
62
|
+
def __init__(self, agent_id: _Optional[str] = ..., public_key: _Optional[str] = ..., subject: _Optional[str] = ...) -> None: ...
|
|
63
|
+
|
|
64
|
+
class AttestedMessage(_message.Message):
|
|
65
|
+
__slots__ = ("entity_id", "room_id", "content")
|
|
66
|
+
ENTITY_ID_FIELD_NUMBER: _ClassVar[int]
|
|
67
|
+
ROOM_ID_FIELD_NUMBER: _ClassVar[int]
|
|
68
|
+
CONTENT_FIELD_NUMBER: _ClassVar[int]
|
|
69
|
+
entity_id: str
|
|
70
|
+
room_id: str
|
|
71
|
+
content: str
|
|
72
|
+
def __init__(self, entity_id: _Optional[str] = ..., room_id: _Optional[str] = ..., content: _Optional[str] = ...) -> None: ...
|
|
73
|
+
|
|
74
|
+
class RemoteAttestationMessage(_message.Message):
|
|
75
|
+
__slots__ = ("agent_id", "timestamp", "message")
|
|
76
|
+
AGENT_ID_FIELD_NUMBER: _ClassVar[int]
|
|
77
|
+
TIMESTAMP_FIELD_NUMBER: _ClassVar[int]
|
|
78
|
+
MESSAGE_FIELD_NUMBER: _ClassVar[int]
|
|
79
|
+
agent_id: str
|
|
80
|
+
timestamp: int
|
|
81
|
+
message: AttestedMessage
|
|
82
|
+
def __init__(self, agent_id: _Optional[str] = ..., timestamp: _Optional[int] = ..., message: _Optional[_Union[AttestedMessage, _Mapping]] = ...) -> None: ...
|
|
83
|
+
|
|
84
|
+
class TeePluginConfig(_message.Message):
|
|
85
|
+
__slots__ = ("vendor", "vendor_config")
|
|
86
|
+
VENDOR_FIELD_NUMBER: _ClassVar[int]
|
|
87
|
+
VENDOR_CONFIG_FIELD_NUMBER: _ClassVar[int]
|
|
88
|
+
vendor: str
|
|
89
|
+
vendor_config: _struct_pb2.Struct
|
|
90
|
+
def __init__(self, vendor: _Optional[str] = ..., vendor_config: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ...) -> None: ...
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: eliza/v1/testing.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/testing.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16\x65liza/v1/testing.proto\x12\x08\x65liza.v1\"Q\n\x08TestCase\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\"\n\nhandler_id\x18\x02 \x01(\tH\x00R\thandlerId\x88\x01\x01\x42\r\n\x0b_handler_id\"I\n\tTestSuite\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12(\n\x05tests\x18\x02 \x03(\x0b\x32\x12.eliza.v1.TestCaseR\x05testsB\x8f\x01\n\x0c\x63om.eliza.v1B\x0cTestingProtoP\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')
|
|
28
|
+
|
|
29
|
+
_globals = globals()
|
|
30
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
31
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'eliza.v1.testing_pb2', _globals)
|
|
32
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
33
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
34
|
+
_globals['DESCRIPTOR']._serialized_options = b'\n\014com.eliza.v1B\014TestingProtoP\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'
|
|
35
|
+
_globals['_TESTCASE']._serialized_start=36
|
|
36
|
+
_globals['_TESTCASE']._serialized_end=117
|
|
37
|
+
_globals['_TESTSUITE']._serialized_start=119
|
|
38
|
+
_globals['_TESTSUITE']._serialized_end=192
|
|
39
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from google.protobuf.internal import containers as _containers
|
|
2
|
+
from google.protobuf import descriptor as _descriptor
|
|
3
|
+
from google.protobuf import message as _message
|
|
4
|
+
from collections.abc import Iterable as _Iterable, Mapping as _Mapping
|
|
5
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
|
|
6
|
+
|
|
7
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
8
|
+
|
|
9
|
+
class TestCase(_message.Message):
|
|
10
|
+
__slots__ = ("name", "handler_id")
|
|
11
|
+
NAME_FIELD_NUMBER: _ClassVar[int]
|
|
12
|
+
HANDLER_ID_FIELD_NUMBER: _ClassVar[int]
|
|
13
|
+
name: str
|
|
14
|
+
handler_id: str
|
|
15
|
+
def __init__(self, name: _Optional[str] = ..., handler_id: _Optional[str] = ...) -> None: ...
|
|
16
|
+
|
|
17
|
+
class TestSuite(_message.Message):
|
|
18
|
+
__slots__ = ("name", "tests")
|
|
19
|
+
NAME_FIELD_NUMBER: _ClassVar[int]
|
|
20
|
+
TESTS_FIELD_NUMBER: _ClassVar[int]
|
|
21
|
+
name: str
|
|
22
|
+
tests: _containers.RepeatedCompositeFieldContainer[TestCase]
|
|
23
|
+
def __init__(self, name: _Optional[str] = ..., tests: _Optional[_Iterable[_Union[TestCase, _Mapping]]] = ...) -> None: ...
|
package/elizaos/types/model.py
CHANGED
package/elizaos/types/runtime.py
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/python",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.11",
|
|
4
4
|
"description": "elizaOS Core - Python runtime and types",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -15,5 +15,6 @@
|
|
|
15
15
|
"typecheck": "python3.13 -m mypy elizaos || echo 'mypy not installed, skipping typecheck'"
|
|
16
16
|
},
|
|
17
17
|
"author": "elizaOS",
|
|
18
|
-
"license": "MIT"
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"gitHead": "33e7c7ee0c64f519085218c9f53997a6c5740808"
|
|
19
20
|
}
|
|
@@ -19,7 +19,6 @@ from elizaos.types import (
|
|
|
19
19
|
)
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
@pytest.mark.skip(reason="Content proto doesn't have params field")
|
|
23
22
|
@pytest.mark.asyncio
|
|
24
23
|
async def test_process_actions_passes_validated_params_to_handler_options() -> None:
|
|
25
24
|
character = Character(name="ParamAgent", bio=["Test agent"], system="Test")
|
|
@@ -83,10 +82,10 @@ async def test_process_actions_passes_validated_params_to_handler_options() -> N
|
|
|
83
82
|
|
|
84
83
|
await runtime.process_actions(message, [response], state=None, callback=None)
|
|
85
84
|
|
|
86
|
-
|
|
85
|
+
# Content proto has no params field, so schema defaults are applied.
|
|
86
|
+
assert received == ["north"]
|
|
87
87
|
|
|
88
88
|
|
|
89
|
-
@pytest.mark.skip(reason="Content proto doesn't have params field")
|
|
90
89
|
@pytest.mark.asyncio
|
|
91
90
|
async def test_process_actions_skips_action_when_required_param_missing() -> None:
|
|
92
91
|
character = Character(name="ParamAgent", bio=["Test agent"], system="Test")
|
|
@@ -11,7 +11,6 @@ from elizaos.types.memory import Memory
|
|
|
11
11
|
from elizaos.types.primitives import Content, as_uuid
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
@pytest.mark.skip(reason="MemoryService requires runtime settings.get() which isn't implemented")
|
|
15
14
|
@pytest.mark.asyncio
|
|
16
15
|
async def test_memory_provider_formats_long_term_memories() -> None:
|
|
17
16
|
runtime = AgentRuntime(
|
|
@@ -49,7 +48,6 @@ async def test_memory_provider_formats_long_term_memories() -> None:
|
|
|
49
48
|
assert result.text and "What I Know About You" in result.text
|
|
50
49
|
|
|
51
50
|
|
|
52
|
-
@pytest.mark.skip(reason="MemoryService runtime not set")
|
|
53
51
|
@pytest.mark.asyncio
|
|
54
52
|
async def test_get_long_term_memories_returns_top_confidence() -> None:
|
|
55
53
|
svc = MemoryService(runtime=None)
|
|
@@ -6,7 +6,6 @@ from elizaos.runtime import AgentRuntime
|
|
|
6
6
|
from elizaos.types.agent import Character
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
@pytest.mark.skip(reason="MemoryService requires runtime settings.get() which isn't implemented")
|
|
10
9
|
@pytest.mark.asyncio
|
|
11
10
|
async def test_advanced_memory_autoloads_when_enabled() -> None:
|
|
12
11
|
runtime = AgentRuntime(
|
|
@@ -19,7 +18,6 @@ async def test_advanced_memory_autoloads_when_enabled() -> None:
|
|
|
19
18
|
assert any(e.name == "MEMORY_SUMMARIZATION" for e in runtime.evaluators)
|
|
20
19
|
|
|
21
20
|
|
|
22
|
-
@pytest.mark.skip(reason="MemoryService requires runtime settings.get() which isn't implemented")
|
|
23
21
|
@pytest.mark.asyncio
|
|
24
22
|
async def test_advanced_memory_not_loaded_when_disabled() -> None:
|
|
25
23
|
runtime = AgentRuntime(
|
|
@@ -4,6 +4,7 @@ from typing import Any
|
|
|
4
4
|
from uuid import uuid4
|
|
5
5
|
|
|
6
6
|
import pytest
|
|
7
|
+
from google.protobuf.json_format import MessageToDict
|
|
7
8
|
|
|
8
9
|
from elizaos.advanced_planning.planning_service import ActionPlan, ActionStep
|
|
9
10
|
from elizaos.runtime import AgentRuntime
|
|
@@ -15,7 +16,6 @@ from elizaos.types.model import ModelType
|
|
|
15
16
|
from elizaos.types.primitives import Content, as_uuid
|
|
16
17
|
|
|
17
18
|
|
|
18
|
-
@pytest.mark.skip(reason="State.values.extra access issue with protobuf")
|
|
19
19
|
@pytest.mark.asyncio
|
|
20
20
|
async def test_advanced_planning_provider_parses_model_output() -> None:
|
|
21
21
|
character = Character(name="AdvPlanningProvider", bio=["Test"], advanced_planning=True)
|
|
@@ -49,7 +49,13 @@ async def test_advanced_planning_provider_parses_model_output() -> None:
|
|
|
49
49
|
state = await runtime.compose_state(msg)
|
|
50
50
|
result = await provider.get(runtime, msg, state)
|
|
51
51
|
assert result.data is not None
|
|
52
|
-
|
|
52
|
+
parsed_data = (
|
|
53
|
+
MessageToDict(result.data, preserving_proto_field_name=True)
|
|
54
|
+
if hasattr(result.data, "DESCRIPTOR")
|
|
55
|
+
else result.data
|
|
56
|
+
)
|
|
57
|
+
assert isinstance(parsed_data, dict)
|
|
58
|
+
assert parsed_data.get("planningRequired") is True
|
|
53
59
|
|
|
54
60
|
|
|
55
61
|
@pytest.mark.asyncio
|
|
@@ -72,7 +78,6 @@ async def test_advanced_planning_service_creates_simple_plan() -> None:
|
|
|
72
78
|
assert any(step.action_name == "SEND_EMAIL" for step in plan.steps)
|
|
73
79
|
|
|
74
80
|
|
|
75
|
-
@pytest.mark.skip(reason="State.values.extra access issue with protobuf")
|
|
76
81
|
@pytest.mark.asyncio
|
|
77
82
|
async def test_advanced_planning_service_creates_comprehensive_plan_and_executes() -> None:
|
|
78
83
|
character = Character(name="AdvPlanningSvcExec", bio=["Test"], advanced_planning=True)
|
|
@@ -124,7 +129,6 @@ async def test_advanced_planning_service_creates_comprehensive_plan_and_executes
|
|
|
124
129
|
assert result.total_steps >= 1
|
|
125
130
|
|
|
126
131
|
|
|
127
|
-
@pytest.mark.skip(reason="validate lambda returns bool, not coroutine")
|
|
128
132
|
@pytest.mark.asyncio
|
|
129
133
|
async def test_advanced_planning_dag_executes_in_dependency_order() -> None:
|
|
130
134
|
character = Character(name="AdvPlanningDag", bio=["Test"], advanced_planning=True)
|
|
@@ -220,6 +224,8 @@ async def test_advanced_planning_dag_executes_in_dependency_order() -> None:
|
|
|
220
224
|
content=Content(text="run"),
|
|
221
225
|
)
|
|
222
226
|
state = await runtime.compose_state(msg)
|
|
223
|
-
await planning_service.execute_plan(plan, msg, state=state, callback=None)
|
|
227
|
+
execution_result = await planning_service.execute_plan(plan, msg, state=state, callback=None)
|
|
224
228
|
|
|
229
|
+
assert execution_result.success is True
|
|
230
|
+
assert execution_result.completed_steps == 3
|
|
225
231
|
assert execution_order == ["STEP_A", "STEP_B", "STEP_C"]
|
package/tests/test_autonomy.py
CHANGED
|
@@ -11,9 +11,10 @@ from elizaos.bootstrap.autonomy import (
|
|
|
11
11
|
autonomy_status_provider,
|
|
12
12
|
send_to_admin_action,
|
|
13
13
|
)
|
|
14
|
+
from elizaos.bootstrap.autonomy.service import AUTONOMY_TASK_TAGS
|
|
14
15
|
from elizaos.bootstrap.autonomy.types import AutonomyStatus
|
|
15
16
|
from elizaos.types.memory import Memory
|
|
16
|
-
from elizaos.types.primitives import Content, as_uuid
|
|
17
|
+
from elizaos.types.primitives import Content, as_uuid, string_to_uuid
|
|
17
18
|
|
|
18
19
|
TEST_AGENT_ID = "00000000-0000-0000-0000-000000000001"
|
|
19
20
|
TEST_ROOM_ID = "00000000-0000-0000-0000-000000000002"
|
|
@@ -75,6 +76,9 @@ class TestAutonomyService:
|
|
|
75
76
|
assert AutonomyService.service_type == AUTONOMY_SERVICE_TYPE
|
|
76
77
|
assert AutonomyService.service_type == "AUTONOMY"
|
|
77
78
|
|
|
79
|
+
def test_task_tags_match_typescript(self):
|
|
80
|
+
assert AUTONOMY_TASK_TAGS == ["queue", "repeat", "autonomy"]
|
|
81
|
+
|
|
78
82
|
@pytest.mark.asyncio
|
|
79
83
|
async def test_start_creates_service(self, test_runtime):
|
|
80
84
|
service = await AutonomyService.start(test_runtime)
|
|
@@ -85,6 +89,12 @@ class TestAutonomyService:
|
|
|
85
89
|
assert service.get_loop_interval() == 30000
|
|
86
90
|
assert service.get_autonomous_room_id() is not None
|
|
87
91
|
|
|
92
|
+
@pytest.mark.asyncio
|
|
93
|
+
async def test_autonomous_room_id_is_deterministic(self, test_runtime):
|
|
94
|
+
service = await AutonomyService.start(test_runtime)
|
|
95
|
+
expected_room_id = as_uuid(string_to_uuid(f"autonomy-room-{test_runtime.agent_id}"))
|
|
96
|
+
assert service.get_autonomous_room_id() == expected_room_id
|
|
97
|
+
|
|
88
98
|
@pytest.mark.asyncio
|
|
89
99
|
async def test_auto_start_when_enabled(self, test_runtime):
|
|
90
100
|
test_runtime.enable_autonomy = True
|
package/tests/test_runtime.py
CHANGED
|
@@ -59,17 +59,15 @@ class TestAgentRuntimeSettings:
|
|
|
59
59
|
runtime.set_setting("test_key", "test_value")
|
|
60
60
|
assert runtime.get_setting("test_key") == "test_value"
|
|
61
61
|
|
|
62
|
-
@pytest.mark.skip(reason="CharacterSettings proto doesn't support arbitrary fields")
|
|
63
62
|
def test_get_setting_from_character(self) -> None:
|
|
64
63
|
character = Character(
|
|
65
64
|
name="Test",
|
|
66
65
|
bio=["Test"],
|
|
67
|
-
settings={"char_setting": "char_value"},
|
|
66
|
+
settings={"extra": {"char_setting": "char_value"}},
|
|
68
67
|
)
|
|
69
68
|
runtime = AgentRuntime(character=character)
|
|
70
69
|
assert runtime.get_setting("char_setting") == "char_value"
|
|
71
70
|
|
|
72
|
-
@pytest.mark.skip(reason="Runtime get_setting from secrets not yet implemented")
|
|
73
71
|
def test_get_setting_from_secrets(self) -> None:
|
|
74
72
|
character = Character(
|
|
75
73
|
name="Test",
|
|
@@ -305,42 +303,38 @@ class TestAgentRuntimeLLMMode:
|
|
|
305
303
|
runtime = AgentRuntime(character=character, llm_mode=LLMMode.LARGE)
|
|
306
304
|
assert runtime.get_llm_mode() == LLMMode.LARGE
|
|
307
305
|
|
|
308
|
-
@pytest.mark.skip(reason="CharacterSettings proto doesn't have LLM_MODE field")
|
|
309
306
|
def test_character_setting_small(self) -> None:
|
|
310
307
|
character = Character(
|
|
311
308
|
name="Test",
|
|
312
309
|
bio=["Test"],
|
|
313
|
-
settings={"LLM_MODE": "SMALL"},
|
|
310
|
+
settings={"extra": {"LLM_MODE": "SMALL"}},
|
|
314
311
|
)
|
|
315
312
|
runtime = AgentRuntime(character=character)
|
|
316
313
|
assert runtime.get_llm_mode() == LLMMode.SMALL
|
|
317
314
|
|
|
318
|
-
@pytest.mark.skip(reason="CharacterSettings proto doesn't have LLM_MODE field")
|
|
319
315
|
def test_constructor_option_takes_precedence(self) -> None:
|
|
320
316
|
character = Character(
|
|
321
317
|
name="Test",
|
|
322
318
|
bio=["Test"],
|
|
323
|
-
settings={"LLM_MODE": "SMALL"},
|
|
319
|
+
settings={"extra": {"LLM_MODE": "SMALL"}},
|
|
324
320
|
)
|
|
325
321
|
runtime = AgentRuntime(character=character, llm_mode=LLMMode.LARGE)
|
|
326
322
|
assert runtime.get_llm_mode() == LLMMode.LARGE
|
|
327
323
|
|
|
328
|
-
@pytest.mark.skip(reason="CharacterSettings proto doesn't have LLM_MODE field")
|
|
329
324
|
def test_case_insensitive_character_setting(self) -> None:
|
|
330
325
|
character = Character(
|
|
331
326
|
name="Test",
|
|
332
327
|
bio=["Test"],
|
|
333
|
-
settings={"LLM_MODE": "small"},
|
|
328
|
+
settings={"extra": {"LLM_MODE": "small"}},
|
|
334
329
|
)
|
|
335
330
|
runtime = AgentRuntime(character=character)
|
|
336
331
|
assert runtime.get_llm_mode() == LLMMode.SMALL
|
|
337
332
|
|
|
338
|
-
@pytest.mark.skip(reason="CharacterSettings proto doesn't have LLM_MODE field")
|
|
339
333
|
def test_invalid_setting_defaults_to_default(self) -> None:
|
|
340
334
|
character = Character(
|
|
341
335
|
name="Test",
|
|
342
336
|
bio=["Test"],
|
|
343
|
-
settings={"LLM_MODE": "invalid"},
|
|
337
|
+
settings={"extra": {"LLM_MODE": "invalid"}},
|
|
344
338
|
)
|
|
345
339
|
runtime = AgentRuntime(character=character)
|
|
346
340
|
assert runtime.get_llm_mode() == LLMMode.DEFAULT
|
|
@@ -391,32 +385,29 @@ class TestAgentRuntimeCheckShouldRespond:
|
|
|
391
385
|
runtime = AgentRuntime(character=character, check_should_respond=True)
|
|
392
386
|
assert runtime.is_check_should_respond_enabled() is True
|
|
393
387
|
|
|
394
|
-
@pytest.mark.skip(reason="CharacterSettings proto doesn't have CHECK_SHOULD_RESPOND field")
|
|
395
388
|
def test_character_setting_false(self) -> None:
|
|
396
389
|
character = Character(
|
|
397
390
|
name="Test",
|
|
398
391
|
bio=["Test"],
|
|
399
|
-
settings={"CHECK_SHOULD_RESPOND": "false"},
|
|
392
|
+
settings={"extra": {"CHECK_SHOULD_RESPOND": "false"}},
|
|
400
393
|
)
|
|
401
394
|
runtime = AgentRuntime(character=character)
|
|
402
395
|
assert runtime.is_check_should_respond_enabled() is False
|
|
403
396
|
|
|
404
|
-
@pytest.mark.skip(reason="CharacterSettings proto doesn't have CHECK_SHOULD_RESPOND field")
|
|
405
397
|
def test_constructor_option_takes_precedence(self) -> None:
|
|
406
398
|
character = Character(
|
|
407
399
|
name="Test",
|
|
408
400
|
bio=["Test"],
|
|
409
|
-
settings={"CHECK_SHOULD_RESPOND": "false"},
|
|
401
|
+
settings={"extra": {"CHECK_SHOULD_RESPOND": "false"}},
|
|
410
402
|
)
|
|
411
403
|
runtime = AgentRuntime(character=character, check_should_respond=True)
|
|
412
404
|
assert runtime.is_check_should_respond_enabled() is True
|
|
413
405
|
|
|
414
|
-
@pytest.mark.skip(reason="CharacterSettings proto doesn't have CHECK_SHOULD_RESPOND field")
|
|
415
406
|
def test_non_false_string_defaults_to_true(self) -> None:
|
|
416
407
|
character = Character(
|
|
417
408
|
name="Test",
|
|
418
409
|
bio=["Test"],
|
|
419
|
-
settings={"CHECK_SHOULD_RESPOND": "yes"},
|
|
410
|
+
settings={"extra": {"CHECK_SHOULD_RESPOND": "yes"}},
|
|
420
411
|
)
|
|
421
412
|
runtime = AgentRuntime(character=character)
|
|
422
413
|
assert runtime.is_check_should_respond_enabled() is True
|