hyperpocket 0.5.2__py3-none-any.whl → 0.5.4__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.
@@ -1,10 +1,7 @@
1
1
  import click
2
2
 
3
- from hyperpocket.cli.eject import eject
4
- from hyperpocket.cli.pull import pull
5
- from hyperpocket.cli.eject import eject
6
- from hyperpocket.cli.auth_token import create_token_auth_template
7
3
  from hyperpocket.cli.auth_oauth2 import create_oauth2_auth_template
4
+ from hyperpocket.cli.auth_token import create_token_auth_template
8
5
  from hyperpocket.cli.tool_create import create_tool_template, build_tool
9
6
  from hyperpocket.cli.tool_export import export_tool
10
7
 
@@ -26,7 +23,4 @@ devtool.add_command(create_tool_template)
26
23
  devtool.add_command(build_tool)
27
24
  devtool.add_command(export_tool)
28
25
 
29
- cli.add_command(pull)
30
- cli.add_command(eject)
31
-
32
26
  cli()
@@ -482,13 +482,12 @@ class Pocket(object):
482
482
  Args:
483
483
  tools (Union[List[ToolLike], ToolLike]): A list of tool identifiers to be loaded.
484
484
  """
485
- dock = self._default_dock()
486
485
  if not isinstance(tools, list):
487
486
  tools = [tools]
488
487
 
489
488
  loaded_tools = []
490
489
  with concurrent.futures.ThreadPoolExecutor(max_workers=10, thread_name_prefix="tool-loader") as executor:
491
- futures = [executor.submit(self._load_tool, tool_like, dock) for tool_like in tools]
490
+ futures = [executor.submit(self._load_tool, tool_like) for tool_like in tools]
492
491
  loaded_tools = [future.result() for future in concurrent.futures.as_completed(futures)]
493
492
 
494
493
  for tool in loaded_tools:
@@ -498,11 +497,9 @@ class Pocket(object):
498
497
 
499
498
  return loaded_tools
500
499
 
501
- def _load_tool(self, tool_like, dock: Dock = None) -> Tool:
502
- if dock is None:
503
- dock = self._default_dock()
504
-
500
+ def _load_tool(self, tool_like) -> Tool:
505
501
  if isinstance(tool_like, str) or isinstance(tool_like, tuple):
502
+ dock = self._default_dock()
506
503
  return dock(tool_like)
507
504
  elif isinstance(tool_like, Tool):
508
505
  return tool_like
@@ -38,18 +38,15 @@ def function_to_model(func: callable) -> Type[BaseModel]:
38
38
  raise Exception(
39
39
  f"Should all arguments be annotated but {param_name} is not annotated"
40
40
  )
41
+
42
+ if param.annotation.__module__ == "typing":
43
+ for arg in param.annotation.__args__:
44
+ if arg.__module__ != "builtins" and not issubclass(arg, BaseModel):
45
+ raise Exception(
46
+ f"currently only support builtin types and pydantic BaseModel but {param_name} is not builtin type"
47
+ )
41
48
 
42
- if (
43
- param.annotation.__module__ == "typing"
44
- and param.annotation.__name__ == "Optional"
45
- ):
46
- fields[param_name] = (
47
- param.annotation.__args__[0],
48
- FieldInfo(
49
- default=param.default,
50
- description=param_desc_map.get(param_name, ""),
51
- ),
52
- )
49
+ # if annotation type isn't typing, check this type directly.
53
50
  elif param.annotation.__module__ != "builtins" and not issubclass(
54
51
  param.annotation, BaseModel
55
52
  ):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hyperpocket
3
- Version: 0.5.2
3
+ Version: 0.5.4
4
4
  Summary: Building AI agent with hyperpocket tool in a flash
5
5
  Project-URL: Homepage, https://vessl-ai.github.io/hyperpocket
6
6
  Project-URL: Repository, https://github.com/vessl-ai/hyperpocket
@@ -14,10 +14,9 @@ Requires-Dist: httpx==0.27
14
14
  Requires-Dist: jinja2>=3.1.4
15
15
  Requires-Dist: multiprocess>=0.70.17
16
16
  Requires-Dist: nest-asyncio>=1.6.0
17
- Requires-Dist: playwright>=1.49.0
18
17
  Requires-Dist: pydantic>=2.10.2
19
18
  Requires-Dist: pygithub>=2.5.0
20
- Requires-Dist: python-multipart>=0.0.19
19
+ Requires-Dist: python-multipart>=0.0.18
21
20
  Requires-Dist: redis>=5.2.1
22
21
  Requires-Dist: requests>=2.32.3
23
22
  Requires-Dist: toml>=0.10.2
@@ -2,7 +2,7 @@ hyperpocket/__init__.py,sha256=VVLbApRTiULqEVQp6lCNOcuXKx9V62O_7C9VNKBQ0G0,137
2
2
  hyperpocket/builtin.py,sha256=w7OLxf5RCKVpLma9HieSdw6Uky5701ae6g31VPvFoZk,2439
3
3
  hyperpocket/constants.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  hyperpocket/pocket_auth.py,sha256=eRRTzJh3et65EDJnQHB_Kpmco4dgCR2KL8f-FnbuGX0,17819
5
- hyperpocket/pocket_main.py,sha256=1kNesVy5Z-WRET6-GfnRFpPtUdyxQaPBsjhXRflzh18,17702
5
+ hyperpocket/pocket_main.py,sha256=PGMx5MovFSD9Xy9gJbCnF4yLPL4LimfTqDta0SGSroU,17615
6
6
  hyperpocket/prompts.py,sha256=N1bCzCLZvGUVhH1Vn_cgeBPsdY3MdIU7ZGqVgexoj5E,472
7
7
  hyperpocket/tool_like.py,sha256=Foa-iWTnVb54JEq20Becadbz-TSbYkZk6TxexSzaaRM,116
8
8
  hyperpocket/auth/README.md,sha256=zn4QqnFZCA_4X3x8Wb6lE3OP5otYxpByZaCiUkBvaNs,11562
@@ -468,11 +468,9 @@ hyperpocket/auth/zoom/oauth2_context.py,sha256=f0vj1zeRzTnT-4cwe8SeEn2xz03NBy9W_
468
468
  hyperpocket/auth/zoom/oauth2_handler.py,sha256=dMoZjuSRSBaoYLzYkjxc0KZxm9CALLm9aaEVydLBW-0,5111
469
469
  hyperpocket/auth/zoom/oauth2_schema.py,sha256=OlwlEdigiqFX3-XdVp0mhrK7ZKWxVw0v1qNtfx3wN9c,469
470
470
  hyperpocket/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
471
- hyperpocket/cli/__main__.py,sha256=sVGU32c27NCaqysM4TsOf6D-Tj7a3mDhUmm7CRajg_g,753
471
+ hyperpocket/cli/__main__.py,sha256=9myHxl6CdY5A1w41q7WkD4u1PyZ7C_PlpRFpIYKmXCM,589
472
472
  hyperpocket/cli/auth_oauth2.py,sha256=FTsaIrJY9U1uDEtZL456zOWQKfcqzOPg33ikFhFFjyA,4899
473
473
  hyperpocket/cli/auth_token.py,sha256=YV1AK70Q_hNsm_xwHP5LTaUWI-omssnX8214JyD3m_w,4875
474
- hyperpocket/cli/eject.py,sha256=utzeL4t02ML-EIgpPUiFjCbycjRpvkP1905bLeZAT2Y,321
475
- hyperpocket/cli/pull.py,sha256=JnoIsmQwJODWOuilmKR5KKFsdMZ0Ht7pCWIbENJuYfw,275
476
474
  hyperpocket/cli/tool_create.py,sha256=1tsVw_sy28JmeCSXT1j-7dqOsDXzvZPTNqcmHchtcpI,3996
477
475
  hyperpocket/cli/tool_export.py,sha256=NRfssftdb1HEj9DtdM7rh6_rFs1hydYyjpDe7V8kFzU,8060
478
476
  hyperpocket/cli/codegen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -592,12 +590,12 @@ hyperpocket/util/extract_func_param_desc_from_docstring.py,sha256=eGDrbigmVg1zau
592
590
  hyperpocket/util/find_all_leaf_class_in_package.py,sha256=06n8R47BDPovxhCOnzu9GuEfeQzEbv-HdG-zfMu1gBw,533
593
591
  hyperpocket/util/find_all_subclass_in_package.py,sha256=TtEb41-nzCNhC9pgelTS6MMxLT_JNZkFPJe5z2H9yik,978
594
592
  hyperpocket/util/flatten_json_schema.py,sha256=iuNBEmMSKFtPi-uqo6fb3RWN0koHOAihWAAofWbd1U8,1671
595
- hyperpocket/util/function_to_model.py,sha256=TXUs-qPbzL8C9-qqpz4Ad4D9MOPP61n_p0iPU6SoBeM,2318
593
+ hyperpocket/util/function_to_model.py,sha256=HubCCZOdTWcGy4OpDSEws5pEkkuiqT_aYqM663tdU6U,2381
596
594
  hyperpocket/util/get_objects_from_subpackage.py,sha256=4mR_S8eaJSdU68YfCkiXeIcXxb6q7LjFGsY_IHeNIZw,929
597
595
  hyperpocket/util/git_parser.py,sha256=y96nhgZXtRgA_u_0GTPo95PGkpG-n_oMIrkbckdxiR8,2496
598
596
  hyperpocket/util/json_schema_to_model.py,sha256=nc5AmnqkrdeFLELu-7_O9sEAaUaD8_KGlvIMDRobt-4,3751
599
597
  hyperpocket/util/short_hashing_str.py,sha256=ahLUT8iQr-MJVbDJXrSt0cXnnSEeJ8EU3A0PDn6e0gs,119
600
- hyperpocket-0.5.2.dist-info/METADATA,sha256=OBQOkr9W9KmvlePHr68rsnhFkf_OV_BxiV12-H3LQbM,13078
601
- hyperpocket-0.5.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
602
- hyperpocket-0.5.2.dist-info/entry_points.txt,sha256=KpBleaYr0SaENXOa-dFvJ_cvFCHYFEQ4LMl11ShAcBI,61
603
- hyperpocket-0.5.2.dist-info/RECORD,,
598
+ hyperpocket-0.5.4.dist-info/METADATA,sha256=NUGSUVNJ8L-n0xYcCWbC7MRpoScLcNgB0uh28VHCGR0,13044
599
+ hyperpocket-0.5.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
600
+ hyperpocket-0.5.4.dist-info/entry_points.txt,sha256=KpBleaYr0SaENXOa-dFvJ_cvFCHYFEQ4LMl11ShAcBI,61
601
+ hyperpocket-0.5.4.dist-info/RECORD,,
hyperpocket/cli/eject.py DELETED
@@ -1,14 +0,0 @@
1
- import pathlib
2
- from typing import Optional
3
-
4
- import click
5
-
6
- import hyperpocket.repository as repository
7
-
8
-
9
- @click.command()
10
- @click.argument("url", type=str)
11
- @click.argument("ref", type=str)
12
- @click.argument("remote_path", type=str)
13
- def eject(url: str, ref: str, remote_path: str):
14
- repository.eject(url, ref, remote_path)
hyperpocket/cli/pull.py DELETED
@@ -1,13 +0,0 @@
1
- import pathlib
2
- from typing import Optional
3
-
4
- import click
5
-
6
- import hyperpocket.repository as repository
7
-
8
-
9
- @click.command()
10
- @click.argument("url", type=str)
11
- @click.option("--git-ref", type=str, default="HEAD")
12
- def pull(url: str, git_ref: str):
13
- repository.pull(url, git_ref)