Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Create embeddings for meeting templates #9776

Merged
merged 4 commits into from
Jun 13, 2024

Conversation

Dschoordsch
Copy link
Contributor

@Dschoordsch Dschoordsch commented May 23, 2024

Description

Fixes #9772
[Please include a summary of the changes and the related issue]

Demo

[If possible, please include a screenshot or gif/video, it'll make it easier for reviewers to understand the scope of the changes and how the change is supposed to work. If you're introducing something new or changing the existing patterns, please share a Loom and explain what decisions you've made and under what circumstances]

Testing scenarios

  • run the migration
  • start the embedder
  • wait for a bit
  • see the embeddings being generated in PG

Final checklist

  • I checked the code review guidelines
  • I have added Metrics Representative as reviewer(s) if my PR invovles metrics/data/analytics related changes
  • I have performed a self-review of my code, the same way I'd do it for any other team member
  • I have tested all cases I listed in the testing scenarios and I haven't found any issues or regressions
  • Whenever I took a non-obvious choice I added a comment explaining why I did it this way
  • I added the label Skip Maintainer Review Indicating the PR only requires reviewer review and can be merged right after it's approved if the PR introduces only minor changes, does not contain any architectural changes or does not introduce any new patterns and I think one review is sufficient'
  • PR title is human readable and could be used in changelog

@Dschoordsch
Copy link
Contributor Author

This one should wait until I verified or implemented the logic to update the updatedAt timestamp of meeting templates on prompt changes.

@Dschoordsch Dschoordsch requested a review from nickoferrall June 10, 2024 17:21
await client.query(`
DO $$
BEGIN
DELETE FROM "EmbeddingsMetadata" WHERE "objectType" = 'meetingTemplate';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 would using kysely work here instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would. I'm not sure what I would gain in that case. I guess typesafety after the up migration was run, but that seems a bit odd 🤔
Any particular reason we should use kysely in migrations?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any examples of this elsewhere and I have some concerns regarding the typecheck. The typecheck would fail before it was run. In theory we could end up with migrations which never pass typecheck if the types differ between up and down too much.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's easier to read with kysely. The big SQL string feels more error prone to me. There's a little bit more type safety too as it ensures you write alterTable etc correctly. But I don't think it matters much.

There is a recent migration from Matt that used kysely: https://github.com/ParabolInc/parabol/blob/0092d0baf6852e820384ae114f59e23294fed0e9/packages/server/postgres/migrations/1712075131388_retroReflectionGroups2.ts

@Dschoordsch Dschoordsch merged commit 095cf71 into master Jun 13, 2024
6 checks passed
@Dschoordsch Dschoordsch deleted the feat/9772/createMeetingTemplateEmbeddings branch June 13, 2024 09:27
@github-actions github-actions bot mentioned this pull request Jun 24, 2024
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AL template search: Create embeddings
2 participants