Skip to content

Commit

Permalink
tweak the way the bot is called
Browse files Browse the repository at this point in the history
  • Loading branch information
julianjelfs committed Dec 12, 2024
1 parent e7d69c9 commit 1de7462
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions frontend/openchat-client/src/openchat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7677,14 +7677,13 @@ export class OpenChat extends OpenChatAgentWorker {
}

private callBotEndpoint(bot: ExternalBotCommandInstance, token: string): Promise<unknown> {
// This will send the OC access JWT to the external bot's endpoint
const headers = new Headers();
headers.append("x-auth-jwt", token);
headers.append("Content-type", "application/json");
return fetch(`${bot.endpoint}/${bot.command.name}`, {
return fetch(`${bot.endpoint}/execute_command`, {
method: "POST",
headers: headers,
body: JSON.stringify(bot.command.params),
body: token,
}).then((res) => {
if (res.ok) {
return res.json();
Expand Down

0 comments on commit 1de7462

Please sign in to comment.