-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add a command to generate missing mappings #254
Conversation
a231d89
to
79a174f
Compare
@elsom25 I am not able to push large files (over 5M) like embedding cache to the remote in this repo (but in other repos I did not encounter such error),
do you know how to avoid such error? |
d80b334
to
96ef778
Compare
@chesterbot01 let's split thiss into two:
|
660bbcd
to
b7a9fb3
Compare
ab60513
to
0e0d342
Compare
re #254 (review) |
# TODO: move to makefile; ruby should not need to think abuot service setup | ||
def ensure_qdrant_server_running | ||
qdrant_port = URI.parse(params[:qdrant_api_base]).port | ||
return if system("lsof -i:#{qdrant_port}", out: "/dev/null") | ||
|
||
command = "podman run -p #{qdrant_port}:#{qdrant_port} qdrant/qdrant" | ||
pid = Process.spawn(command, out: "/dev/null", err: "/dev/null") | ||
Process.detach(pid) | ||
logger.info("Started Qdrant server in the background with PID #{pid}.") | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this part of the Makefile instead? Or what challenges do you forsee with that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, done.
data/integrations/README.md
Outdated
@@ -38,6 +38,13 @@ dist/{locale}/integrations/ | |||
### Mappings | |||
The primary concern of integrations are mappings. Mappings are a set of rules that help us convert to and from the Shopify taxonomy and the taxonomy of that integration. | |||
|
|||
#### Use tooling to generate taxonomy mappings | |||
Automate your taxonomy mapping with this tool. Make sure `podman` is installed using `homebrew`, then run `make generate_mappings OPENAI_API_BASE=<base URI> OPENAI_API_KEY=<API acceess token>` to create mappings. It uses AI to assist in generating accurate mappings and reducing manual effort. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we setup .env.development.local
files to autoload things like this? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introduced dotenv to override local environment variables and updated README and .gitignore to reflect the change.
data/integrations/README.md
Outdated
#### Use tooling to generate taxonomy mappings | ||
Automate your taxonomy mapping with this tool. Install dependencies using `make setup-mapping-generation-tool`, then run `bin/generate_missing_mappings` to create mappings. It uses AI to assist in generating accurate mappings and reducing manual effort. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My guess is this was a rebase slip-in: I'm assuming 🔥 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Main things on my mind still, in importance:
qdrant
run via makefile vs in ruby-script — or at least a good reason to keep it as-is- Any common practices/facilities around our prompt we should include with this change? Thinking about promptfoo and it's kin
- Let's add https://github.com/bkeepers/dotenv? We can keep
.env
in as a template (but empty values), with both.env.development.local
and.env.test.local
git-ignored. README should signal about that at minimum, and maybe even our Makefile/dev.yml warn/assist here? - A wrapper in dev for
generate_mappings
like the other main commands.
26cc6a4
to
3f16e3a
Compare
7b79d37
to
f31cf92
Compare
f31cf92
to
54e0f17
Compare
re
moved the logic of ensure_qdrant_server_running to makefile
The current prompt is the best we've tested during hackdays. We can set up promptfoo in the tools repo, request an expert-labeled golden dataset to run the benchmark, and select the best prompt to override the current one if necessary.
done.
done. |
@@ -22,6 +22,7 @@ gem "tty-option", "~> 0.3", require: false | |||
# generate taxonomy mappings | |||
gem "qdrant-ruby", require: "qdrant" | |||
gem "ruby-openai" | |||
gem 'dotenv', groups: [:development, :test] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in the group below pls @chesterbot01
@@ -39,7 +39,15 @@ dist/{locale}/integrations/ | |||
The primary concern of integrations are mappings. Mappings are a set of rules that help us convert to and from the Shopify taxonomy and the taxonomy of that integration. | |||
|
|||
#### Use tooling to generate taxonomy mappings | |||
Automate your taxonomy mapping with this tool. Make sure `podman` is installed using `homebrew`, then run `make generate_mappings OPENAI_API_BASE=<base URI> OPENAI_API_KEY=<API acceess token>` to create mappings. It uses AI to assist in generating accurate mappings and reducing manual effort. | |||
Automate your taxonomy mapping with the CLI-based tooling. Make sure `podman` is installed using `homebrew`, set up local environment variables OPENAI_API_BASE and OPENAI_API_KEY in `.env.development.local`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shuold have a .env
files that contains something like:
OPENAI_API_BASE=
OPENAI_API_KEY=
And then our instructions should be to cp/rename this file and fill it in
Added a command
/generate_mappings
trigger the generation of taxonomy mappings.See the ticket linked to the PR for details of how it works.
To tophat, set
ENV["OPENAI_API_KEY"]
to a valid OpenAI API Token, and then runbin/generate_missing_mappings
. We will seedata/integrations/google/2021-09-21/mappings/from_shopify.yml
is updated andtmp/mapping_update_message.txt
is created.