-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Stip email chain quotes (#454)
- Loading branch information
1 parent
dbd9a34
commit f496040
Showing
2 changed files
with
65 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,4 +52,53 @@ describe("parseMessage", () => { | |
}))).rejects.toThrow("Could not extract clusterId from email address"); | ||
}) | ||
|
||
it("should strip trailing email chain quotes", async () => { | ||
const result = await parseMessage(buildMessageBody({ | ||
from: "[email protected]", | ||
to: [ `${clusterId}@run.inferable.ai` ], | ||
subject: "Subject", | ||
body: `Thanks, what is the current time? | ||
> On 2 Jan 2025, at 3:24=E2=80=AFpm, [email protected] wrote: | ||
>=20 | ||
> The following tools are currently available: | ||
>=20 | ||
> 1. tavily_search | ||
> - Performs web searches using Tavily's AI-powered search API | ||
> - Can specify search depth, topic, time range, and result = preferences | ||
>=20 | ||
> 2. myPostgres_getPostgresContext | ||
> - Retrieves the database schema information | ||
> - No required parameters | ||
>=20 | ||
> 3. myPostgres_executePostgresQuery | ||
> - Executes SQL queries | ||
> - Requires a valid SQL query string | ||
>=20 | ||
> 4. accessKnowledgeArtifacts | ||
> - Searches and retrieves knowledge artifacts | ||
> - Requires a search query string | ||
>=20 | ||
> 5. currentDateTime | ||
> - Gets current date and time in ISO 8601 format and unix timestamp | ||
> - No required parameters | ||
`, | ||
messageId: "<[email protected]>" | ||
})); | ||
|
||
expect(result).toBeDefined(); | ||
expect(result.body).toEqual("Thanks, what is the current time?"); | ||
}); | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters