Skip to content

Commit

Permalink
error handing for openAI Assistant object setup
Browse files Browse the repository at this point in the history
  • Loading branch information
OvidijusParsiunas committed Nov 10, 2023
1 parent 5fd7198 commit f565195
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions component/src/views/chat/messages/setupMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,15 @@ export class SetupMessages {
const openAIChat = deepChat.directConnection.openAI?.chat;
if (typeof openAIChat === 'object' && openAIChat.tools && !openAIChat.function_handler) {
return (
'Please define a `function_handler` property inside' +
` the [openAI](https://deepchat.dev/docs/directConnection/openAI#Chat) object.`
'Please define the `function_handler` property inside' +
` the openAI [chat](https://deepchat.dev/docs/directConnection/openAI#Chat) object.`
);
}
const openAIAssistant = deepChat.directConnection.openAI?.assistant;
if (typeof openAIAssistant === 'boolean' || (openAIAssistant && !openAIAssistant.assistant_id)) {
return (
'Please define the `assistant_id` property inside' +
` the openAI [assistant](https://deepchat.dev/docs/directConnection/openAI#Assistant) object.`
);
}
} else if (deepChat.request) {
Expand Down

0 comments on commit f565195

Please sign in to comment.