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

(0.8.0) Check whether there are agents and show warning when sending message #1331

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/ui/UserPortal/components/ChatThread.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,20 @@ export default {
this.isMessagePending = true;
this.userSentMessage = true;

const agent = this.$appStore.getSessionAgent(this.currentSession).resource;
const agent = this.$appStore.getSessionAgent(this.currentSession)?.resource;

// Display an error toast message if agent is null or undefined.
if (!agent) {
this.$toast.add({
severity: 'info',
summary: 'Could not send message',
detail: 'Please select an agent and try again. If no agents are available, refresh the page.',
life: 8000,
});
this.isMessagePending = false;
return;
}

if (agent.long_running) {
// Handle long-running operations
const operationId = await this.$appStore.startLongRunningProcess('/completions', {
Expand Down