agenthub-python 0.1.0__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.
- agenthub/__init__.py +20 -0
- agenthub/auto_client.py +96 -0
- agenthub/base_client.py +185 -0
- agenthub/claude4_5/__init__.py +18 -0
- agenthub/claude4_5/client.py +315 -0
- agenthub/gemini3/__init__.py +18 -0
- agenthub/gemini3/client.py +231 -0
- agenthub/tracer.py +722 -0
- agenthub/types.py +134 -0
- agenthub_python-0.1.0.dist-info/METADATA +9 -0
- agenthub_python-0.1.0.dist-info/RECORD +12 -0
- agenthub_python-0.1.0.dist-info/WHEEL +4 -0
agenthub/types.py
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Copyright 2025 Prism Shadow. and/or its affiliates
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from enum import StrEnum
|
|
16
|
+
from typing import Any, Literal, NotRequired, TypedDict
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ThinkingLevel(StrEnum):
|
|
20
|
+
"""Thinking level for model reasoning."""
|
|
21
|
+
|
|
22
|
+
NONE = "none"
|
|
23
|
+
LOW = "low"
|
|
24
|
+
MEDIUM = "medium"
|
|
25
|
+
HIGH = "high"
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# Tool choice can be a literal string or a list of tool names
|
|
29
|
+
ToolChoice = Literal["auto", "required", "none"] | list[str]
|
|
30
|
+
Role = Literal["user", "assistant"]
|
|
31
|
+
Event = Literal["start", "delta", "stop", "unused"]
|
|
32
|
+
FinishReason = Literal["stop", "length", "unknown"]
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class TextContentItem(TypedDict):
|
|
36
|
+
type: Literal["text"]
|
|
37
|
+
text: str
|
|
38
|
+
signature: NotRequired[str | bytes]
|
|
39
|
+
tool_call_id: NotRequired[str]
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class ImageContentItem(TypedDict):
|
|
43
|
+
type: Literal["image_url"]
|
|
44
|
+
image_url: str
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class ThinkingContentItem(TypedDict):
|
|
48
|
+
type: Literal["thinking"]
|
|
49
|
+
thinking: str
|
|
50
|
+
signature: NotRequired[str | bytes]
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class ToolCallContentItem(TypedDict):
|
|
54
|
+
type: Literal["tool_call"]
|
|
55
|
+
name: str
|
|
56
|
+
argument: dict[str, Any]
|
|
57
|
+
tool_call_id: str
|
|
58
|
+
signature: NotRequired[str | bytes]
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class PartialToolCallContentItem(TypedDict):
|
|
62
|
+
type: Literal["partial_tool_call"]
|
|
63
|
+
name: str
|
|
64
|
+
argument: str
|
|
65
|
+
tool_call_id: str
|
|
66
|
+
signature: NotRequired[str | bytes]
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class ToolResultContentItem(TypedDict):
|
|
70
|
+
type: Literal["tool_result"]
|
|
71
|
+
result: str
|
|
72
|
+
tool_call_id: str
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
ContentItem = TextContentItem | ImageContentItem | ThinkingContentItem | ToolCallContentItem | ToolResultContentItem
|
|
76
|
+
|
|
77
|
+
PartialContentItem = ContentItem | PartialToolCallContentItem
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
class UsageMetadata(TypedDict):
|
|
81
|
+
"""Usage metadata for model response."""
|
|
82
|
+
|
|
83
|
+
prompt_tokens: int | None
|
|
84
|
+
thoughts_tokens: int | None
|
|
85
|
+
response_tokens: int | None
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
class UniMessage(TypedDict):
|
|
89
|
+
"""Universal message format for LLM communication."""
|
|
90
|
+
|
|
91
|
+
role: Role
|
|
92
|
+
content_items: list[ContentItem]
|
|
93
|
+
usage_metadata: NotRequired[UsageMetadata]
|
|
94
|
+
finish_reason: NotRequired[FinishReason]
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class UniEvent(TypedDict):
|
|
98
|
+
"""Universal event format for streaming responses."""
|
|
99
|
+
|
|
100
|
+
role: Role
|
|
101
|
+
content_items: list[ContentItem]
|
|
102
|
+
usage_metadata: NotRequired[UsageMetadata]
|
|
103
|
+
finish_reason: NotRequired[FinishReason]
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
class PartialUniEvent(TypedDict):
|
|
107
|
+
"""Partial universal event format for streaming responses."""
|
|
108
|
+
|
|
109
|
+
role: Role
|
|
110
|
+
event: Event
|
|
111
|
+
content_items: list[PartialContentItem]
|
|
112
|
+
usage_metadata: NotRequired[UsageMetadata]
|
|
113
|
+
finish_reason: NotRequired[FinishReason]
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
class ToolSchema(TypedDict):
|
|
117
|
+
"""Available tool schema."""
|
|
118
|
+
|
|
119
|
+
name: str
|
|
120
|
+
description: str
|
|
121
|
+
parameters: NotRequired[str]
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
class UniConfig(TypedDict):
|
|
125
|
+
"""Universal configuration format for LLM requests."""
|
|
126
|
+
|
|
127
|
+
max_tokens: NotRequired[int]
|
|
128
|
+
temperature: NotRequired[float]
|
|
129
|
+
tools: NotRequired[list[ToolSchema]]
|
|
130
|
+
thinking_summary: NotRequired[bool]
|
|
131
|
+
thinking_level: NotRequired[ThinkingLevel]
|
|
132
|
+
tool_choice: NotRequired[ToolChoice]
|
|
133
|
+
system_prompt: NotRequired[str]
|
|
134
|
+
trace_id: NotRequired[str]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
agenthub/__init__.py,sha256=-iRiinAB20naUHMs5DtsM_P4J8765gvxpI40-1eEIzs,756
|
|
2
|
+
agenthub/auto_client.py,sha256=bGwb7TUJJNjnOGgW9XvIN2xdECS1Q8XleeuP0cgrzSk,3829
|
|
3
|
+
agenthub/base_client.py,sha256=34GQSDWRCbzg32d63-53N_quGsUoZZcDKCs_wBJb5E8,6713
|
|
4
|
+
agenthub/claude4_5/__init__.py,sha256=EH7tWBNSG8X4ddKIslgmi5l4iMnan36ntK5p5rCKO5E,668
|
|
5
|
+
agenthub/claude4_5/client.py,sha256=AuZL8PY7IjGBB2m1LKvWeIbfad8o9ymCiTPhVh3RmYo,12864
|
|
6
|
+
agenthub/gemini3/__init__.py,sha256=vWjhCybVbDVwn_5F1DvKpw7IzS6zOWCChszC3XFg9W4,664
|
|
7
|
+
agenthub/gemini3/client.py,sha256=7ODBa21FVmjoN9Z4xvMjY7MnQgbC60Vqyl7brVOiImI,9539
|
|
8
|
+
agenthub/tracer.py,sha256=G_97RUP4uMNJR1CTgZR7ST2yxplLWWMs22jqunOeXIA,29207
|
|
9
|
+
agenthub/types.py,sha256=GUyUWs7nBNPCvdstYwRhFDDQZlpcy4HBKuL_h3g_GQg,3555
|
|
10
|
+
agenthub_python-0.1.0.dist-info/WHEEL,sha256=XjEbIc5-wIORjWaafhI6vBtlxDBp7S9KiujWF1EM7Ak,79
|
|
11
|
+
agenthub_python-0.1.0.dist-info/METADATA,sha256=0jlcULQbmmJdDiwbqvONW6f7gZckMHll0fZmxw8ZWGo,233
|
|
12
|
+
agenthub_python-0.1.0.dist-info/RECORD,,
|