gohumanloop 0.0.7__tar.gz → 0.0.9__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.
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/PKG-INFO +6 -5
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/README.md +5 -4
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/__init__.py +5 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/adapters/__init__.py +5 -1
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/adapters/base_adapter.py +42 -33
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop.egg-info/PKG-INFO +6 -5
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/pyproject.toml +1 -1
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/LICENSE +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/__main__.py +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/adapters/langgraph_adapter.py +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/cli/__init__.py +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/cli/main.py +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/core/__init__.py +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/core/interface.py +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/core/manager.py +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/manager/__init__.py +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/manager/ghl_manager.py +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/models/__init__.py +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/models/api_model.py +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/models/glh_model.py +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/providers/__init__.py +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/providers/api_provider.py +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/providers/base.py +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/providers/email_provider.py +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/providers/ghl_provider.py +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/providers/terminal_provider.py +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/utils/__init__.py +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/utils/context_formatter.py +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/utils/threadsafedict.py +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop/utils/utils.py +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop.egg-info/SOURCES.txt +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop.egg-info/dependency_links.txt +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop.egg-info/entry_points.txt +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop.egg-info/requires.txt +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/gohumanloop.egg-info/top_level.txt +0 -0
- {gohumanloop-0.0.7 → gohumanloop-0.0.9}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: gohumanloop
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.9
|
4
4
|
Summary: Perfecting AI workflows with human intelligence
|
5
5
|
Author-email: gohumanloop authors <baird0917@163.com>
|
6
6
|
Project-URL: repository, https://github.com/ptonlix/gohumanloop
|
@@ -33,7 +33,7 @@ Dynamic: license-file
|
|
33
33
|
**GoHumanLoop**: A Python library empowering AI agents to dynamically request human input (approval/feedback/conversation) at critical stages. Core features:
|
34
34
|
|
35
35
|
- `Human-in-the-loop control`: Lets AI agent systems pause and escalate decisions, enhancing safety and trust.
|
36
|
-
- `Multi-channel integration`: Supports Terminal, Email, API, and frameworks like LangGraph/CrewAI
|
36
|
+
- `Multi-channel integration`: Supports Terminal, Email, API, and frameworks like LangGraph/CrewAI/...(soon)
|
37
37
|
- `Flexible workflows`: Combines automated reasoning with human oversight for reliable AI operations.
|
38
38
|
|
39
39
|
Ensures responsible AI deployment by bridging autonomous agents and human judgment.
|
@@ -59,9 +59,10 @@ Ensures responsible AI deployment by bridging autonomous agents and human judgme
|
|
59
59
|
|
60
60
|
## 🎹 Getting Started
|
61
61
|
|
62
|
-
To get started, check out the following example or jump straight into one of the [Examples](
|
62
|
+
To get started, check out the following example or jump straight into one of the [Examples Repo](https://github.com/ptonlix/gohumanloop-examples):
|
63
63
|
|
64
|
-
- 🦜⛓️ [LangGraph](
|
64
|
+
- 🦜⛓️ [LangGraph](https://github.com/ptonlix/gohumanloop-examples/tree/main/LangGraph)
|
65
|
+
- 🚣 [CrewAI](https://github.com/ptonlix/gohumanloop-examples/tree/main/CrewAI)
|
65
66
|
|
66
67
|
### Installation
|
67
68
|
|
@@ -206,7 +207,7 @@ Perform `human-in-the-loop` interaction by entering:
|
|
206
207
|
|
207
208
|
🚀🚀🚀 Completed successfully ~
|
208
209
|
|
209
|
-
➡️ Check out more examples in the [Examples
|
210
|
+
➡️ Check out more examples in the [Examples Repository](https://github.com/ptonlix/gohumanloop-examples) and we look foward to your contributions!
|
210
211
|
|
211
212
|
## 🎵 Why GoHumanloop?
|
212
213
|
|
@@ -8,7 +8,7 @@
|
|
8
8
|
**GoHumanLoop**: A Python library empowering AI agents to dynamically request human input (approval/feedback/conversation) at critical stages. Core features:
|
9
9
|
|
10
10
|
- `Human-in-the-loop control`: Lets AI agent systems pause and escalate decisions, enhancing safety and trust.
|
11
|
-
- `Multi-channel integration`: Supports Terminal, Email, API, and frameworks like LangGraph/CrewAI
|
11
|
+
- `Multi-channel integration`: Supports Terminal, Email, API, and frameworks like LangGraph/CrewAI/...(soon)
|
12
12
|
- `Flexible workflows`: Combines automated reasoning with human oversight for reliable AI operations.
|
13
13
|
|
14
14
|
Ensures responsible AI deployment by bridging autonomous agents and human judgment.
|
@@ -34,9 +34,10 @@ Ensures responsible AI deployment by bridging autonomous agents and human judgme
|
|
34
34
|
|
35
35
|
## 🎹 Getting Started
|
36
36
|
|
37
|
-
To get started, check out the following example or jump straight into one of the [Examples](
|
37
|
+
To get started, check out the following example or jump straight into one of the [Examples Repo](https://github.com/ptonlix/gohumanloop-examples):
|
38
38
|
|
39
|
-
- 🦜⛓️ [LangGraph](
|
39
|
+
- 🦜⛓️ [LangGraph](https://github.com/ptonlix/gohumanloop-examples/tree/main/LangGraph)
|
40
|
+
- 🚣 [CrewAI](https://github.com/ptonlix/gohumanloop-examples/tree/main/CrewAI)
|
40
41
|
|
41
42
|
### Installation
|
42
43
|
|
@@ -181,7 +182,7 @@ Perform `human-in-the-loop` interaction by entering:
|
|
181
182
|
|
182
183
|
🚀🚀🚀 Completed successfully ~
|
183
184
|
|
184
|
-
➡️ Check out more examples in the [Examples
|
185
|
+
➡️ Check out more examples in the [Examples Repository](https://github.com/ptonlix/gohumanloop-examples) and we look foward to your contributions!
|
185
186
|
|
186
187
|
## 🎵 Why GoHumanloop?
|
187
188
|
|
@@ -17,6 +17,8 @@ from gohumanloop.providers.terminal_provider import TerminalProvider
|
|
17
17
|
|
18
18
|
from gohumanloop.utils import run_async_safely, get_secret_from_env
|
19
19
|
|
20
|
+
from gohumanloop.adapters import HumanloopAdapter, AgentOpsHumanLoopCallback
|
21
|
+
|
20
22
|
# Conditionally import EmailProvider
|
21
23
|
try:
|
22
24
|
from gohumanloop.providers.email_provider import EmailProvider # noqa: F401
|
@@ -60,6 +62,9 @@ __all__ = [
|
|
60
62
|
"APIProvider",
|
61
63
|
"GoHumanLoopProvider",
|
62
64
|
"TerminalProvider",
|
65
|
+
# Adapter Implementations
|
66
|
+
"HumanloopAdapter",
|
67
|
+
"AgentOpsHumanLoopCallback",
|
63
68
|
# Utility Functions
|
64
69
|
"run_async_safely",
|
65
70
|
"get_secret_from_env",
|
@@ -1,5 +1,8 @@
|
|
1
|
-
from .
|
1
|
+
from .base_adapter import (
|
2
2
|
HumanloopAdapter,
|
3
|
+
AgentOpsHumanLoopCallback,
|
4
|
+
)
|
5
|
+
from .langgraph_adapter import (
|
3
6
|
LangGraphHumanLoopCallback,
|
4
7
|
default_langgraph_callback_factory,
|
5
8
|
interrupt,
|
@@ -9,6 +12,7 @@ from .langgraph_adapter import (
|
|
9
12
|
|
10
13
|
__all__ = [
|
11
14
|
"HumanloopAdapter",
|
15
|
+
"AgentOpsHumanLoopCallback",
|
12
16
|
"LangGraphHumanLoopCallback",
|
13
17
|
"default_langgraph_callback_factory",
|
14
18
|
"interrupt",
|
@@ -708,36 +708,42 @@ class AgentOpsHumanLoopCallback(HumanLoopCallback):
|
|
708
708
|
It records events, tracks metrics, and provides observability for human-agent interactions.
|
709
709
|
"""
|
710
710
|
|
711
|
-
import importlib.util
|
712
|
-
|
713
|
-
if importlib.util.find_spec("agentops") is not None:
|
714
|
-
from agentops.sdk import session, agent, operation, task # type: ignore
|
715
|
-
else:
|
716
|
-
logger.debug(
|
717
|
-
"AgentOps package not installed. AgentOps features disabled. Please pip install agentops"
|
718
|
-
)
|
719
|
-
|
720
711
|
def __init__(self, session_tags: Optional[List[str]] = None) -> None:
|
721
|
-
"""Initialize the AgentOps human loop callback.
|
722
|
-
|
723
|
-
Args:
|
724
|
-
session_tags: Optional tags for AgentOps session tracking
|
725
|
-
"""
|
726
712
|
self.session_tags = session_tags or ["gohumanloop"]
|
713
|
+
self._operation = None
|
714
|
+
self._initialize_agentops()
|
727
715
|
|
716
|
+
def _initialize_agentops(self) -> None:
|
717
|
+
"""Initialize AgentOps if available, otherwise fall back gracefully."""
|
728
718
|
try:
|
729
|
-
import
|
719
|
+
import importlib.util
|
720
|
+
|
721
|
+
if importlib.util.find_spec("agentops"):
|
722
|
+
from agentops.sdk import operation # type: ignore
|
723
|
+
import agentops # type: ignore
|
730
724
|
|
731
|
-
|
725
|
+
self._operation = operation
|
726
|
+
agentops.init(tags=self.session_tags)
|
727
|
+
else:
|
728
|
+
raise ImportError(
|
729
|
+
"AgentOps package not installed. Features disabled. "
|
730
|
+
"Please install with: pip install agentops"
|
731
|
+
)
|
732
732
|
except Exception as e:
|
733
|
-
logger.warning(f"
|
733
|
+
logger.warning(f"AgentOps initialization failed: {e}")
|
734
|
+
|
735
|
+
@property
|
736
|
+
def operation_decorator(self) -> Callable:
|
737
|
+
"""Return the appropriate decorator based on AgentOps availability."""
|
738
|
+
return self._operation if self._operation is not None else lambda f: f
|
734
739
|
|
735
|
-
@operation
|
736
740
|
async def async_on_humanloop_request(
|
737
741
|
self, provider: HumanLoopProvider, request: HumanLoopRequest
|
738
742
|
) -> Any:
|
739
743
|
"""Handle human loop start events."""
|
740
|
-
|
744
|
+
|
745
|
+
@self.operation_decorator
|
746
|
+
async def callback_humanloop_request() -> Any:
|
741
747
|
# Create event data
|
742
748
|
event_data = {
|
743
749
|
"event_type": "gohumanloop_request",
|
@@ -752,10 +758,9 @@ class AgentOpsHumanLoopCallback(HumanLoopCallback):
|
|
752
758
|
"created_at": request.created_at,
|
753
759
|
}
|
754
760
|
return event_data
|
755
|
-
except (ImportError, Exception) as e:
|
756
|
-
logger.warning(f"Failed to record AgentOps event: {str(e)}")
|
757
761
|
|
758
|
-
|
762
|
+
return await callback_humanloop_request()
|
763
|
+
|
759
764
|
async def async_on_humanloop_update(
|
760
765
|
self, provider: HumanLoopProvider, result: HumanLoopResult
|
761
766
|
) -> Any:
|
@@ -765,7 +770,9 @@ class AgentOpsHumanLoopCallback(HumanLoopCallback):
|
|
765
770
|
provider: The human loop provider instance
|
766
771
|
result: The human loop result containing status and response
|
767
772
|
"""
|
768
|
-
|
773
|
+
|
774
|
+
@self.operation_decorator
|
775
|
+
async def callback_humanloop_update() -> Any:
|
769
776
|
# Create event data
|
770
777
|
event_data = {
|
771
778
|
"event_type": "gohumanloop_update",
|
@@ -782,10 +789,9 @@ class AgentOpsHumanLoopCallback(HumanLoopCallback):
|
|
782
789
|
}
|
783
790
|
|
784
791
|
return event_data
|
785
|
-
except Exception as e:
|
786
|
-
logger.warning(f"Failed to record AgentOps event: {str(e)}")
|
787
792
|
|
788
|
-
|
793
|
+
return await callback_humanloop_update()
|
794
|
+
|
789
795
|
async def async_on_humanloop_timeout(
|
790
796
|
self, provider: HumanLoopProvider, result: HumanLoopResult
|
791
797
|
) -> Any:
|
@@ -794,7 +800,9 @@ class AgentOpsHumanLoopCallback(HumanLoopCallback):
|
|
794
800
|
Args:
|
795
801
|
provider: The human loop provider instance
|
796
802
|
"""
|
797
|
-
|
803
|
+
|
804
|
+
@self.operation_decorator
|
805
|
+
async def callback_humanloop_timeout() -> Any:
|
798
806
|
# Create error event
|
799
807
|
error_data = {
|
800
808
|
"event_type": "gohumanloop_timeout",
|
@@ -811,10 +819,9 @@ class AgentOpsHumanLoopCallback(HumanLoopCallback):
|
|
811
819
|
}
|
812
820
|
|
813
821
|
return error_data
|
814
|
-
except Exception as e:
|
815
|
-
logger.warning(f"Failed to record AgentOps timeout event: {str(e)}")
|
816
822
|
|
817
|
-
|
823
|
+
return await callback_humanloop_timeout()
|
824
|
+
|
818
825
|
async def async_on_humanloop_error(
|
819
826
|
self, provider: HumanLoopProvider, error: Exception
|
820
827
|
) -> Any:
|
@@ -824,7 +831,9 @@ class AgentOpsHumanLoopCallback(HumanLoopCallback):
|
|
824
831
|
provider: The human loop provider instance
|
825
832
|
error: The exception that occurred
|
826
833
|
"""
|
827
|
-
|
834
|
+
|
835
|
+
@self.operation_decorator
|
836
|
+
async def callback_humanloop_error() -> Any:
|
828
837
|
# Create error event
|
829
838
|
error_data = {
|
830
839
|
"event_type": "gohumanloop_error",
|
@@ -834,5 +843,5 @@ class AgentOpsHumanLoopCallback(HumanLoopCallback):
|
|
834
843
|
|
835
844
|
# Record the error event
|
836
845
|
return error_data
|
837
|
-
|
838
|
-
|
846
|
+
|
847
|
+
return await callback_humanloop_error()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: gohumanloop
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.9
|
4
4
|
Summary: Perfecting AI workflows with human intelligence
|
5
5
|
Author-email: gohumanloop authors <baird0917@163.com>
|
6
6
|
Project-URL: repository, https://github.com/ptonlix/gohumanloop
|
@@ -33,7 +33,7 @@ Dynamic: license-file
|
|
33
33
|
**GoHumanLoop**: A Python library empowering AI agents to dynamically request human input (approval/feedback/conversation) at critical stages. Core features:
|
34
34
|
|
35
35
|
- `Human-in-the-loop control`: Lets AI agent systems pause and escalate decisions, enhancing safety and trust.
|
36
|
-
- `Multi-channel integration`: Supports Terminal, Email, API, and frameworks like LangGraph/CrewAI
|
36
|
+
- `Multi-channel integration`: Supports Terminal, Email, API, and frameworks like LangGraph/CrewAI/...(soon)
|
37
37
|
- `Flexible workflows`: Combines automated reasoning with human oversight for reliable AI operations.
|
38
38
|
|
39
39
|
Ensures responsible AI deployment by bridging autonomous agents and human judgment.
|
@@ -59,9 +59,10 @@ Ensures responsible AI deployment by bridging autonomous agents and human judgme
|
|
59
59
|
|
60
60
|
## 🎹 Getting Started
|
61
61
|
|
62
|
-
To get started, check out the following example or jump straight into one of the [Examples](
|
62
|
+
To get started, check out the following example or jump straight into one of the [Examples Repo](https://github.com/ptonlix/gohumanloop-examples):
|
63
63
|
|
64
|
-
- 🦜⛓️ [LangGraph](
|
64
|
+
- 🦜⛓️ [LangGraph](https://github.com/ptonlix/gohumanloop-examples/tree/main/LangGraph)
|
65
|
+
- 🚣 [CrewAI](https://github.com/ptonlix/gohumanloop-examples/tree/main/CrewAI)
|
65
66
|
|
66
67
|
### Installation
|
67
68
|
|
@@ -206,7 +207,7 @@ Perform `human-in-the-loop` interaction by entering:
|
|
206
207
|
|
207
208
|
🚀🚀🚀 Completed successfully ~
|
208
209
|
|
209
|
-
➡️ Check out more examples in the [Examples
|
210
|
+
➡️ Check out more examples in the [Examples Repository](https://github.com/ptonlix/gohumanloop-examples) and we look foward to your contributions!
|
210
211
|
|
211
212
|
## 🎵 Why GoHumanloop?
|
212
213
|
|
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
|
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
|