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

Compile pg_tiktoken extension #3785

Merged
merged 1 commit into from
Mar 10, 2023
Merged

Compile pg_tiktoken extension #3785

merged 1 commit into from
Mar 10, 2023

Conversation

vadim2404
Copy link
Contributor

Describe your changes

postgres=# create extension pg_tiktoken;
CREATE EXTENSION
postgres=# select tiktoken_count('p50k_edit', 'A long time ago in a galaxy far, far away');
 tiktoken_count
----------------
             11
(1 row)

postgres=# select tiktoken_encode('cl100k_base', 'A long time ago in a galaxy far, far away');
                  tiktoken_encode
----------------------------------------------------
 {32,1317,892,4227,304,264,34261,3117,11,3117,3201}
(1 row)

Issue ticket number and link

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.
  • Do we need to implement analytics? if so did you add the relevant metrics to the dashboard?
  • If this PR requires public announcement, mark it with /release-notes label and add several sentences in this section.

@vadim2404 vadim2404 requested a review from kelvich March 10, 2023 09:50
Copy link
Contributor

@kelvich kelvich left a comment

Choose a reason for hiding this comment

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

LGTM, thanks. I'm now playing with unforking all of that and using "unsafe-postgres" thing from the last version. Works for jsonschema and tiktoken, but some problems with pgx-contrib-spiext. Will poke at it for some more time and most likely leave everything as it is until next pgx-contrib-spiext release

@vadim2404
Copy link
Contributor Author

LGTM, thanks. I'm now playing with unforking all of that and using "unsafe-postgres" thing from the last version. Works for jsonschema and tiktoken, but some problems with pgx-contrib-spiext. Will poke at it for some more time and most likely leave everything as it is until next pgx-contrib-spiext release

There is a PR that removes the dependency to pgx-contrib-spiext for pg_graphql extension:

@vadim2404 vadim2404 merged commit 2ceef91 into main Mar 10, 2023
@vadim2404 vadim2404 deleted the vk/compile_pg_tiktoken branch March 10, 2023 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants