gohumanloop 0.0.1__py3-none-any.whl → 0.0.2__py3-none-any.whl
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/adapters/__init__.py +17 -0
- gohumanloop/adapters/langgraph_adapter.py +819 -0
- gohumanloop/cli/__init__.py +0 -0
- gohumanloop/cli/main.py +29 -0
- gohumanloop/core/__init__.py +0 -0
- gohumanloop/core/interface.py +437 -0
- gohumanloop/core/manager.py +576 -0
- gohumanloop/manager/__init__.py +0 -0
- gohumanloop/manager/ghl_manager.py +532 -0
- gohumanloop/models/__init__.py +0 -0
- gohumanloop/models/api_model.py +54 -0
- gohumanloop/models/glh_model.py +23 -0
- gohumanloop/providers/__init__.py +0 -0
- gohumanloop/providers/api_provider.py +628 -0
- gohumanloop/providers/base.py +428 -0
- gohumanloop/providers/email_provider.py +1019 -0
- gohumanloop/providers/ghl_provider.py +64 -0
- gohumanloop/providers/terminal_provider.py +302 -0
- gohumanloop/utils/__init__.py +1 -0
- gohumanloop/utils/context_formatter.py +59 -0
- gohumanloop/utils/threadsafedict.py +243 -0
- gohumanloop/utils/utils.py +40 -0
- {gohumanloop-0.0.1.dist-info → gohumanloop-0.0.2.dist-info}/METADATA +2 -1
- gohumanloop-0.0.2.dist-info/RECORD +30 -0
- gohumanloop-0.0.1.dist-info/RECORD +0 -8
- {gohumanloop-0.0.1.dist-info → gohumanloop-0.0.2.dist-info}/WHEEL +0 -0
- {gohumanloop-0.0.1.dist-info → gohumanloop-0.0.2.dist-info}/entry_points.txt +0 -0
- {gohumanloop-0.0.1.dist-info → gohumanloop-0.0.2.dist-info}/licenses/LICENSE +0 -0
- {gohumanloop-0.0.1.dist-info → gohumanloop-0.0.2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,40 @@
|
|
1
|
+
import asyncio
|
2
|
+
import os
|
3
|
+
from typing import Optional, Union
|
4
|
+
from pydantic import SecretStr
|
5
|
+
def run_async_safely(coro):
|
6
|
+
"""同步环境下安全地运行异步协程,避免事件循环冲突"""
|
7
|
+
try:
|
8
|
+
loop = asyncio.get_event_loop()
|
9
|
+
except RuntimeError:
|
10
|
+
# 如果没有事件循环,创建一个新的
|
11
|
+
loop = asyncio.new_event_loop()
|
12
|
+
asyncio.set_event_loop(loop)
|
13
|
+
|
14
|
+
return loop.run_until_complete(coro)
|
15
|
+
|
16
|
+
|
17
|
+
def get_secret_from_env(
|
18
|
+
key: Union[str, list, tuple],
|
19
|
+
default: Optional[str] = None,
|
20
|
+
error_message: Optional[str] = None
|
21
|
+
) -> Optional[SecretStr]:
|
22
|
+
"""Get a value from an environment variable."""
|
23
|
+
if isinstance(key, (list, tuple)):
|
24
|
+
for k in key:
|
25
|
+
if k in os.environ:
|
26
|
+
return SecretStr(os.environ[k])
|
27
|
+
if isinstance(key, str) and key in os.environ:
|
28
|
+
return SecretStr(os.environ[key])
|
29
|
+
if isinstance(default, str):
|
30
|
+
return SecretStr(default)
|
31
|
+
if default is None:
|
32
|
+
return None
|
33
|
+
if error_message:
|
34
|
+
raise ValueError(error_message)
|
35
|
+
msg = (
|
36
|
+
f"Did not find {key}, please add an environment variable"
|
37
|
+
f" `{key}` which contains it, or pass"
|
38
|
+
f" `{key}` as a named parameter."
|
39
|
+
)
|
40
|
+
raise ValueError(msg)
|
@@ -1,7 +1,8 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: gohumanloop
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.2
|
4
4
|
Summary: Perfecting AI workflows with human intelligence
|
5
|
+
Author-email: gohumanloop authors <baird0917@163.com>
|
5
6
|
Project-URL: repository, https://github.com/ptonlix/gohumanloop
|
6
7
|
Requires-Python: >=3.10
|
7
8
|
Description-Content-Type: text/markdown
|
@@ -0,0 +1,30 @@
|
|
1
|
+
gohumanloop/__init__.py,sha256=7_AkUtiG-_iozObldORElQS9mufxjZx_WfxuX0E5Af0,1845
|
2
|
+
gohumanloop/__main__.py,sha256=zdGKN92H9SgwZfL4xLqPkE1YaiRcHhVg_GqC-H1VurA,75
|
3
|
+
gohumanloop/adapters/__init__.py,sha256=alRiJPahmH5vIbiw7l6o3eFvEADVTkfWYIsXy5uPGSo,391
|
4
|
+
gohumanloop/adapters/langgraph_adapter.py,sha256=W-Uu9KYzLX69pm3UgkK57lsbONb9DllQwRBdau_voZc,34058
|
5
|
+
gohumanloop/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
+
gohumanloop/cli/main.py,sha256=54-0nwjaAeRH2WhbyO6pN-XADPQwk4_EUUvVWDWruLc,744
|
7
|
+
gohumanloop/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
+
gohumanloop/core/interface.py,sha256=WOWxlwsj3FSjLiZp_CW36AN_AQYc89PgdA9GZX1Irwc,13361
|
9
|
+
gohumanloop/core/manager.py,sha256=QTpSa0GJEpmEd-f-FevqEsPQL9F8e8f0YLB5fPeLMio,23923
|
10
|
+
gohumanloop/manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
|
+
gohumanloop/manager/ghl_manager.py,sha256=0FEV3brYz3jerkljDL2C0pt3_tAFsB019MWhyPiNDis,21909
|
12
|
+
gohumanloop/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
|
+
gohumanloop/models/api_model.py,sha256=cNTXTlfI7yrTk_87Qf6ms0VtRXO2fYFJFLPTLy2dmQk,2853
|
14
|
+
gohumanloop/models/glh_model.py,sha256=Ht93iCdLfVYz_nW-uW4bE5s0UoyKG3VEx9q-Gg8_tiY,870
|
15
|
+
gohumanloop/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
|
+
gohumanloop/providers/api_provider.py,sha256=WJ7z1dUkQ6xcURx0sAOt_sLFPSGaz2yttSvmNGhvI-c,24398
|
17
|
+
gohumanloop/providers/base.py,sha256=ke9HUKCrr24U71UUdLKoKyTRujCG0cOGEevKDDcd5Nc,16863
|
18
|
+
gohumanloop/providers/email_provider.py,sha256=U1dAXx3T-unDNQ4Kn7Q4xLnGiUfTIz6iw5YKRn4A2h0,42460
|
19
|
+
gohumanloop/providers/ghl_provider.py,sha256=YdxTpRzitFhTXTbhUcMhQlPUs3kwEBd4wyXEcGK8Svk,2524
|
20
|
+
gohumanloop/providers/terminal_provider.py,sha256=obe1Mjj3dlyIPlyViMj3bi4R9HhKXmGjingnfoyHY1I,11637
|
21
|
+
gohumanloop/utils/__init__.py,sha256=idlE5ZNCELVNF9WIiyhtyzG9HJuQQCOlKeTr2aHJ2-Q,56
|
22
|
+
gohumanloop/utils/context_formatter.py,sha256=v4vdgKNJCHjnTtIMq83AkyXwltL14vx-D4KahwcZhIQ,2171
|
23
|
+
gohumanloop/utils/threadsafedict.py,sha256=0-Pmre2-lqHkUPal9wSaqh3fLaEtbo-OnJ3Wbi_knWE,9601
|
24
|
+
gohumanloop/utils/utils.py,sha256=NU-qA5eGuuBjp2SJ49F2V8Gt8Rm1uV3AKM79LUeIcFY,1347
|
25
|
+
gohumanloop-0.0.2.dist-info/licenses/LICENSE,sha256=-U5tuCcSpndQwSKWtZbFbazb-_AtZcZL2kQgHbSLg-M,1064
|
26
|
+
gohumanloop-0.0.2.dist-info/METADATA,sha256=dG9y3LZsTdc3pTonB1fXwx5XZjY1Cedfk3O8bAiHbFA,1557
|
27
|
+
gohumanloop-0.0.2.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
28
|
+
gohumanloop-0.0.2.dist-info/entry_points.txt,sha256=wM6jqRRD8bQXkvIduRVCuAJIlbyWg_F5EDXo5OZ_PwY,88
|
29
|
+
gohumanloop-0.0.2.dist-info/top_level.txt,sha256=LvOXBqS6Mspmcuqp81uz0Vjx_m_YI0w06DOPCiI1BfY,12
|
30
|
+
gohumanloop-0.0.2.dist-info/RECORD,,
|
@@ -1,8 +0,0 @@
|
|
1
|
-
gohumanloop/__init__.py,sha256=7_AkUtiG-_iozObldORElQS9mufxjZx_WfxuX0E5Af0,1845
|
2
|
-
gohumanloop/__main__.py,sha256=zdGKN92H9SgwZfL4xLqPkE1YaiRcHhVg_GqC-H1VurA,75
|
3
|
-
gohumanloop-0.0.1.dist-info/licenses/LICENSE,sha256=-U5tuCcSpndQwSKWtZbFbazb-_AtZcZL2kQgHbSLg-M,1064
|
4
|
-
gohumanloop-0.0.1.dist-info/METADATA,sha256=Nxy1lk5-Kz44XUyV7XmViiLHpqkckkl0SwXgV_9-5mo,1503
|
5
|
-
gohumanloop-0.0.1.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
6
|
-
gohumanloop-0.0.1.dist-info/entry_points.txt,sha256=wM6jqRRD8bQXkvIduRVCuAJIlbyWg_F5EDXo5OZ_PwY,88
|
7
|
-
gohumanloop-0.0.1.dist-info/top_level.txt,sha256=LvOXBqS6Mspmcuqp81uz0Vjx_m_YI0w06DOPCiI1BfY,12
|
8
|
-
gohumanloop-0.0.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|