Skip to content

Commit

Permalink
Merge pull request #7 from 1239uth/base64-draft-fix
Browse files Browse the repository at this point in the history
fix: switched to Buffer class for base64 encode
  • Loading branch information
HamoonZamiri authored Nov 21, 2023
2 parents 23dc04d + 507479a commit c5ad3cc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions langchain/src/tools/gmail/create_draft.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { encodeToBase64 } from "@gomomento/sdk-core/dist/src/internal/utils/string.js";
import { GmailBaseTool, GmailBaseToolParams } from "./base.js";

export interface CreateDraftSchema {
Expand Down Expand Up @@ -41,7 +40,7 @@ export class GmailCreateDraft extends GmailBaseTool {
message,
].join("\n");

draftMessage.message.raw = encodeToBase64(email);
draftMessage.message.raw = Buffer.from(email).toString("base64url");

return draftMessage;
}
Expand Down

0 comments on commit c5ad3cc

Please sign in to comment.