Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[开发中]支持调用LangChain Community 中的Tool实现 #164

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MrChengmo
Copy link
Collaborator

@MrChengmo MrChengmo commented Mar 5, 2024

用户示例代码

import appbuilder
from appbuilder import LangChainToolWrapper
from langchain_community.tools import ShellTool


# 使用LangChain的ShellTool插件
component = LangChainToolWrapper(langchain_tool = ShellTool())
query = appbuilder.Message("echo 'hello world' && time")

answer = component.run(query)
print(answer.content)

结果输出

➜  appbuilder python3 -u langchain_wrapper.py
/Users/chengmo/Library/Python/3.9/lib/python/site-packages/langchain_community/tools/shell/tool.py:32: UserWarning: The shell tool has no safeguards by default. Use at your own risk.
  warnings.warn(
Executing command:
 echo 'hello world' && time
hello world

real    0m0.000s
user    0m0.000s
sys     0m0.000s

@MrChengmo MrChengmo changed the title 支持调用LangChain Community 中的Tool实现 [开发中]支持调用LangChain Community 中的Tool实现 Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant