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

Add LangChainBot and AzureOpenAIAPIBot #268

Closed
wants to merge 1 commit into from

Conversation

qfxiongbin
Copy link
Contributor

Add LangChainBot and AzureOpenAIAPIBot

@vercel
Copy link

vercel bot commented Jun 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
chatall ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 24, 2023 9:03am

Copy link
Member

@sunner sunner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

大框很棒,没啥问题。有些细节问题都 inline 备注了。

另外探讨个问题:Azure 是不是该放到 microsoft 目录下?

src/bots/index.js Outdated Show resolved Hide resolved
src/bots/LangChainBot.js Outdated Show resolved Hide resolved
src/bots/LangChainBot.js Outdated Show resolved Hide resolved
src/bots/LangChainBot.js Outdated Show resolved Hide resolved
Comment on lines 28 to 35
for (let i = 0; i < messages.length; i++) {
const message = messages[i];
if (message.role === "user") {
chatMessages.push(new HumanChatMessage(message.content));
} else if (message.role === "response") {
chatMessages.push(new AIChatMessage(message.content));
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里应该可以不再做手工转换。直接用序列化的方式,把 ChatMessage 对象存到 Context 里,后面就可以直接反序列化重建对象

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

另外,这个 messages 在代码里现在还没有保存

src/i18n/locales/zh.json Outdated Show resolved Hide resolved
src/i18n/locales/zh.json Outdated Show resolved Hide resolved
src/i18n/locales/zh.json Outdated Show resolved Hide resolved
src/i18n/locales/zh.json Outdated Show resolved Hide resolved
src/store/index.js Outdated Show resolved Hide resolved
Copy link
Member

@sunner sunner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加油,都是更小的问题了!

src/bots/microsoft/AzureOpenAIAPI35Bot.js Outdated Show resolved Hide resolved
src/bots/microsoft/AzureOpenAIAPI35Bot.js Outdated Show resolved Hide resolved
src/bots/microsoft/AzureOpenAIAPIBot.js Outdated Show resolved Hide resolved
src/bots/microsoft/AzureOpenAIAPIBot.js Outdated Show resolved Hide resolved
src/bots/microsoft/AzureOpenAIAPIBot.js Outdated Show resolved Hide resolved
src/bots/openai/OpenAIAPIBot.js Outdated Show resolved Hide resolved
src/bots/openai/OpenAIAPIBot.js Outdated Show resolved Hide resolved
src/bots/openai/OpenAIAPIBot.js Outdated Show resolved Hide resolved
src/bots/openai/OpenAIAPIBot.js Outdated Show resolved Hide resolved
});
} catch (error) {
console.error("Error sending prompt to OpenAIAPI:", error);
this.constructor._pastRounds = store.state.azureOpenaiApi.pastRounds;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

试过设置里修改 pastRounds 的值吗?能生效否?

Copy link
Member

@sunner sunner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

只有一处还可以优化,让代码更简单。加油!

src/bots/LangChainBot.js Show resolved Hide resolved
@sunner sunner closed this in c1c9386 Jun 24, 2023
tanchekwei pushed a commit to tanchekwei/ChatALL that referenced this pull request Jun 25, 2023
tanchekwei pushed a commit to tanchekwei/ChatALL that referenced this pull request Jun 25, 2023
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.

2 participants