youngjin-langchain-tools 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.
- youngjin_langchain_tools/__init__.py +47 -0
- youngjin_langchain_tools/handlers/__init__.py +15 -0
- youngjin_langchain_tools/handlers/streamlit_langgraph_handler.py +345 -0
- youngjin_langchain_tools/utils/__init__.py +13 -0
- youngjin_langchain_tools/utils/config.py +71 -0
- youngjin_langchain_tools-0.1.0.dist-info/METADATA +224 -0
- youngjin_langchain_tools-0.1.0.dist-info/RECORD +9 -0
- youngjin_langchain_tools-0.1.0.dist-info/WHEEL +4 -0
- youngjin_langchain_tools-0.1.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# youngjin_langchain_tools/__init__.py
|
|
2
|
+
"""
|
|
3
|
+
youngjin-langchain-tools Library
|
|
4
|
+
|
|
5
|
+
A collection of LangChain/LangGraph utilities for AI applications.
|
|
6
|
+
|
|
7
|
+
Package Structure:
|
|
8
|
+
- handlers: UI framework handlers (Streamlit, etc.)
|
|
9
|
+
- utils: Utility functions and helpers
|
|
10
|
+
|
|
11
|
+
Usage:
|
|
12
|
+
from youngjin_langchain_tools import StreamlitLanggraphHandler
|
|
13
|
+
|
|
14
|
+
# Use in Streamlit with LangGraph agent
|
|
15
|
+
with st.chat_message("assistant"):
|
|
16
|
+
handler = StreamlitLanggraphHandler(st.container())
|
|
17
|
+
response = handler.invoke(
|
|
18
|
+
agent=my_agent,
|
|
19
|
+
input={"messages": [{"role": "user", "content": prompt}]},
|
|
20
|
+
config={"configurable": {"thread_id": thread_id}}
|
|
21
|
+
)
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
__version__ = "0.1.0"
|
|
25
|
+
|
|
26
|
+
# Import subpackages
|
|
27
|
+
from youngjin_langchain_tools import handlers
|
|
28
|
+
from youngjin_langchain_tools import utils
|
|
29
|
+
|
|
30
|
+
# Import core classes for convenience
|
|
31
|
+
from youngjin_langchain_tools.handlers import StreamlitLanggraphHandler
|
|
32
|
+
from youngjin_langchain_tools.handlers.streamlit_langgraph_handler import (
|
|
33
|
+
StreamlitLanggraphHandlerConfig,
|
|
34
|
+
)
|
|
35
|
+
from youngjin_langchain_tools.utils import configure
|
|
36
|
+
|
|
37
|
+
__all__ = [
|
|
38
|
+
"__version__",
|
|
39
|
+
# Subpackages
|
|
40
|
+
"handlers",
|
|
41
|
+
"utils",
|
|
42
|
+
# Core classes
|
|
43
|
+
"StreamlitLanggraphHandler",
|
|
44
|
+
"StreamlitLanggraphHandlerConfig",
|
|
45
|
+
# Utility functions
|
|
46
|
+
"configure",
|
|
47
|
+
]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# youngjin_langchain_tools/handlers/__init__.py
|
|
2
|
+
"""
|
|
3
|
+
Handlers for integrating LangGraph with various frameworks.
|
|
4
|
+
|
|
5
|
+
This module provides handler classes that simplify the integration
|
|
6
|
+
of LangGraph agents with UI frameworks like Streamlit.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from youngjin_langchain_tools.handlers.streamlit_langgraph_handler import (
|
|
10
|
+
StreamlitLanggraphHandler,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
__all__ = [
|
|
14
|
+
"StreamlitLanggraphHandler",
|
|
15
|
+
]
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
# youngjin_langchain_tools/handlers/streamlit_langgraph_handler.py
|
|
2
|
+
"""
|
|
3
|
+
Streamlit handler for LangGraph agents.
|
|
4
|
+
|
|
5
|
+
This module provides a handler class that simplifies streaming
|
|
6
|
+
LangGraph agent responses in Streamlit applications.
|
|
7
|
+
|
|
8
|
+
Replaces the deprecated StreamlitCallbackHandler for LangGraph-based agents.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from typing import Any, Dict, List, Optional, Union, Generator
|
|
12
|
+
from dataclasses import dataclass, field
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@dataclass
|
|
16
|
+
class StreamlitLanggraphHandlerConfig:
|
|
17
|
+
"""Configuration for StreamlitLanggraphHandler."""
|
|
18
|
+
|
|
19
|
+
expand_new_thoughts: bool = True
|
|
20
|
+
"""Whether to expand the status container to show tool calls."""
|
|
21
|
+
|
|
22
|
+
max_tool_content_length: int = 2000
|
|
23
|
+
"""Maximum length of tool output to display before truncating."""
|
|
24
|
+
|
|
25
|
+
show_tool_calls: bool = True
|
|
26
|
+
"""Whether to display tool call information."""
|
|
27
|
+
|
|
28
|
+
show_tool_results: bool = True
|
|
29
|
+
"""Whether to display tool execution results."""
|
|
30
|
+
|
|
31
|
+
thinking_label: str = "🤔 Thinking..."
|
|
32
|
+
"""Label shown while the agent is processing."""
|
|
33
|
+
|
|
34
|
+
complete_label: str = "✅ Complete!"
|
|
35
|
+
"""Label shown when processing is complete."""
|
|
36
|
+
|
|
37
|
+
tool_call_emoji: str = "🔧"
|
|
38
|
+
"""Emoji for tool calls."""
|
|
39
|
+
|
|
40
|
+
tool_complete_emoji: str = "✅"
|
|
41
|
+
"""Emoji for completed tool executions."""
|
|
42
|
+
|
|
43
|
+
cursor: str = "▌"
|
|
44
|
+
"""Cursor character shown during streaming."""
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class StreamlitLanggraphHandler:
|
|
48
|
+
"""
|
|
49
|
+
Handler for streaming LangGraph agent responses in Streamlit.
|
|
50
|
+
|
|
51
|
+
This class provides a simple interface to visualize LangGraph agent
|
|
52
|
+
execution in Streamlit, similar to how StreamlitCallbackHandler worked
|
|
53
|
+
for the older LangChain AgentExecutor.
|
|
54
|
+
|
|
55
|
+
Features:
|
|
56
|
+
- Real-time streaming of agent responses
|
|
57
|
+
- Tool call visualization with expandable details
|
|
58
|
+
- Tool execution results with collapsible output
|
|
59
|
+
- Status indicator showing agent progress
|
|
60
|
+
- Configurable display options
|
|
61
|
+
|
|
62
|
+
Example:
|
|
63
|
+
```python
|
|
64
|
+
import streamlit as st
|
|
65
|
+
from youngjin_langchain_tools import StreamlitLanggraphHandler
|
|
66
|
+
|
|
67
|
+
with st.chat_message("assistant"):
|
|
68
|
+
handler = StreamlitLanggraphHandler(
|
|
69
|
+
container=st.container(),
|
|
70
|
+
expand_new_thoughts=True
|
|
71
|
+
)
|
|
72
|
+
response = handler.invoke(
|
|
73
|
+
agent=my_agent,
|
|
74
|
+
input={"messages": [{"role": "user", "content": prompt}]},
|
|
75
|
+
config={"configurable": {"thread_id": thread_id}}
|
|
76
|
+
)
|
|
77
|
+
# response contains the final text
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
For more control, use stream() method:
|
|
81
|
+
```python
|
|
82
|
+
handler = StreamlitLanggraphHandler(st.container())
|
|
83
|
+
for event in handler.stream(agent, input, config):
|
|
84
|
+
# event contains streaming data if needed
|
|
85
|
+
pass
|
|
86
|
+
final_response = handler.get_response()
|
|
87
|
+
```
|
|
88
|
+
"""
|
|
89
|
+
|
|
90
|
+
def __init__(
|
|
91
|
+
self,
|
|
92
|
+
container: Any,
|
|
93
|
+
*,
|
|
94
|
+
expand_new_thoughts: bool = True,
|
|
95
|
+
max_tool_content_length: int = 2000,
|
|
96
|
+
show_tool_calls: bool = True,
|
|
97
|
+
show_tool_results: bool = True,
|
|
98
|
+
thinking_label: str = "🤔 Thinking...",
|
|
99
|
+
complete_label: str = "✅ Complete!",
|
|
100
|
+
config: Optional[StreamlitLanggraphHandlerConfig] = None,
|
|
101
|
+
):
|
|
102
|
+
"""
|
|
103
|
+
Initialize the StreamlitLanggraphHandler.
|
|
104
|
+
|
|
105
|
+
Args:
|
|
106
|
+
container: Streamlit container to render content in.
|
|
107
|
+
Usually st.container() or similar.
|
|
108
|
+
expand_new_thoughts: Whether to expand status container
|
|
109
|
+
to show tool calls. Defaults to True.
|
|
110
|
+
max_tool_content_length: Maximum characters of tool output
|
|
111
|
+
to display. Defaults to 2000.
|
|
112
|
+
show_tool_calls: Whether to show tool call info. Defaults to True.
|
|
113
|
+
show_tool_results: Whether to show tool results. Defaults to True.
|
|
114
|
+
thinking_label: Label while processing. Defaults to "🤔 Thinking...".
|
|
115
|
+
complete_label: Label when complete. Defaults to "✅ Complete!".
|
|
116
|
+
config: Optional config object. If provided, overrides other params.
|
|
117
|
+
"""
|
|
118
|
+
if config is not None:
|
|
119
|
+
self._config = config
|
|
120
|
+
else:
|
|
121
|
+
self._config = StreamlitLanggraphHandlerConfig(
|
|
122
|
+
expand_new_thoughts=expand_new_thoughts,
|
|
123
|
+
max_tool_content_length=max_tool_content_length,
|
|
124
|
+
show_tool_calls=show_tool_calls,
|
|
125
|
+
show_tool_results=show_tool_results,
|
|
126
|
+
thinking_label=thinking_label,
|
|
127
|
+
complete_label=complete_label,
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
self._container = container
|
|
131
|
+
self._final_response: str = ""
|
|
132
|
+
self._status_container: Any = None
|
|
133
|
+
self._response_placeholder: Any = None
|
|
134
|
+
|
|
135
|
+
@property
|
|
136
|
+
def config(self) -> StreamlitLanggraphHandlerConfig:
|
|
137
|
+
"""Get the handler configuration."""
|
|
138
|
+
return self._config
|
|
139
|
+
|
|
140
|
+
def get_response(self) -> str:
|
|
141
|
+
"""
|
|
142
|
+
Get the final response text after streaming completes.
|
|
143
|
+
|
|
144
|
+
Returns:
|
|
145
|
+
The accumulated response text from the agent.
|
|
146
|
+
"""
|
|
147
|
+
return self._final_response
|
|
148
|
+
|
|
149
|
+
def invoke(
|
|
150
|
+
self,
|
|
151
|
+
agent: Any,
|
|
152
|
+
input: Dict[str, Any],
|
|
153
|
+
config: Optional[Dict[str, Any]] = None,
|
|
154
|
+
) -> str:
|
|
155
|
+
"""
|
|
156
|
+
Invoke the agent and stream the response with visualization.
|
|
157
|
+
|
|
158
|
+
This is the main method for simple usage. It handles all the
|
|
159
|
+
streaming complexity and returns the final response.
|
|
160
|
+
|
|
161
|
+
Args:
|
|
162
|
+
agent: The LangGraph agent (CompiledGraph) to invoke.
|
|
163
|
+
input: Input dictionary, typically {"messages": [...]}.
|
|
164
|
+
config: Optional config dict with "configurable" key for thread_id etc.
|
|
165
|
+
|
|
166
|
+
Returns:
|
|
167
|
+
The final response text from the agent.
|
|
168
|
+
|
|
169
|
+
Example:
|
|
170
|
+
```python
|
|
171
|
+
response = handler.invoke(
|
|
172
|
+
agent=my_agent,
|
|
173
|
+
input={"messages": [{"role": "user", "content": "Hello"}]},
|
|
174
|
+
config={"configurable": {"thread_id": "123"}}
|
|
175
|
+
)
|
|
176
|
+
st.write(response)
|
|
177
|
+
```
|
|
178
|
+
"""
|
|
179
|
+
# Consume the generator to completion
|
|
180
|
+
for _ in self.stream(agent, input, config):
|
|
181
|
+
pass
|
|
182
|
+
return self._final_response
|
|
183
|
+
|
|
184
|
+
def stream(
|
|
185
|
+
self,
|
|
186
|
+
agent: Any,
|
|
187
|
+
input: Dict[str, Any],
|
|
188
|
+
config: Optional[Dict[str, Any]] = None,
|
|
189
|
+
) -> Generator[Dict[str, Any], None, None]:
|
|
190
|
+
"""
|
|
191
|
+
Stream agent execution with visualization.
|
|
192
|
+
|
|
193
|
+
This method provides more control than invoke(), yielding
|
|
194
|
+
each streaming event for custom processing.
|
|
195
|
+
|
|
196
|
+
Args:
|
|
197
|
+
agent: The LangGraph agent (CompiledGraph) to invoke.
|
|
198
|
+
input: Input dictionary, typically {"messages": [...]}.
|
|
199
|
+
config: Optional config dict.
|
|
200
|
+
|
|
201
|
+
Yields:
|
|
202
|
+
Dictionary with event information:
|
|
203
|
+
- "type": "tool_call" | "tool_result" | "token" | "complete"
|
|
204
|
+
- "data": Event-specific data
|
|
205
|
+
|
|
206
|
+
Example:
|
|
207
|
+
```python
|
|
208
|
+
for event in handler.stream(agent, input, config):
|
|
209
|
+
if event["type"] == "token":
|
|
210
|
+
# Custom token handling
|
|
211
|
+
pass
|
|
212
|
+
```
|
|
213
|
+
"""
|
|
214
|
+
# Import streamlit here to avoid import errors when not using streamlit
|
|
215
|
+
try:
|
|
216
|
+
import streamlit as st
|
|
217
|
+
except ImportError:
|
|
218
|
+
raise ImportError(
|
|
219
|
+
"streamlit is required for StreamlitLanggraphHandler. "
|
|
220
|
+
"Install it with: pip install streamlit"
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
# Reset state
|
|
224
|
+
self._final_response = ""
|
|
225
|
+
|
|
226
|
+
# Create UI components
|
|
227
|
+
with self._container:
|
|
228
|
+
self._status_container = st.status(
|
|
229
|
+
self._config.thinking_label,
|
|
230
|
+
expanded=self._config.expand_new_thoughts
|
|
231
|
+
)
|
|
232
|
+
self._response_placeholder = st.empty()
|
|
233
|
+
|
|
234
|
+
# Stream from agent
|
|
235
|
+
config = config or {}
|
|
236
|
+
|
|
237
|
+
for stream_mode, data in agent.stream(
|
|
238
|
+
input,
|
|
239
|
+
config=config,
|
|
240
|
+
stream_mode=["messages", "updates"]
|
|
241
|
+
):
|
|
242
|
+
if stream_mode == "updates":
|
|
243
|
+
yield from self._handle_updates(data)
|
|
244
|
+
elif stream_mode == "messages":
|
|
245
|
+
yield from self._handle_messages(data)
|
|
246
|
+
|
|
247
|
+
# Mark as complete
|
|
248
|
+
self._status_container.update(
|
|
249
|
+
label=self._config.complete_label,
|
|
250
|
+
state="complete",
|
|
251
|
+
expanded=False
|
|
252
|
+
)
|
|
253
|
+
|
|
254
|
+
# Final render without cursor
|
|
255
|
+
if self._final_response:
|
|
256
|
+
self._response_placeholder.markdown(self._final_response)
|
|
257
|
+
|
|
258
|
+
yield {"type": "complete", "data": {"response": self._final_response}}
|
|
259
|
+
|
|
260
|
+
def _handle_updates(
|
|
261
|
+
self,
|
|
262
|
+
data: Dict[str, Any]
|
|
263
|
+
) -> Generator[Dict[str, Any], None, None]:
|
|
264
|
+
"""Handle 'updates' stream mode events."""
|
|
265
|
+
try:
|
|
266
|
+
import streamlit as st
|
|
267
|
+
except ImportError:
|
|
268
|
+
return
|
|
269
|
+
|
|
270
|
+
for source, update in data.items():
|
|
271
|
+
if not isinstance(update, dict):
|
|
272
|
+
continue
|
|
273
|
+
|
|
274
|
+
messages = update.get("messages", [])
|
|
275
|
+
for msg in messages:
|
|
276
|
+
# Handle tool calls
|
|
277
|
+
if hasattr(msg, 'tool_calls') and msg.tool_calls:
|
|
278
|
+
if self._config.show_tool_calls:
|
|
279
|
+
for tc in msg.tool_calls:
|
|
280
|
+
tool_name = tc.get('name', 'tool')
|
|
281
|
+
tool_args = tc.get('args', {})
|
|
282
|
+
|
|
283
|
+
with self._status_container:
|
|
284
|
+
st.write(
|
|
285
|
+
f"{self._config.tool_call_emoji} "
|
|
286
|
+
f"**{tool_name}**: `{tool_args}`"
|
|
287
|
+
)
|
|
288
|
+
|
|
289
|
+
yield {
|
|
290
|
+
"type": "tool_call",
|
|
291
|
+
"data": {"name": tool_name, "args": tool_args}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
# Handle tool results
|
|
295
|
+
if source == "tools" and hasattr(msg, 'name'):
|
|
296
|
+
if self._config.show_tool_results:
|
|
297
|
+
tool_name = msg.name
|
|
298
|
+
tool_content = str(msg.content) if hasattr(msg, 'content') else ""
|
|
299
|
+
|
|
300
|
+
with self._status_container:
|
|
301
|
+
st.write(
|
|
302
|
+
f"{self._config.tool_complete_emoji} "
|
|
303
|
+
f"**{tool_name}** 완료"
|
|
304
|
+
)
|
|
305
|
+
with st.expander(f"📋 {tool_name} 결과 보기", expanded=False):
|
|
306
|
+
if len(tool_content) > self._config.max_tool_content_length:
|
|
307
|
+
st.code(
|
|
308
|
+
tool_content[:self._config.max_tool_content_length]
|
|
309
|
+
+ "\n... (truncated)",
|
|
310
|
+
language="text"
|
|
311
|
+
)
|
|
312
|
+
else:
|
|
313
|
+
st.code(tool_content, language="text")
|
|
314
|
+
|
|
315
|
+
yield {
|
|
316
|
+
"type": "tool_result",
|
|
317
|
+
"data": {"name": tool_name, "content": tool_content}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
def _handle_messages(
|
|
321
|
+
self,
|
|
322
|
+
data: tuple
|
|
323
|
+
) -> Generator[Dict[str, Any], None, None]:
|
|
324
|
+
"""Handle 'messages' stream mode events."""
|
|
325
|
+
chunk, metadata = data
|
|
326
|
+
|
|
327
|
+
# Skip tool node messages
|
|
328
|
+
if metadata.get("langgraph_node") == "tools":
|
|
329
|
+
return
|
|
330
|
+
|
|
331
|
+
# Handle content chunks
|
|
332
|
+
if hasattr(chunk, 'content') and chunk.content:
|
|
333
|
+
# Skip tool call chunks
|
|
334
|
+
if hasattr(chunk, 'tool_call_chunks') and chunk.tool_call_chunks:
|
|
335
|
+
return
|
|
336
|
+
|
|
337
|
+
self._final_response += chunk.content
|
|
338
|
+
self._response_placeholder.markdown(
|
|
339
|
+
self._final_response + self._config.cursor
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
yield {
|
|
343
|
+
"type": "token",
|
|
344
|
+
"data": {"content": chunk.content, "accumulated": self._final_response}
|
|
345
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# youngjin_langchain_tools/utils/__init__.py
|
|
2
|
+
"""
|
|
3
|
+
Utility functions and helpers.
|
|
4
|
+
|
|
5
|
+
This module contains utility functions used across the library.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from youngjin_langchain_tools.utils.config import configure, get_config
|
|
9
|
+
|
|
10
|
+
__all__ = [
|
|
11
|
+
"configure",
|
|
12
|
+
"get_config",
|
|
13
|
+
]
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# youngjin_langchain_tools/utils/config.py
|
|
2
|
+
"""
|
|
3
|
+
Configuration management for youngjin-langchain-tools.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from typing import Any, Dict, Optional
|
|
7
|
+
from pydantic import BaseModel
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class LibraryConfig(BaseModel):
|
|
11
|
+
"""Global configuration for the library."""
|
|
12
|
+
|
|
13
|
+
verbose: bool = False
|
|
14
|
+
cache_enabled: bool = True
|
|
15
|
+
timeout: int = 30
|
|
16
|
+
|
|
17
|
+
class Config:
|
|
18
|
+
extra = "allow"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
# Global configuration instance
|
|
22
|
+
_config: LibraryConfig = LibraryConfig()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def configure(
|
|
26
|
+
verbose: Optional[bool] = None,
|
|
27
|
+
cache_enabled: Optional[bool] = None,
|
|
28
|
+
timeout: Optional[int] = None,
|
|
29
|
+
**kwargs: Any,
|
|
30
|
+
) -> LibraryConfig:
|
|
31
|
+
"""
|
|
32
|
+
Configure global library settings.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
verbose: Enable verbose output.
|
|
36
|
+
cache_enabled: Enable caching.
|
|
37
|
+
timeout: Default timeout in seconds.
|
|
38
|
+
**kwargs: Additional configuration options.
|
|
39
|
+
|
|
40
|
+
Returns:
|
|
41
|
+
The updated configuration object.
|
|
42
|
+
|
|
43
|
+
Example:
|
|
44
|
+
>>> configure(verbose=True, cache_enabled=False)
|
|
45
|
+
>>> configure(custom_option="value")
|
|
46
|
+
"""
|
|
47
|
+
global _config
|
|
48
|
+
|
|
49
|
+
updates: Dict[str, Any] = {}
|
|
50
|
+
|
|
51
|
+
if verbose is not None:
|
|
52
|
+
updates["verbose"] = verbose
|
|
53
|
+
if cache_enabled is not None:
|
|
54
|
+
updates["cache_enabled"] = cache_enabled
|
|
55
|
+
if timeout is not None:
|
|
56
|
+
updates["timeout"] = timeout
|
|
57
|
+
|
|
58
|
+
updates.update(kwargs)
|
|
59
|
+
|
|
60
|
+
_config = LibraryConfig(**{**_config.model_dump(), **updates})
|
|
61
|
+
return _config
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def get_config() -> LibraryConfig:
|
|
65
|
+
"""
|
|
66
|
+
Get the current global configuration.
|
|
67
|
+
|
|
68
|
+
Returns:
|
|
69
|
+
The current configuration object.
|
|
70
|
+
"""
|
|
71
|
+
return _config
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: youngjin-langchain-tools
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: LangGraph utilities for Streamlit - StreamlitLanggraphHandler and more
|
|
5
|
+
Project-URL: Homepage, https://github.com/yourusername/youngjin-langchain-tools
|
|
6
|
+
Project-URL: Documentation, https://github.com/yourusername/youngjin-langchain-tools#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/yourusername/youngjin-langchain-tools.git
|
|
8
|
+
Project-URL: Issues, https://github.com/yourusername/youngjin-langchain-tools/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/yourusername/youngjin-langchain-tools/releases
|
|
10
|
+
Author-email: YoungJin <your-email@example.com>
|
|
11
|
+
Maintainer-email: YoungJin <your-email@example.com>
|
|
12
|
+
License: Apache-2.0
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Keywords: agents,ai,callback,handler,langchain,langgraph,llm,streamlit
|
|
15
|
+
Classifier: Development Status :: 3 - Alpha
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
+
Requires-Python: >=3.12
|
|
25
|
+
Requires-Dist: langchain-core<1.2.7,>=1.0.0
|
|
26
|
+
Requires-Dist: langchain<1.2.7,>=1.0.0
|
|
27
|
+
Requires-Dist: pydantic>=2.0.0
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: mypy>=1.10.0; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
|
|
31
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
32
|
+
Requires-Dist: ruff>=0.4.0; extra == 'dev'
|
|
33
|
+
Requires-Dist: streamlit>=1.30.0; extra == 'dev'
|
|
34
|
+
Provides-Extra: streamlit
|
|
35
|
+
Requires-Dist: streamlit>=1.30.0; extra == 'streamlit'
|
|
36
|
+
Description-Content-Type: text/markdown
|
|
37
|
+
|
|
38
|
+
# youngjin-langchain-tools
|
|
39
|
+
|
|
40
|
+
**youngjin-langchain-tools** is a collection of LangGraph utilities designed to simplify AI application development with Streamlit and other frameworks.
|
|
41
|
+
|
|
42
|
+
## Features
|
|
43
|
+
|
|
44
|
+
- **StreamlitLanggraphHandler**: A drop-in replacement for the deprecated `StreamlitCallbackHandler`, designed for LangGraph agents
|
|
45
|
+
- **Real-time Streaming**: Stream agent responses with live token updates
|
|
46
|
+
- **Tool Visualization**: Display tool calls and results with expandable UI components
|
|
47
|
+
- **Configurable**: Customize display options, labels, and behavior
|
|
48
|
+
|
|
49
|
+
## Installation
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pip install youngjin-langchain-tools
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Or using uv:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
uv add youngjin-langchain-tools
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
With Streamlit support:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pip install youngjin-langchain-tools[streamlit]
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Quick Start
|
|
68
|
+
|
|
69
|
+
### Basic Usage with LangGraph Agent
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
import streamlit as st
|
|
73
|
+
from langgraph.checkpoint.memory import InMemorySaver
|
|
74
|
+
from langchain.agents import create_agent
|
|
75
|
+
from youngjin_langchain_tools import StreamlitLanggraphHandler
|
|
76
|
+
|
|
77
|
+
# Create your LangGraph agent
|
|
78
|
+
agent = create_agent(
|
|
79
|
+
model=llm,
|
|
80
|
+
tools=tools,
|
|
81
|
+
checkpointer=InMemorySaver(),
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
# In your Streamlit app
|
|
85
|
+
with st.chat_message("assistant"):
|
|
86
|
+
handler = StreamlitLanggraphHandler(
|
|
87
|
+
container=st.container(),
|
|
88
|
+
expand_new_thoughts=True
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
response = handler.invoke(
|
|
92
|
+
agent=agent,
|
|
93
|
+
input={"messages": [{"role": "user", "content": prompt}]},
|
|
94
|
+
config={"configurable": {"thread_id": thread_id}}
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
# response contains the final text
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Before & After Comparison
|
|
101
|
+
|
|
102
|
+
**Before (LangChain < 1.0 with AgentExecutor):**
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
from langchain.callbacks import StreamlitCallbackHandler
|
|
106
|
+
|
|
107
|
+
with st.chat_message("assistant"):
|
|
108
|
+
st_cb = StreamlitCallbackHandler(st.container(), expand_new_thoughts=True)
|
|
109
|
+
response = agent_executor.invoke(
|
|
110
|
+
{"input": prompt},
|
|
111
|
+
config=RunnableConfig({"callbacks": [st_cb]})
|
|
112
|
+
)
|
|
113
|
+
st.write(response["output"])
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**After (LangGraph with StreamlitLanggraphHandler):**
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
from youngjin_langchain_tools import StreamlitLanggraphHandler
|
|
120
|
+
|
|
121
|
+
with st.chat_message("assistant"):
|
|
122
|
+
handler = StreamlitLanggraphHandler(st.container(), expand_new_thoughts=True)
|
|
123
|
+
response = handler.invoke(
|
|
124
|
+
agent=langgraph_agent,
|
|
125
|
+
input={"messages": [{"role": "user", "content": prompt}]},
|
|
126
|
+
config={"configurable": {"thread_id": thread_id}}
|
|
127
|
+
)
|
|
128
|
+
# response is the final text directly
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Advanced Usage with Custom Configuration
|
|
132
|
+
|
|
133
|
+
```python
|
|
134
|
+
from youngjin_langchain_tools import (
|
|
135
|
+
StreamlitLanggraphHandler,
|
|
136
|
+
StreamlitLanggraphHandlerConfig
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
# Create custom configuration
|
|
140
|
+
config = StreamlitLanggraphHandlerConfig(
|
|
141
|
+
expand_new_thoughts=True,
|
|
142
|
+
max_tool_content_length=3000,
|
|
143
|
+
show_tool_calls=True,
|
|
144
|
+
show_tool_results=True,
|
|
145
|
+
thinking_label="🧠Processing...",
|
|
146
|
+
complete_label="✨ Done!",
|
|
147
|
+
tool_call_emoji="âš¡",
|
|
148
|
+
tool_complete_emoji="✓",
|
|
149
|
+
cursor="â–ˆ",
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
handler = StreamlitLanggraphHandler(
|
|
153
|
+
container=st.container(),
|
|
154
|
+
config=config
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
# Use stream() for more control
|
|
158
|
+
for event in handler.stream(agent, input, config):
|
|
159
|
+
if event["type"] == "tool_call":
|
|
160
|
+
print(f"Tool called: {event['data']['name']}")
|
|
161
|
+
elif event["type"] == "token":
|
|
162
|
+
# Custom token handling
|
|
163
|
+
pass
|
|
164
|
+
|
|
165
|
+
final_response = handler.get_response()
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## API Reference
|
|
169
|
+
|
|
170
|
+
### StreamlitLanggraphHandler
|
|
171
|
+
|
|
172
|
+
Main handler class for streaming LangGraph agents in Streamlit.
|
|
173
|
+
|
|
174
|
+
#### Constructor Parameters
|
|
175
|
+
|
|
176
|
+
| Parameter | Type | Default | Description |
|
|
177
|
+
|-----------|------|---------|-------------|
|
|
178
|
+
| `container` | Any | required | Streamlit container to render in |
|
|
179
|
+
| `expand_new_thoughts` | bool | `True` | Expand status container for tool calls |
|
|
180
|
+
| `max_tool_content_length` | int | `2000` | Max chars of tool output to display |
|
|
181
|
+
| `show_tool_calls` | bool | `True` | Show tool call information |
|
|
182
|
+
| `show_tool_results` | bool | `True` | Show tool execution results |
|
|
183
|
+
| `thinking_label` | str | `"🤔 Thinking..."` | Label while processing |
|
|
184
|
+
| `complete_label` | str | `"✅ Complete!"` | Label when complete |
|
|
185
|
+
| `config` | Config | `None` | Optional config object |
|
|
186
|
+
|
|
187
|
+
#### Methods
|
|
188
|
+
|
|
189
|
+
| Method | Description |
|
|
190
|
+
|--------|-------------|
|
|
191
|
+
| `invoke(agent, input, config)` | Execute agent and return final response |
|
|
192
|
+
| `stream(agent, input, config)` | Generator yielding streaming events |
|
|
193
|
+
| `get_response()` | Get accumulated response text |
|
|
194
|
+
|
|
195
|
+
### StreamlitLanggraphHandlerConfig
|
|
196
|
+
|
|
197
|
+
Configuration dataclass for handler customization.
|
|
198
|
+
|
|
199
|
+
## Architecture
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
youngjin_langchain_tools/
|
|
203
|
+
├── __init__.py # Package exports
|
|
204
|
+
├── handlers/ # UI framework handlers
|
|
205
|
+
│ ├── __init__.py
|
|
206
|
+
│ └── streamlit_langgraph_handler.py
|
|
207
|
+
└── utils/ # Utility functions
|
|
208
|
+
├── __init__.py
|
|
209
|
+
└── config.py
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## Requirements
|
|
213
|
+
|
|
214
|
+
- Python 3.12+
|
|
215
|
+
- LangGraph 0.2+
|
|
216
|
+
- Streamlit 1.30+ (optional, for StreamlitLanggraphHandler)
|
|
217
|
+
|
|
218
|
+
## License
|
|
219
|
+
|
|
220
|
+
Apache License 2.0 - see [LICENSE](LICENSE) for details.
|
|
221
|
+
|
|
222
|
+
## Contributing
|
|
223
|
+
|
|
224
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
youngjin_langchain_tools/__init__.py,sha256=S5GJtbYymhDuGtTibEG61Li9UvwvoFtnKm4mxjWNgnU,1310
|
|
2
|
+
youngjin_langchain_tools/handlers/__init__.py,sha256=-vGk-m1fqOipJSe02ogcScE0K3pdVwO9A_EqBovPRxo,397
|
|
3
|
+
youngjin_langchain_tools/handlers/streamlit_langgraph_handler.py,sha256=2josz-hgarSDlHjBhak-S5U2aijg6TF8GU1vtxhgcl8,12157
|
|
4
|
+
youngjin_langchain_tools/utils/__init__.py,sha256=LgSd7Gz2n5WgIhxaKHqpmQVUaBUDT_TTTw63hzoWGgM,272
|
|
5
|
+
youngjin_langchain_tools/utils/config.py,sha256=hHvdxsn5ZFWRJvR6N7ODy94JbCkeJocsS58hmvxoK5I,1640
|
|
6
|
+
youngjin_langchain_tools-0.1.0.dist-info/METADATA,sha256=ON9jSdJIFjEyP96zgy5ETlJ-KXNHkCIKK1jVsYUeyq4,6920
|
|
7
|
+
youngjin_langchain_tools-0.1.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
8
|
+
youngjin_langchain_tools-0.1.0.dist-info/licenses/LICENSE,sha256=fENUlkDDxJEn5c0u8mhVcz5ek-rTg2L4Kby1tMNchI8,11342
|
|
9
|
+
youngjin_langchain_tools-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 YoungJin
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|