proscenium 0.0.3__tar.gz → 0.0.5__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.
Files changed (33) hide show
  1. {proscenium-0.0.3 → proscenium-0.0.5}/PKG-INFO +1 -2
  2. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/admin/__init__.py +3 -0
  3. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/core/__init__.py +19 -0
  4. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/interfaces/slack.py +37 -23
  5. {proscenium-0.0.3 → proscenium-0.0.5}/pyproject.toml +1 -2
  6. {proscenium-0.0.3 → proscenium-0.0.5}/LICENSE +0 -0
  7. {proscenium-0.0.3 → proscenium-0.0.5}/README.md +0 -0
  8. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/__init__.py +0 -0
  9. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/bin/bot.py +0 -0
  10. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/interfaces/__init__.py +0 -0
  11. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/patterns/__init__.py +0 -0
  12. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/patterns/chunk_space.py +0 -0
  13. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/patterns/document_enricher.py +0 -0
  14. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/patterns/entity_resolver.py +0 -0
  15. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/patterns/graph_rag.py +0 -0
  16. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/patterns/knowledge_graph.py +0 -0
  17. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/patterns/rag.py +0 -0
  18. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/patterns/tools.py +0 -0
  19. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/verbs/__init__.py +0 -0
  20. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/verbs/chunk.py +0 -0
  21. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/verbs/complete.py +0 -0
  22. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/verbs/display/__init__.py +0 -0
  23. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/verbs/display/chat.py +0 -0
  24. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/verbs/display/milvus.py +0 -0
  25. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/verbs/display/neo4j.py +0 -0
  26. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/verbs/display/tools.py +0 -0
  27. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/verbs/display.py +0 -0
  28. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/verbs/extract.py +0 -0
  29. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/verbs/invoke.py +0 -0
  30. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/verbs/read.py +0 -0
  31. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/verbs/remember.py +0 -0
  32. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/verbs/vector_database.py +0 -0
  33. {proscenium-0.0.3 → proscenium-0.0.5}/proscenium/verbs/write.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: proscenium
3
- Version: 0.0.3
3
+ Version: 0.0.5
4
4
  Summary: Frame AI Agents
5
5
  License: ASFv2
6
6
  Author: Adam Pingel
@@ -15,7 +15,6 @@ Provides-Extra: testing
15
15
  Requires-Dist: aisuite[openai,anthropic] (>=0.1.10,<0.2.0)
16
16
  Requires-Dist: datasets (>=3.3.2,<4.0.0)
17
17
  Requires-Dist: docstring_parser (>=0.16,<0.17)
18
- Requires-Dist: eyecite (>=2.6.11,<3.0.0)
19
18
  Requires-Dist: gofannon (>=0.25.13,<0.26.0)
20
19
  Requires-Dist: langchain-community (>=0.3.18,<0.4.0)
21
20
  Requires-Dist: langchain-huggingface (>=0.1.2,<0.2.0)
@@ -28,6 +28,9 @@ class Admin(Character):
28
28
  super().__init__(admin_channel_id)
29
29
  self.admin_channel_id = admin_channel_id
30
30
 
31
+ def wants_to_handle(self, channel_id: str, speaker_id: str, utterance: str) -> bool:
32
+ return False
33
+
31
34
  def handle(
32
35
  channel_id: str,
33
36
  speaker_id: str,
@@ -1,12 +1,28 @@
1
1
  from typing import Generator
2
2
  from typing import Optional
3
3
  import logging
4
+
5
+ from pydantic import BaseModel, Field
4
6
  from rich.console import Console
5
7
 
6
8
  logging.getLogger(__name__).addHandler(logging.NullHandler())
7
9
 
8
10
  log = logging.getLogger(__name__)
9
11
 
12
+ control_flow_system_prompt = """
13
+ You control the workflow of an AI assistant. You evaluate user-posted messages and decide what the next step is.
14
+ """
15
+
16
+
17
+ class WantsToHandleResponse(BaseModel):
18
+ """
19
+ The response to whether the Character wants to handle the provided utterance.
20
+ """
21
+
22
+ wants_to_handle: bool = Field(
23
+ description="A boolean indicating whether the Character wants to handle the provided utterance.",
24
+ )
25
+
10
26
 
11
27
  class Prop:
12
28
  """
@@ -52,6 +68,9 @@ class Character:
52
68
  def curtain_up_message(self) -> str:
53
69
  return f"- {self.name()}, {self.description().strip()}"
54
70
 
71
+ def wants_to_handle(self, channel_id: str, speaker_id: str, utterance: str) -> bool:
72
+ return False
73
+
55
74
  def handle(
56
75
  channel_id: str, speaker_id: str, utterance: str
57
76
  ) -> Generator[tuple[str, str], None, None]:
@@ -93,31 +93,45 @@ def make_slack_listener(
93
93
 
94
94
  # TODO determine whether the handler has a good chance of being useful
95
95
 
96
- for receiving_channel_id, response in character.handle(
97
- channel_id, speaker_id, text
98
- ):
99
- response_response = client.web_client.chat_postMessage(
100
- channel=receiving_channel_id, text=response
101
- )
96
+ if character.wants_to_handle(channel_id, speaker_id, text):
97
+
102
98
  log.info(
103
- "Response sent to channel %s",
104
- receiving_channel_id,
99
+ "Handler %s in channel %s wants to handle it",
100
+ character.name(),
101
+ channel_id,
105
102
  )
106
- if receiving_channel_id == admin_channel_id:
107
- continue
108
103
 
109
- permalink = client.web_client.chat_getPermalink(
110
- channel=receiving_channel_id,
111
- message_ts=response_response["ts"],
112
- )["permalink"]
104
+ for receiving_channel_id, response in character.handle(
105
+ channel_id, speaker_id, text
106
+ ):
107
+ response_response = client.web_client.chat_postMessage(
108
+ channel=receiving_channel_id, text=response
109
+ )
110
+ log.info(
111
+ "Response sent to channel %s",
112
+ receiving_channel_id,
113
+ )
114
+ if receiving_channel_id == admin_channel_id:
115
+ continue
116
+
117
+ permalink = client.web_client.chat_getPermalink(
118
+ channel=receiving_channel_id,
119
+ message_ts=response_response["ts"],
120
+ )["permalink"]
121
+ log.info(
122
+ "Response sent to channel %s link %s",
123
+ receiving_channel_id,
124
+ permalink,
125
+ )
126
+ client.web_client.chat_postMessage(
127
+ channel=admin_channel_id,
128
+ text=permalink,
129
+ )
130
+ else:
113
131
  log.info(
114
- "Response sent to channel %s link %s",
115
- receiving_channel_id,
116
- permalink,
117
- )
118
- client.web_client.chat_postMessage(
119
- channel=admin_channel_id,
120
- text=permalink,
132
+ "Handler %s in channel %s does not want to handle it",
133
+ character.name(),
134
+ channel_id,
121
135
  )
122
136
 
123
137
  elif req.type == "interactive":
@@ -178,8 +192,8 @@ def bot_user_id(socket_mode_client: SocketModeClient, console: Console):
178
192
 
179
193
  console.print(auth_response["url"])
180
194
  console.print()
181
- console.print(f"Team '{auth_response["team"]}' ({auth_response["team_id"]})")
182
- console.print(f"User '{auth_response["user"]}' ({auth_response["user_id"]})")
195
+ console.print("Team", auth_response["team"], auth_response["team_id"])
196
+ console.print("User", auth_response["user"], auth_response["user_id"])
183
197
 
184
198
  user_id = auth_response["user_id"]
185
199
  console.print("Bot id", auth_response["bot_id"])
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "proscenium"
3
- version = "0.0.3"
3
+ version = "0.0.5"
4
4
  description = "Frame AI Agents"
5
5
  authors = ["Adam Pingel <oss@pingel.org>"]
6
6
  license = "ASFv2"
@@ -24,7 +24,6 @@ neo4j = "^5.28.1"
24
24
  gofannon = "^0.25.13"
25
25
  langchain-community = "^0.3.18"
26
26
  langchain-huggingface = "^0.1.2"
27
- eyecite = "^2.6.11"
28
27
  slack_sdk = "^3.35.0"
29
28
 
30
29
  [tool.poetry.extras]
File without changes
File without changes