-
Notifications
You must be signed in to change notification settings - Fork 892
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
feat: support LangChain #344
Conversation
Implement local services: search, mathematical operations, email summary
@yihong0618 @frostming @pjq can you help to review this, seems amazing |
Implement local services: search, mathematical operations, email summary
演示: 待办: xiaogpt很棒,谢谢提供这么好玩的项目!关于pr有任何问题,欢迎联系告知,致敬~ :) |
@dongjing007 感谢。有个小建议,能把注释和 print 改成英文么?不是因为我们是国际化的,而是之前用英语弄的,稍微统一一点儿。 hint: pip install -U black |
可能需要把你的工作添加到 README 里 |
好的,沒问题,我改下~ |
好的,我再补充下 |
docs:Convert to English annotation
docs:Convert to English annotation
@yihong0618 你好,已经对PR进行了优化:
style:
docs:
麻烦再看一下,是否还有其他问题,谢谢~ 😃 |
好的,可能晚上看哈,白天有点事情。 |
嗯嗯,不急的,有空再处理 |
README.md
Outdated
@@ -76,6 +77,10 @@ export OPENAI_API_KEY=${your_api_key} | |||
xiaogpt --hardware LX06 --mute_xiaoai --use_gpt3 | |||
# 如果你想用 edge-tts | |||
xiaogpt --hardware LX06 --cookie ${cookie} --use_chatgpt_api --enable_edge_tts | |||
# 如果你想使用 LangChain + SerpApi 实现上网检索或其他本地服务(目前仅支持stream模式) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
目前仅支持stream模式 -> 目前仅支持 stream 模式
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok,已调整
README.md
Outdated
@@ -57,6 +57,7 @@ Play ChatGPT and other LLM with Xiaomi AI Speaker | |||
- 如果你遇到了墙需要用 Cloudflare Workers 替换 api_base 请使用 `--api_base ${url}` 来替换。 **请注意,此处你输入的api应该是'`https://xxxx/v1`'的字样,域名需要用引号包裹** | |||
- 可以跟小爱说 `开始持续对话` 自动进入持续对话状态,`结束持续对话` 结束持续对话状态。 | |||
- 可以使用 `--enable_edge_tts` 来获取更好的 tts 能力 | |||
- 可以使用 `--use_langchain` 替代 `--use_chatgpt_api` 来调用LangChain(默认chatgpt)服务,实现上网检索、数学运算.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
来调用 LangChain(默认 chatgpt)服务,实现上网检索、数学运算..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok,已调整
pyproject.toml
Outdated
@@ -20,6 +20,11 @@ dependencies = [ | |||
"bardapi", | |||
"edge-tts>=6.1.3", | |||
"EdgeGPT==0.1.26", | |||
"langchain", | |||
"datetime", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lock the langchain version since it changes a lot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok,已调整
xiaogpt/bot/langchain_bot.py
Outdated
else: | ||
break | ||
except Exception as e: | ||
# 处理异常的代码 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drop the comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok,已调整
测试了大部分代码没问题,有个小的疑问是,邮件这个功能稍微比较私人话,我们可以把他移动到 langchain/examples 之类的么? |
@dongjing007 thanks merging now. |
Implement local services: search, mathematical operations, email summary