nora-lib 0.0.6.dev0__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.dev0 → nora_lib-0.0.7.dev0}/PKG-INFO +1 -1
- {nora_lib-0.0.6.dev0 → nora_lib-0.0.7.dev0}/nora_lib/interactions/interactions_service.py +1 -2
- {nora_lib-0.0.6.dev0 → nora_lib-0.0.7.dev0}/nora_lib/interactions/models.py +16 -4
- {nora_lib-0.0.6.dev0 → nora_lib-0.0.7.dev0}/nora_lib.egg-info/PKG-INFO +1 -1
- {nora_lib-0.0.6.dev0 → nora_lib-0.0.7.dev0}/setup.py +1 -1
- {nora_lib-0.0.6.dev0 → nora_lib-0.0.7.dev0}/README.md +0 -0
- {nora_lib-0.0.6.dev0 → nora_lib-0.0.7.dev0}/nora_lib/__init__.py +0 -0
- {nora_lib-0.0.6.dev0 → nora_lib-0.0.7.dev0}/nora_lib/context/__init__.py +0 -0
- {nora_lib-0.0.6.dev0 → nora_lib-0.0.7.dev0}/nora_lib/context/context_service.py +0 -0
- {nora_lib-0.0.6.dev0 → nora_lib-0.0.7.dev0}/nora_lib/context/models.py +0 -0
- {nora_lib-0.0.6.dev0 → nora_lib-0.0.7.dev0}/nora_lib/interactions/__init__.py +0 -0
- {nora_lib-0.0.6.dev0 → nora_lib-0.0.7.dev0}/nora_lib/py.typed +0 -0
- {nora_lib-0.0.6.dev0 → nora_lib-0.0.7.dev0}/nora_lib/tasks/__init__.py +0 -0
- {nora_lib-0.0.6.dev0 → nora_lib-0.0.7.dev0}/nora_lib/tasks/models.py +0 -0
- {nora_lib-0.0.6.dev0 → nora_lib-0.0.7.dev0}/nora_lib/tasks/state.py +0 -0
- {nora_lib-0.0.6.dev0 → nora_lib-0.0.7.dev0}/nora_lib.egg-info/SOURCES.txt +0 -0
- {nora_lib-0.0.6.dev0 → nora_lib-0.0.7.dev0}/nora_lib.egg-info/dependency_links.txt +0 -0
- {nora_lib-0.0.6.dev0 → nora_lib-0.0.7.dev0}/nora_lib.egg-info/requires.txt +0 -0
- {nora_lib-0.0.6.dev0 → nora_lib-0.0.7.dev0}/nora_lib.egg-info/top_level.txt +0 -0
- {nora_lib-0.0.6.dev0 → nora_lib-0.0.7.dev0}/pyproject.toml +0 -0
- {nora_lib-0.0.6.dev0 → nora_lib-0.0.7.dev0}/setup.cfg +0 -0
- {nora_lib-0.0.6.dev0 → nora_lib-0.0.7.dev0}/tests/tasks/__init__.py +0 -0
- {nora_lib-0.0.6.dev0 → nora_lib-0.0.7.dev0}/tests/tasks/test_state.py +0 -0
- {nora_lib-0.0.6.dev0 → nora_lib-0.0.7.dev0}/tests/test_placeholder.py +0 -0
|
@@ -115,8 +115,7 @@ class InteractionsService:
|
|
|
115
115
|
# Process any thread_fork events
|
|
116
116
|
try:
|
|
117
117
|
for msg in messages_for_thread.messages:
|
|
118
|
-
|
|
119
|
-
for event in events:
|
|
118
|
+
for event in msg.events:
|
|
120
119
|
if event.type == EventType.THREAD_FORK.value:
|
|
121
120
|
event_data = ThreadForkEventData.model_validate(event.data)
|
|
122
121
|
forked_thread: ThreadRelationsResponse = (
|
|
@@ -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
|
|
@@ -43,7 +44,7 @@ class Message(BaseModel):
|
|
|
43
44
|
channel_id: str
|
|
44
45
|
surface: Surface
|
|
45
46
|
ts: datetime
|
|
46
|
-
annotations:
|
|
47
|
+
annotations: List[Annotation] = Field(default_factory=list)
|
|
47
48
|
|
|
48
49
|
@field_serializer("actor_id")
|
|
49
50
|
def serialize_actor_id(self, actor_id: UUID):
|
|
@@ -94,10 +95,21 @@ class ReturnedMessage(BaseModel):
|
|
|
94
95
|
text: str
|
|
95
96
|
ts: datetime
|
|
96
97
|
annotated_text: Optional[str] = None
|
|
97
|
-
events:
|
|
98
|
+
events: List[Event] = Field(default_factory=list)
|
|
98
99
|
thread_id: Optional[str] = None
|
|
99
100
|
channel_id: Optional[str] = None
|
|
100
|
-
annotations:
|
|
101
|
+
annotations: List[Annotation] = Field(default_factory=list)
|
|
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
|
+
)
|
|
101
113
|
|
|
102
114
|
|
|
103
115
|
class AgentMessageData(BaseModel):
|
|
@@ -127,7 +139,7 @@ class ReturnedAgentContextMessage(BaseModel):
|
|
|
127
139
|
text: str
|
|
128
140
|
ts: str
|
|
129
141
|
annotated_text: Optional[str] = None
|
|
130
|
-
events:
|
|
142
|
+
events: List[ReturnedAgentContextEvent] = Field(default_factory=list)
|
|
131
143
|
|
|
132
144
|
|
|
133
145
|
class ThreadForkEventData(BaseModel):
|
|
@@ -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
|