-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
大框很棒,没啥问题。有些细节问题都 inline 备注了。
另外探讨个问题:Azure 是不是该放到 microsoft 目录下?
src/bots/LangChainBot.js
Outdated
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)); | ||
} | ||
} |
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.
这里应该可以不再做手工转换。直接用序列化的方式,把 ChatMessage 对象存到 Context 里,后面就可以直接反序列化重建对象
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.
另外,这个 messages 在代码里现在还没有保存
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.
加油,都是更小的问题了!
src/bots/openai/OpenAIAPIBot.js
Outdated
}); | ||
} catch (error) { | ||
console.error("Error sending prompt to OpenAIAPI:", error); | ||
this.constructor._pastRounds = store.state.azureOpenaiApi.pastRounds; |
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.
试过设置里修改 pastRounds 的值吗?能生效否?
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.
只有一处还可以优化,让代码更简单。加油!
Add LangChainBot and AzureOpenAIAPIBot