hyperpocket-anthropic 0.1.9__py3-none-any.whl → 0.2.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- hyperpocket_anthropic/pocket_anthropic.py +14 -4
- {hyperpocket_anthropic-0.1.9.dist-info → hyperpocket_anthropic-0.2.0.dist-info}/METADATA +8 -10
- {hyperpocket_anthropic-0.1.9.dist-info → hyperpocket_anthropic-0.2.0.dist-info}/RECORD +4 -4
- {hyperpocket_anthropic-0.1.9.dist-info → hyperpocket_anthropic-0.2.0.dist-info}/WHEEL +0 -0
@@ -36,7 +36,11 @@ class PocketAnthropic(Pocket):
|
|
36
36
|
body = json.loads(body)
|
37
37
|
|
38
38
|
result, interrupted = self.invoke_with_state(
|
39
|
-
tool_use_block.name,
|
39
|
+
tool_use_block.name,
|
40
|
+
body=body,
|
41
|
+
thread_id=thread_id,
|
42
|
+
profile=profile,
|
43
|
+
**kwargs,
|
40
44
|
)
|
41
45
|
say = result
|
42
46
|
if interrupted:
|
@@ -51,7 +55,7 @@ class PocketAnthropic(Pocket):
|
|
51
55
|
return tool_result_block
|
52
56
|
|
53
57
|
async def ainvoke(
|
54
|
-
|
58
|
+
self, tool_use_block: ToolUseBlock, **kwargs
|
55
59
|
) -> ToolResultBlockParam:
|
56
60
|
if isinstance(tool_use_block.input, str):
|
57
61
|
arg = json.loads(tool_use_block.input)
|
@@ -73,7 +77,11 @@ class PocketAnthropic(Pocket):
|
|
73
77
|
body = json.loads(body)
|
74
78
|
|
75
79
|
result, interrupted = await self.ainvoke_with_state(
|
76
|
-
tool_use_block.name,
|
80
|
+
tool_use_block.name,
|
81
|
+
body=body,
|
82
|
+
thread_id=thread_id,
|
83
|
+
profile=profile,
|
84
|
+
**kwargs,
|
77
85
|
)
|
78
86
|
say = result
|
79
87
|
|
@@ -88,7 +96,9 @@ class PocketAnthropic(Pocket):
|
|
88
96
|
|
89
97
|
return tool_result_block
|
90
98
|
|
91
|
-
def get_anthropic_tool_specs(
|
99
|
+
def get_anthropic_tool_specs(
|
100
|
+
self, use_profile: Optional[bool] = None
|
101
|
+
) -> List[dict]:
|
92
102
|
if use_profile is not None:
|
93
103
|
self.use_profile = use_profile
|
94
104
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: hyperpocket-anthropic
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.2.0
|
4
4
|
Author-email: Hyperpocket Team <hyperpocket@vessl.ai>
|
5
5
|
Requires-Python: >=3.10
|
6
6
|
Requires-Dist: anthropic>=0.40.0
|
@@ -12,14 +12,14 @@ Description-Content-Type: text/markdown
|
|
12
12
|
### Get Pocket Anthropic Tool Spec
|
13
13
|
|
14
14
|
```python
|
15
|
-
|
15
|
+
|
16
16
|
|
17
17
|
from hyperpocket_anthropic import PocketAnthropic
|
18
18
|
|
19
19
|
pocket = PocketAnthropic(tools=[
|
20
20
|
"https://github.com/my-org/some-awesome-tool",
|
21
|
-
|
22
|
-
|
21
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/get-message",
|
22
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/post-message",
|
23
23
|
]
|
24
24
|
)
|
25
25
|
|
@@ -86,14 +86,13 @@ response_after_tool_call = llm.messages.create(
|
|
86
86
|
import os
|
87
87
|
|
88
88
|
from anthropic import Anthropic
|
89
|
-
from hyperpocket.tool import from_git
|
90
89
|
|
91
90
|
from hyperpocket_anthropic import PocketAnthropic
|
92
91
|
|
93
92
|
pocket = PocketAnthropic(tools=[
|
94
93
|
"https://github.com/my-org/some-awesome-tool",
|
95
|
-
|
96
|
-
|
94
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/get-message",
|
95
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/post-message",
|
97
96
|
]
|
98
97
|
)
|
99
98
|
|
@@ -138,15 +137,14 @@ response_after_tool_call = llm.messages.create(
|
|
138
137
|
import os
|
139
138
|
|
140
139
|
from anthropic import Anthropic
|
141
|
-
from hyperpocket.tool import from_git
|
142
140
|
|
143
141
|
from hyperpocket_anthropic import PocketAnthropic
|
144
142
|
|
145
143
|
client = Anthropic()
|
146
144
|
pocket = PocketAnthropic(tools=[
|
147
145
|
"https://github.com/my-org/some-awesome-tool",
|
148
|
-
|
149
|
-
|
146
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/get-message",
|
147
|
+
"https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/post-message",
|
150
148
|
]
|
151
149
|
)
|
152
150
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
hyperpocket_anthropic/__init__.py,sha256=XZl2uODSPMjSOO1LwrJOVMUD1qmGCuykx9SDePN7gLo,98
|
2
|
-
hyperpocket_anthropic/pocket_anthropic.py,sha256=
|
2
|
+
hyperpocket_anthropic/pocket_anthropic.py,sha256=bzZijikVVrunQr9QLiUuJopUmKU79QU1AultkaGrBCM,3371
|
3
3
|
hyperpocket_anthropic/util/__init__.py,sha256=U8x3PBHTFMpbtbAA5-pQVsggQ3Yph4oeC13wfyzK21I,123
|
4
4
|
hyperpocket_anthropic/util/tool_to_anthropic_spec.py,sha256=Lnxs-RMdHkpswjG1aJeEXGuJe8vQfWsbZccsbdPb3_U,749
|
5
|
-
hyperpocket_anthropic-0.
|
6
|
-
hyperpocket_anthropic-0.
|
7
|
-
hyperpocket_anthropic-0.
|
5
|
+
hyperpocket_anthropic-0.2.0.dist-info/METADATA,sha256=e9E0ubI78mCHPW6SIVYhv49_r8mAgaBKyAHXhAww75U,4563
|
6
|
+
hyperpocket_anthropic-0.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
7
|
+
hyperpocket_anthropic-0.2.0.dist-info/RECORD,,
|
File without changes
|