nora-lib 0.0.6.dev1__tar.gz → 0.0.7.dev0__tar.gz
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.
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev0}/PKG-INFO +1 -1
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev0}/nora_lib/interactions/models.py +12 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev0}/nora_lib.egg-info/PKG-INFO +1 -1
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev0}/setup.py +1 -1
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev0}/README.md +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev0}/nora_lib/__init__.py +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev0}/nora_lib/context/__init__.py +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev0}/nora_lib/context/context_service.py +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev0}/nora_lib/context/models.py +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev0}/nora_lib/interactions/__init__.py +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev0}/nora_lib/interactions/interactions_service.py +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev0}/nora_lib/py.typed +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev0}/nora_lib/tasks/__init__.py +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev0}/nora_lib/tasks/models.py +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev0}/nora_lib/tasks/state.py +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev0}/nora_lib.egg-info/SOURCES.txt +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev0}/nora_lib.egg-info/dependency_links.txt +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev0}/nora_lib.egg-info/requires.txt +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev0}/nora_lib.egg-info/top_level.txt +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev0}/pyproject.toml +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev0}/setup.cfg +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev0}/tests/tasks/__init__.py +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev0}/tests/tasks/test_state.py +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev0}/tests/test_placeholder.py +0 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Model for interactions to be sent to the interactions service.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
+
import json
|
|
5
6
|
from datetime import datetime
|
|
6
7
|
from enum import Enum
|
|
7
8
|
from typing import Dict, List, Optional, Tuple
|
|
@@ -99,6 +100,17 @@ class ReturnedMessage(BaseModel):
|
|
|
99
100
|
channel_id: Optional[str] = None
|
|
100
101
|
annotations: List[Annotation] = Field(default_factory=list)
|
|
101
102
|
|
|
103
|
+
@classmethod
|
|
104
|
+
def from_event(cls, event: Event) -> "ReturnedMessage":
|
|
105
|
+
"""Convert an event to a message"""
|
|
106
|
+
assert event.message_id is not None
|
|
107
|
+
return ReturnedMessage(
|
|
108
|
+
actor_id=event.actor_id,
|
|
109
|
+
text=json.dumps(event.data),
|
|
110
|
+
ts=event.timestamp,
|
|
111
|
+
message_id=event.message_id,
|
|
112
|
+
)
|
|
113
|
+
|
|
102
114
|
|
|
103
115
|
class AgentMessageData(BaseModel):
|
|
104
116
|
"""capture requests to and responses from tools within Events"""
|
|
@@ -7,7 +7,7 @@ dev_requirements = ["mypy", "pytest", "black", "types-requests"]
|
|
|
7
7
|
|
|
8
8
|
setuptools.setup(
|
|
9
9
|
name="nora_lib",
|
|
10
|
-
version="0.0.
|
|
10
|
+
version="0.0.7.dev0",
|
|
11
11
|
description="For making and coordinating agents and tools",
|
|
12
12
|
url="https://github.com/allenai/nora_lib",
|
|
13
13
|
packages=setuptools.find_packages(exclude=(["tests"])),
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|