nora-lib 0.0.6.dev1__tar.gz → 0.0.7.dev1__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.dev1}/PKG-INFO +1 -1
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev1}/nora_lib/interactions/models.py +12 -1
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev1}/nora_lib.egg-info/PKG-INFO +1 -1
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev1}/setup.py +1 -1
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev1}/README.md +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev1}/nora_lib/__init__.py +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev1}/nora_lib/context/__init__.py +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev1}/nora_lib/context/context_service.py +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev1}/nora_lib/context/models.py +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev1}/nora_lib/interactions/__init__.py +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev1}/nora_lib/interactions/interactions_service.py +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev1}/nora_lib/py.typed +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev1}/nora_lib/tasks/__init__.py +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev1}/nora_lib/tasks/models.py +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev1}/nora_lib/tasks/state.py +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev1}/nora_lib.egg-info/SOURCES.txt +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev1}/nora_lib.egg-info/dependency_links.txt +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev1}/nora_lib.egg-info/requires.txt +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev1}/nora_lib.egg-info/top_level.txt +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev1}/pyproject.toml +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev1}/setup.cfg +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev1}/tests/tasks/__init__.py +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev1}/tests/tasks/test_state.py +0 -0
- {nora_lib-0.0.6.dev1 → nora_lib-0.0.7.dev1}/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
|
|
@@ -89,16 +90,26 @@ class Event(BaseModel):
|
|
|
89
90
|
class ReturnedMessage(BaseModel):
|
|
90
91
|
"""Message format returned by interaction service"""
|
|
91
92
|
|
|
92
|
-
message_id: str
|
|
93
93
|
actor_id: UUID
|
|
94
94
|
text: str
|
|
95
95
|
ts: datetime
|
|
96
|
+
message_id: Optional[str] = None
|
|
96
97
|
annotated_text: Optional[str] = None
|
|
97
98
|
events: List[Event] = Field(default_factory=list)
|
|
98
99
|
thread_id: Optional[str] = None
|
|
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
|
+
return ReturnedMessage(
|
|
107
|
+
actor_id=event.actor_id,
|
|
108
|
+
text=json.dumps(event.data),
|
|
109
|
+
ts=event.timestamp,
|
|
110
|
+
message_id=event.message_id,
|
|
111
|
+
)
|
|
112
|
+
|
|
102
113
|
|
|
103
114
|
class AgentMessageData(BaseModel):
|
|
104
115
|
"""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.dev1",
|
|
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
|