-
Notifications
You must be signed in to change notification settings - Fork 1
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: PPT-568 Added Controller for ChatBot #364
Conversation
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.
I'm thinking we rename openai.cr to chat_gpt.cr
just as i feel it describes the functionality better and matches the class name
Also we should make the API keys configurable per-domain. Similar to what we do in webrtc.cr
authority = current_authority.not_nil!
authority.internals["webrtc_ice"]?.try(&.to_json) || WEBRTC_DEFAULT_ICE_CONFIG
just with openai / azure credentials
also seeing this error on our dev server when opening a websocket
|
I feel like we should only create a chat if the user actually asks a question |
Yeah, but this was coded per our initial design in which call to web socket was done with initial question and payload. I removed the payload and chat, but kept the initial logic. But I agree it make more sense to create the model only after receiving the very first chat message. |
Agree and will make these changes |
private def build_executor(chat, payload : Payload?) | ||
executor = OpenAI::FunctionExecutor.new | ||
|
||
description = if payload | ||
"You have the following capability list, described in the following JSON:\n```json\n#{payload.capabilities.to_json}\n```\n" + | ||
"if a request could benefit from these capabilities you can obtain the list of functions by providing the id string.\n" + | ||
"id strings are case sensitive and must not be modified." | ||
else | ||
"if a request could benefit from a capability you can obtain the list of functions by providing the id string\n" + | ||
"id strings are case sensitive and must not be modified." | ||
end |
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.
The only thing I think that needs tweaking is this chat resume
It would be nice to have the same description with the capabilities embedded
So we need to make the LLM.new_chat
request call for chat resume so the data can be available
No description provided.