hyperpocket 0.1.9__tar.gz → 0.1.10__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/.gitignore +1 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/PKG-INFO +19 -20
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/README.md +18 -19
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/pocket_core.py +1 -1
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/util/extract_func_param_desc_from_docstring.py +11 -8
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/pyproject.toml +1 -1
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/tests/test_pocket.py +25 -16
- hyperpocket-0.1.10/tests/utils/test_extract_func_param_desc_from_docstring.py +214 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/README.md +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/calendly/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/calendly/context.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/calendly/oauth2_context.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/calendly/oauth2_handler.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/calendly/oauth2_schema.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/context.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/github/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/github/context.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/github/oauth2_context.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/github/oauth2_handler.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/github/oauth2_schema.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/github/token_context.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/github/token_handler.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/github/token_schema.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/google/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/google/context.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/google/oauth2_context.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/google/oauth2_handler.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/google/oauth2_schema.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/gumloop/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/gumloop/context.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/gumloop/token_context.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/gumloop/token_handler.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/gumloop/token_schema.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/handler.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/linear/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/linear/context.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/linear/token_context.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/linear/token_handler.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/linear/token_schema.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/notion/README.md +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/notion/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/notion/context.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/notion/token_context.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/notion/token_handler.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/notion/token_schema.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/provider.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/reddit/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/reddit/context.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/reddit/oauth2_context.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/reddit/oauth2_handler.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/reddit/oauth2_schema.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/schema.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/slack/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/slack/context.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/slack/oauth2_context.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/slack/oauth2_handler.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/slack/oauth2_schema.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/slack/token_context.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/slack/token_handler.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/auth/slack/token_schema.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/builtin.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/cli/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/cli/__main__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/cli/auth.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/cli/codegen/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/cli/codegen/auth/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/cli/codegen/auth/auth_context_template.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/cli/codegen/auth/auth_token_context_template.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/cli/codegen/auth/auth_token_handler_template.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/cli/codegen/auth/auth_token_schema_template.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/cli/codegen/auth/server_auth_template.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/cli/eject.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/cli/pull.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/cli/sync.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/config/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/config/auth.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/config/git.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/config/logger.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/config/session.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/config/settings.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/constants.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/futures/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/futures/futurestore.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/pocket_auth.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/pocket_main.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/prompts.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/repository/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/repository/lock.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/repository/lockfile.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/repository/repository.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/server/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/server/auth/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/server/auth/calendly.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/server/auth/github.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/server/auth/google.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/server/auth/gumloop.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/server/auth/linear.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/server/auth/notion.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/server/auth/reddit.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/server/auth/slack.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/server/auth/token.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/server/proxy.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/server/server.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/server/tool/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/server/tool/dto/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/server/tool/dto/script.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/server/tool/wasm.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/session/README.md +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/session/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/session/in_memory.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/session/interface.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/session/redis.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/tool/README.md +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/tool/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/tool/function/README.md +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/tool/function/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/tool/function/annotation.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/tool/function/tool.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/tool/tests/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/tool/tool.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/tool/wasm/README.md +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/tool/wasm/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/tool/wasm/browser.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/tool/wasm/invoker.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/tool/wasm/script.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/tool/wasm/templates/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/tool/wasm/templates/node.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/tool/wasm/templates/python.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/tool/wasm/tool.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/tool_like.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/util/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/util/find_all_leaf_class_in_package.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/util/find_all_subclass_in_package.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/util/flatten_json_schema.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/util/function_to_model.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/util/get_objects_from_subpackage.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/util/json_schema_to_model.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/tests/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/tests/auth/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/tests/auth/test_google_oauth2_handler.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/tests/auth/test_gumloop_token_handler.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/tests/auth/test_notion_token_handler.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/tests/auth/test_slack_oauth2_handler.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/tests/auth/test_slack_token_handler.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/tests/session/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/tests/session/test_in_memory.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/tests/session/test_redis.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/tests/test_pocket_auth.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/tests/tool/__init__.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/tests/tool/test_function_tool.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/tests/tool/test_wasm_tool.py +0 -0
- {hyperpocket-0.1.9 → hyperpocket-0.1.10}/uv.lock +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: hyperpocket
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.10
|
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
|
@@ -76,16 +76,16 @@ Or just use LLM API Clients out of the box.
|
|
76
76
|
### Using out-of-the-box tools
|
77
77
|
|
78
78
|
```python
|
79
|
-
|
79
|
+
|
80
80
|
from langchain_openai import ChatOpenAI
|
81
81
|
|
82
82
|
from hyperpocket_langchain import PocketLangchain
|
83
83
|
|
84
84
|
pklc = PocketLangchain(
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
85
|
+
tools=[
|
86
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/get-message",
|
87
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/post-message",
|
88
|
+
]
|
89
89
|
)
|
90
90
|
tools = pklc.get_tools()
|
91
91
|
|
@@ -124,7 +124,7 @@ Hyperpocket provides way to use end user auth easily.
|
|
124
124
|
You can manage your auths in request-wise level. (e.g. you can use different auths for different requests)
|
125
125
|
|
126
126
|
```python
|
127
|
-
|
127
|
+
|
128
128
|
from langchain_openai import ChatOpenAI
|
129
129
|
from langgraph.graph import StateGraph, START, MessagesState
|
130
130
|
from langgraph.prebuilt import tools_condition
|
@@ -132,10 +132,10 @@ from langgraph.prebuilt import tools_condition
|
|
132
132
|
from hyperpocket_langgraph import PocketLanggraph
|
133
133
|
|
134
134
|
pklg = PocketLanggraph(
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
135
|
+
tools=[
|
136
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/get-message",
|
137
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/post-message",
|
138
|
+
],
|
139
139
|
)
|
140
140
|
llm = ChatOpenAI()
|
141
141
|
|
@@ -160,22 +160,21 @@ graph_builder.compile()
|
|
160
160
|
```
|
161
161
|
|
162
162
|
```python
|
163
|
-
from hyperpocket.config import secret
|
164
|
-
from hyperpocket.tool import from_git
|
165
163
|
from llama_index.core.agent import FunctionCallingAgent
|
166
164
|
from llama_index.llms.openai import OpenAI
|
167
165
|
|
166
|
+
from hyperpocket.config import secret
|
168
167
|
from hyperpocket_llamaindex import PocketLlamaindex
|
169
168
|
|
170
169
|
llm = OpenAI(api_key=secret["OPENAI_API_KEY"])
|
171
170
|
pocket = PocketLlamaindex(
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
171
|
+
tools=[
|
172
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/get-message",
|
173
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/post-message",
|
174
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/linear/get-issues",
|
175
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/google/get-calendar-events",
|
176
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/google/get-calendar-list",
|
177
|
+
]
|
179
178
|
)
|
180
179
|
tools = pocket.get_tools()
|
181
180
|
|
@@ -51,16 +51,16 @@ Or just use LLM API Clients out of the box.
|
|
51
51
|
### Using out-of-the-box tools
|
52
52
|
|
53
53
|
```python
|
54
|
-
|
54
|
+
|
55
55
|
from langchain_openai import ChatOpenAI
|
56
56
|
|
57
57
|
from hyperpocket_langchain import PocketLangchain
|
58
58
|
|
59
59
|
pklc = PocketLangchain(
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
60
|
+
tools=[
|
61
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/get-message",
|
62
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/post-message",
|
63
|
+
]
|
64
64
|
)
|
65
65
|
tools = pklc.get_tools()
|
66
66
|
|
@@ -99,7 +99,7 @@ Hyperpocket provides way to use end user auth easily.
|
|
99
99
|
You can manage your auths in request-wise level. (e.g. you can use different auths for different requests)
|
100
100
|
|
101
101
|
```python
|
102
|
-
|
102
|
+
|
103
103
|
from langchain_openai import ChatOpenAI
|
104
104
|
from langgraph.graph import StateGraph, START, MessagesState
|
105
105
|
from langgraph.prebuilt import tools_condition
|
@@ -107,10 +107,10 @@ from langgraph.prebuilt import tools_condition
|
|
107
107
|
from hyperpocket_langgraph import PocketLanggraph
|
108
108
|
|
109
109
|
pklg = PocketLanggraph(
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
110
|
+
tools=[
|
111
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/get-message",
|
112
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/post-message",
|
113
|
+
],
|
114
114
|
)
|
115
115
|
llm = ChatOpenAI()
|
116
116
|
|
@@ -135,22 +135,21 @@ graph_builder.compile()
|
|
135
135
|
```
|
136
136
|
|
137
137
|
```python
|
138
|
-
from hyperpocket.config import secret
|
139
|
-
from hyperpocket.tool import from_git
|
140
138
|
from llama_index.core.agent import FunctionCallingAgent
|
141
139
|
from llama_index.llms.openai import OpenAI
|
142
140
|
|
141
|
+
from hyperpocket.config import secret
|
143
142
|
from hyperpocket_llamaindex import PocketLlamaindex
|
144
143
|
|
145
144
|
llm = OpenAI(api_key=secret["OPENAI_API_KEY"])
|
146
145
|
pocket = PocketLlamaindex(
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
146
|
+
tools=[
|
147
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/get-message",
|
148
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/post-message",
|
149
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/linear/get-issues",
|
150
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/google/get-calendar-events",
|
151
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/google/get-calendar-list",
|
152
|
+
]
|
154
153
|
)
|
155
154
|
tools = pocket.get_tools()
|
156
155
|
|
@@ -38,7 +38,7 @@ class PocketCore:
|
|
38
38
|
lock = LocalLock(tool_like)
|
39
39
|
req = WasmToolRequest(lock, "")
|
40
40
|
else:
|
41
|
-
base_repo_url, git_ref, rel_path = GitLock.
|
41
|
+
base_repo_url, git_ref, rel_path = GitLock.parse_repo_url(repo_url=tool_like)
|
42
42
|
lock = GitLock(repository_url=base_repo_url, git_ref=git_ref)
|
43
43
|
req = WasmToolRequest(lock=lock, rel_path=rel_path, tool_vars={})
|
44
44
|
|
{hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/util/extract_func_param_desc_from_docstring.py
RENAMED
@@ -23,14 +23,12 @@ def extract_param_docstring_mapping(func) -> dict[str, str]:
|
|
23
23
|
if not docstring:
|
24
24
|
return {}
|
25
25
|
|
26
|
-
pocket_logger.debug(f"try to extract docstring of {func.__name__} by google style..")
|
27
26
|
param_mapping = extract_param_desc_by_google_stype_docstring(docstring, func_params)
|
28
27
|
if param_mapping:
|
29
28
|
pocket_logger.debug(f"success extract docstring of {func.__name__} by google style!")
|
30
29
|
return param_mapping
|
31
30
|
pocket_logger.debug(f"not found param desc of {func.__name__} by google style..")
|
32
31
|
|
33
|
-
pocket_logger.debug(f"try to extract docstring of {func.__name__} by other style..")
|
34
32
|
param_mapping = extract_param_desc_by_other_styles(docstring, func_params)
|
35
33
|
if param_mapping:
|
36
34
|
pocket_logger.debug(f"success extract docstring of {func.__name__} by other style!")
|
@@ -38,7 +36,6 @@ def extract_param_docstring_mapping(func) -> dict[str, str]:
|
|
38
36
|
pocket_logger.debug(f"not found param desc of {func.__name__} by other styles..")
|
39
37
|
|
40
38
|
# Plain Text Style matching
|
41
|
-
pocket_logger.debug(f"try to extract docstring of {func.__name__} by plain text style..")
|
42
39
|
param_descriptions = []
|
43
40
|
for line in docstring.split("\n"):
|
44
41
|
split_line = line.strip().split(":")
|
@@ -46,7 +43,8 @@ def extract_param_docstring_mapping(func) -> dict[str, str]:
|
|
46
43
|
continue
|
47
44
|
|
48
45
|
param_name = split_line[0]
|
49
|
-
cleaned_param_name =
|
46
|
+
cleaned_param_name = clean_string(param_name)
|
47
|
+
cleaned_param_name = clean_bracket_content(cleaned_param_name)
|
50
48
|
description = ":".join(split_line[1:]).strip()
|
51
49
|
if cleaned_param_name in func_params:
|
52
50
|
param_descriptions.append((cleaned_param_name, description))
|
@@ -58,6 +56,11 @@ def extract_param_docstring_mapping(func) -> dict[str, str]:
|
|
58
56
|
return param_mapping
|
59
57
|
|
60
58
|
|
59
|
+
def clean_string(input_string):
|
60
|
+
cleaned = re.sub(r"^[^a-zA-Z_]*|[^a-zA-Z0-9_()\s]*$", "", input_string)
|
61
|
+
return cleaned.strip()
|
62
|
+
|
63
|
+
|
61
64
|
def clean_bracket_content(content):
|
62
65
|
return re.sub(r"[(\[{<].*?[)\]}>]", "", content)
|
63
66
|
|
@@ -65,9 +68,9 @@ def clean_bracket_content(content):
|
|
65
68
|
def extract_param_desc_by_other_styles(docstring, func_params) -> dict[str, str]:
|
66
69
|
param_descriptions = []
|
67
70
|
# Pattern for Sphinx-style or Javadoc-style `:param`, `@param`, `:arg`, `@arg`
|
68
|
-
param_pattern = r"(?:@param|:param|:arg|@arg)
|
69
|
-
matches = re.findall(param_pattern, docstring)
|
70
|
-
for param, desc in matches:
|
71
|
+
param_pattern = r"^\s*(?:@param|:param|:arg|@arg):?\s+(\w+)(?:\((.*?)\))?:?\s*(.*)"
|
72
|
+
matches = re.findall(param_pattern, docstring, re.MULTILINE)
|
73
|
+
for param, _, desc in matches:
|
71
74
|
cleaned_param = clean_bracket_content(param)
|
72
75
|
param_descriptions.append((cleaned_param, desc.strip()))
|
73
76
|
# Ensure no duplicates and match with function parameters
|
@@ -87,7 +90,7 @@ def extract_param_desc_by_google_stype_docstring(docstring, func_params) -> dict
|
|
87
90
|
param_descriptions = {}
|
88
91
|
for line in param_lines:
|
89
92
|
# Match parameter line with "name (type): description"
|
90
|
-
param_match = re.match(r"
|
93
|
+
param_match = re.match(r"^[^a-zA-Z_]*([a-zA-Z_]\w*)\s*[\(\[]\s*(.*?)\s*[\)\]]\s*:\s*(.*)", line)
|
91
94
|
if param_match:
|
92
95
|
param, _, desc = param_match.groups()
|
93
96
|
cleaned_param = clean_bracket_content(param)
|
@@ -1,6 +1,8 @@
|
|
1
|
+
import ast
|
1
2
|
from unittest.async_case import IsolatedAsyncioTestCase
|
2
3
|
from urllib.parse import urlparse, parse_qs, unquote
|
3
4
|
|
5
|
+
import pytest
|
4
6
|
from pydantic import BaseModel
|
5
7
|
|
6
8
|
from hyperpocket import Pocket
|
@@ -99,22 +101,29 @@ class TestPocket(IsolatedAsyncioTestCase):
|
|
99
101
|
# then
|
100
102
|
self.assertEqual(result, "4")
|
101
103
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
104
|
+
@pytest.mark.skip(reason="after open repo")
|
105
|
+
async def test_wasm_tool(self):
|
106
|
+
# given
|
107
|
+
tool_name = "simple_echo_text"
|
108
|
+
self.pocket = Pocket(
|
109
|
+
tools=[
|
110
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/none/simple-echo-tool"
|
111
|
+
]
|
112
|
+
)
|
113
|
+
|
114
|
+
# when
|
115
|
+
result = await self.pocket.ainvoke(
|
116
|
+
tool_name=tool_name,
|
117
|
+
body={
|
118
|
+
"text": "test"
|
119
|
+
},
|
120
|
+
thread_id=self.thread_id,
|
121
|
+
profile=self.profile,
|
122
|
+
)
|
123
|
+
output = ast.literal_eval(result)
|
124
|
+
|
125
|
+
# then
|
126
|
+
self.assertTrue(output["stdout"].startswith("echo message : test"))
|
118
127
|
|
119
128
|
async def test_initialize_tool_auth(self):
|
120
129
|
# given
|
@@ -0,0 +1,214 @@
|
|
1
|
+
import unittest
|
2
|
+
|
3
|
+
from hyperpocket.util.extract_func_param_desc_from_docstring import extract_param_docstring_mapping
|
4
|
+
|
5
|
+
|
6
|
+
class TestExtractFuncParamDescFromDocstring(unittest.TestCase):
|
7
|
+
def test_extract_google_style_param_case1(self):
|
8
|
+
def style_func(a: int, b: int):
|
9
|
+
"""
|
10
|
+
Style Function
|
11
|
+
|
12
|
+
Args:
|
13
|
+
a(int): first desc
|
14
|
+
b(int): second desc
|
15
|
+
"""
|
16
|
+
pass
|
17
|
+
|
18
|
+
params = extract_param_docstring_mapping(style_func)
|
19
|
+
self.assertEqual(params, {'a': 'first desc', 'b': 'second desc'})
|
20
|
+
|
21
|
+
def test_extract_google_style_param_case2(self):
|
22
|
+
def style_func(a: int, b: int):
|
23
|
+
"""
|
24
|
+
Style Function
|
25
|
+
|
26
|
+
Args:
|
27
|
+
- a (int) : first desc
|
28
|
+
- b (int) : second desc
|
29
|
+
"""
|
30
|
+
pass
|
31
|
+
|
32
|
+
params = extract_param_docstring_mapping(style_func)
|
33
|
+
self.assertEqual(params, {'a': 'first desc', 'b': 'second desc'})
|
34
|
+
|
35
|
+
def test_extract_google_style_param_case3(self):
|
36
|
+
def style_func(a: int, b: int):
|
37
|
+
"""
|
38
|
+
Style Function
|
39
|
+
|
40
|
+
Args:
|
41
|
+
1. a (int) : first desc
|
42
|
+
2. b (int) : second desc
|
43
|
+
"""
|
44
|
+
pass
|
45
|
+
|
46
|
+
params = extract_param_docstring_mapping(style_func)
|
47
|
+
self.assertEqual(params, {'a': 'first desc', 'b': 'second desc'})
|
48
|
+
|
49
|
+
def test_extract_other_style_param_case1(self):
|
50
|
+
def style_func(a: int, b: int):
|
51
|
+
"""
|
52
|
+
Style Function
|
53
|
+
|
54
|
+
:param: a: first desc
|
55
|
+
:param: b: second desc
|
56
|
+
"""
|
57
|
+
pass
|
58
|
+
|
59
|
+
params = extract_param_docstring_mapping(style_func)
|
60
|
+
self.assertEqual(params, {'a': 'first desc', 'b': 'second desc'})
|
61
|
+
|
62
|
+
def test_extract_other_style_param_case2(self):
|
63
|
+
def style_func(a: int, b: int):
|
64
|
+
"""
|
65
|
+
Style Function
|
66
|
+
|
67
|
+
:param: a(int): first desc
|
68
|
+
:param: b(int): second desc
|
69
|
+
"""
|
70
|
+
pass
|
71
|
+
|
72
|
+
params = extract_param_docstring_mapping(style_func)
|
73
|
+
self.assertEqual(params, {'a': 'first desc', 'b': 'second desc'})
|
74
|
+
|
75
|
+
def test_extract_other_style_param_case3(self):
|
76
|
+
def style_func(a: int, b: int):
|
77
|
+
"""
|
78
|
+
Style Function
|
79
|
+
|
80
|
+
@param: a: first desc
|
81
|
+
@param: b: second desc
|
82
|
+
"""
|
83
|
+
pass
|
84
|
+
|
85
|
+
params = extract_param_docstring_mapping(style_func)
|
86
|
+
self.assertEqual(params, {'a': 'first desc', 'b': 'second desc'})
|
87
|
+
|
88
|
+
def test_extract_other_style_param_case4(self):
|
89
|
+
def style_func(a: int, b: int):
|
90
|
+
"""
|
91
|
+
Style Function
|
92
|
+
|
93
|
+
@param a(int): first desc
|
94
|
+
@param b(int): second desc
|
95
|
+
"""
|
96
|
+
pass
|
97
|
+
|
98
|
+
params = extract_param_docstring_mapping(style_func)
|
99
|
+
self.assertEqual(params, {'a': 'first desc', 'b': 'second desc'})
|
100
|
+
|
101
|
+
def test_extract_other_style_param_case5(self):
|
102
|
+
def style_func(a: int, b: int):
|
103
|
+
"""
|
104
|
+
Style Function
|
105
|
+
|
106
|
+
@arg: a: first desc
|
107
|
+
@arg: b: second desc
|
108
|
+
"""
|
109
|
+
pass
|
110
|
+
|
111
|
+
params = extract_param_docstring_mapping(style_func)
|
112
|
+
self.assertEqual(params, {'a': 'first desc', 'b': 'second desc'})
|
113
|
+
|
114
|
+
def test_extract_other_style_param_case6(self):
|
115
|
+
def style_func(a: int, b: int):
|
116
|
+
"""
|
117
|
+
Style Function
|
118
|
+
|
119
|
+
@arg a(int): first desc
|
120
|
+
@arg b(int): second desc
|
121
|
+
"""
|
122
|
+
pass
|
123
|
+
|
124
|
+
params = extract_param_docstring_mapping(style_func)
|
125
|
+
self.assertEqual(params, {'a': 'first desc', 'b': 'second desc'})
|
126
|
+
|
127
|
+
def test_extract_other_style_param_case7(self):
|
128
|
+
def style_func(a: int, b: int):
|
129
|
+
"""
|
130
|
+
Style Function
|
131
|
+
|
132
|
+
:arg: a: first desc
|
133
|
+
:arg: b: second desc
|
134
|
+
"""
|
135
|
+
pass
|
136
|
+
|
137
|
+
params = extract_param_docstring_mapping(style_func)
|
138
|
+
self.assertEqual(params, {'a': 'first desc', 'b': 'second desc'})
|
139
|
+
|
140
|
+
def test_extract_other_style_param_case8(self):
|
141
|
+
def style_func(a: int, b: int):
|
142
|
+
"""
|
143
|
+
Style Function
|
144
|
+
|
145
|
+
:arg a(int): first desc
|
146
|
+
:arg b(int): second desc
|
147
|
+
"""
|
148
|
+
pass
|
149
|
+
|
150
|
+
params = extract_param_docstring_mapping(style_func)
|
151
|
+
self.assertEqual(params, {'a': 'first desc', 'b': 'second desc'})
|
152
|
+
|
153
|
+
def test_extract_other_style_param_case9(self):
|
154
|
+
def style_func(a: int, b: int):
|
155
|
+
"""
|
156
|
+
Style Function
|
157
|
+
|
158
|
+
@arg a first desc
|
159
|
+
@arg b second desc
|
160
|
+
"""
|
161
|
+
pass
|
162
|
+
|
163
|
+
params = extract_param_docstring_mapping(style_func)
|
164
|
+
self.assertEqual(params, {'a': 'first desc', 'b': 'second desc'})
|
165
|
+
|
166
|
+
def test_extract_other_style_param_case10(self):
|
167
|
+
def style_func(a: int, b: int):
|
168
|
+
"""
|
169
|
+
Style Function
|
170
|
+
|
171
|
+
:arg a first desc
|
172
|
+
:arg b second desc
|
173
|
+
"""
|
174
|
+
pass
|
175
|
+
|
176
|
+
params = extract_param_docstring_mapping(style_func)
|
177
|
+
self.assertEqual(params, {'a': 'first desc', 'b': 'second desc'})
|
178
|
+
|
179
|
+
def test_extract_plain_style_param_case1(self):
|
180
|
+
def style_func(a: int, b: int):
|
181
|
+
"""
|
182
|
+
Style Function
|
183
|
+
|
184
|
+
a(int) : first desc
|
185
|
+
b(int) : second desc
|
186
|
+
"""
|
187
|
+
pass
|
188
|
+
|
189
|
+
params = extract_param_docstring_mapping(style_func)
|
190
|
+
self.assertEqual(params, {'a': 'first desc', 'b': 'second desc'})
|
191
|
+
|
192
|
+
def test_extract_plain_style_param_case2(self):
|
193
|
+
def style_func(a: int, b: int):
|
194
|
+
"""
|
195
|
+
Style Function
|
196
|
+
|
197
|
+
- a(int) : first desc
|
198
|
+
- b(int) : second desc
|
199
|
+
"""
|
200
|
+
pass
|
201
|
+
|
202
|
+
params = extract_param_docstring_mapping(style_func)
|
203
|
+
self.assertEqual(params, {'a': 'first desc', 'b': 'second desc'})
|
204
|
+
|
205
|
+
def test_extract_plain_style_param_case3(self):
|
206
|
+
def style_func(a: int, b: int):
|
207
|
+
"""
|
208
|
+
a: first desc
|
209
|
+
b: second desc
|
210
|
+
"""
|
211
|
+
pass
|
212
|
+
|
213
|
+
params = extract_param_docstring_mapping(style_func)
|
214
|
+
self.assertEqual(params, {'a': 'first desc', 'b': 'second desc'})
|
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
|
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
|
File without changes
|
File without changes
|
File without changes
|
{hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/cli/codegen/auth/auth_context_template.py
RENAMED
File without changes
|
{hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/cli/codegen/auth/auth_token_context_template.py
RENAMED
File without changes
|
{hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/cli/codegen/auth/auth_token_handler_template.py
RENAMED
File without changes
|
{hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/cli/codegen/auth/auth_token_schema_template.py
RENAMED
File without changes
|
{hyperpocket-0.1.9 → hyperpocket-0.1.10}/hyperpocket/cli/codegen/auth/server_auth_template.py
RENAMED
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
|
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
|
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
|