Skip to content

Commit

Permalink
Merge pull request #1331 from solliancenet/jdh-update-release-0.8.0-n…
Browse files Browse the repository at this point in the history
…o-agents

(0.8.0) Check whether there are agents and show warning when sending message
  • Loading branch information
ciprianjichici authored Aug 2, 2024
2 parents d3a17e1 + f22edc6 commit 756f971
Showing 1 changed file with 14 additions and 1 deletion.
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

0 comments on commit 756f971

Please sign in to comment.