-
Notifications
You must be signed in to change notification settings - Fork 7
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
Replace context AI #106
Open
Yash094
wants to merge
2
commits into
thirdweb-dev:main
Choose a base branch
from
Yash094:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+125
−73
Open
Replace context AI #106
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
DISCORD_BOT_TOKEN=<discord_bot_token> | ||
DISCORD_SUPPORT_ROLE_ID=<role_id>,<role_id> | ||
CONTEXT_ID=<use_context_id> | ||
ASKAI_CHANNEL=<channel_id_for_askai_bot> | ||
REDIS_SERVER_URL=<REDIS_SERVER_DETAILS> | ||
REDIS_SERVER_URL=<REDIS_SERVER_DETAILS> | ||
THIRDWEB_SECRET_KEY=<THIRDWEB_SECRET_KEY> | ||
NEBULA_API_ENDPOINT=<NEBULA_API_ENDPOINT> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
{ | ||
"command_prefix": "!", | ||
"utc_offset": -8, | ||
"ai_thinking_message": "**🤖 Beep Boop Boop Beep:** <a:load:1210497921158619136> thinking...", | ||
"getting_started_ai_message": "Hello, kindly use \\`!ask\\` or \\`!askai\\` followed by your question to get started.", | ||
"helpful_message": "Thank you so much for your feedback!", | ||
"not_helpful_messsage": "Thank you for your valuable feedback, this will help us improve the responses of our AI assistant.\n\nIn the meantime, would you like to contact a human customer success agent? Just click the link or the button below to submit a ticket.", | ||
"reminder_mention": "Hey there! If you need assistance, please don't hesitate to reach out on our official support platform and create a ticket: https://thirdweb.com/support. Our dedicated team is always ready to help you out. Thank you for choosing to build with us!" | ||
} | ||
|
||
"command_prefix": "!", | ||
"utc_offset": -8, | ||
"ai_thinking_message": "Nebula is thinking...", | ||
"getting_started_ai_message": "Hello, kindly use \\`!ask\\` or \\`!askai\\` followed by your question to get started.", | ||
"helpful_message": "Thank you so much for your feedback!", | ||
"not_helpful_messsage": "Thank you for your valuable feedback, this will help us improve the responses of our AI assistant.\n\nIn the meantime, would you like to contact a human customer success agent? Just click the link or the button below to submit a ticket.", | ||
"reminder_mention": "Hey there! If you need assistance, please don't hesitate to reach out on our official support platform and create a ticket: https://thirdweb.com/support. Our dedicated team is always ready to help you out. Thank you for choosing to build with us!" | ||
} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the feedback goes to us directly or the dashboard of API key owner? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All good! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
const axios = require('axios'); | ||
|
||
const { THIRDWEB_SECRET_KEY, NEBULA_API_ENDPOINT } = process.env; | ||
|
||
async function getAIResponse(query) { | ||
try { | ||
const response = await axios.post(NEBULA_API_ENDPOINT + '/chat', { | ||
message: query | ||
}, { | ||
headers: { | ||
'Content-Type': 'application/json', | ||
'x-secret-key': THIRDWEB_SECRET_KEY | ||
} | ||
}); | ||
|
||
|
||
const data = response.data; | ||
|
||
return data; // Return the data for further use | ||
} catch (error) { | ||
console.error('Error:', error); | ||
throw error; // Re-throw the error for handling in the calling function | ||
} | ||
} | ||
|
||
async function sendAIFeedback(session_id, request_id, helpful) { | ||
|
||
|
||
const response = await axios.post(NEBULA_API_ENDPOINT + '/feedback', { | ||
feedback_rating: helpful ? 1 : -1, | ||
request_id: request_id, | ||
session_id: session_id | ||
|
||
}, { | ||
headers: { | ||
'Content-Type': 'application/json', | ||
'x-secret-key': THIRDWEB_SECRET_KEY | ||
} | ||
}); | ||
return response | ||
|
||
|
||
} | ||
|
||
module.exports = { getAIResponse, sendAIFeedback }; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why we remove the redis URL?